aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/mips/user/ase/msa
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/mips/user/ase/msa')
-rw-r--r--tests/tcg/mips/user/ase/msa/README20
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmnz_v.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmz_v.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-move/test_msa_bsel_v.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c216
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c160
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/move/test_msa_move_v.c149
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c214
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sll_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sll_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sll_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sll_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sra_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sra_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sra_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_sra_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srar_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srar_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srar_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srar_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srl_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srl_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srl_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srl_w.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_b.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_d.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_h.c158
-rw-r--r--tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_w.c158
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_compile_32r5eb.sh917
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_compile_32r5el.sh917
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh643
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh643
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_run_32r5eb.sh371
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_run_32r5el.sh371
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh371
-rwxr-xr-xtests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh371
283 files changed, 50971 insertions, 0 deletions
diff --git a/tests/tcg/mips/user/ase/msa/README b/tests/tcg/mips/user/ase/msa/README
new file mode 100644
index 0000000000..ca4f070ec1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/README
@@ -0,0 +1,20 @@
+The tests in subdirectories of this directory are supposed to be compiled for
+mips64el MSA-enabled CPU (I6400, I6500), using an appropriate MIPS toolchain.
+For example:
+
+/opt/img/bin/mips-img-linux-gnu-gcc <source file> \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o <executable file>
+
+They are to be executed using QEMU user mode, using command line:
+
+mips64el-linux-user/qemu-mips64el -cpu I6400 <executable file>
+
+Helper scripts test_msa_compile.sh and test_msa_run.sh are also
+provided. This is an example of compilation and execution of all
+MSA tests:
+
+cd <QEMU root directory>
+cd tests/tcg/mips/user/ase/msa
+
+./test_msa_compile.sh
+./test_msa_run.sh
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c
new file mode 100644
index 0000000000..6ceb5aab20
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_b.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLOC.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLOC.B";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0301000301000301ULL, 0x0003010003010003ULL, },
+ { 0x0000020000020000ULL, 0x0200000200000200ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0500000103050000ULL, 0x0103050000010305ULL, },
+ { 0x0002040000000204ULL, 0x0000000204000000ULL, },
+ { 0x0600020600020600ULL, 0x0206000206000206ULL, },
+ { 0x0004000004000004ULL, 0x0000040000040000ULL, },
+ { 0x0700050003000107ULL, 0x0005000300010700ULL, },
+ { 0x0006000400020000ULL, 0x0600040002000006ULL, },
+ { 0x0800080008000800ULL, 0x0800080008000800ULL, }, /* 16 */
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0801000300050007ULL, 0x0008010003000500ULL, },
+ { 0x0000020004000600ULL, 0x0800000200040006ULL, },
+ { 0x0802000600080200ULL, 0x0600080200060008ULL, },
+ { 0x0000040008000004ULL, 0x0008000004000800ULL, },
+ { 0x0803000801000700ULL, 0x0005000803000801ULL, },
+ { 0x0000060000040008ULL, 0x0200080000060000ULL, },
+ { 0x0804000804000804ULL, 0x0008040008040008ULL, }, /* 24 */
+ { 0x0000080000080000ULL, 0x0800000800000800ULL, },
+ { 0x0805000007000008ULL, 0x0100080300080500ULL, },
+ { 0x0000080200080400ULL, 0x0006000008000008ULL, },
+ { 0x0806000008020008ULL, 0x0600000802000806ULL, },
+ { 0x0000080400000800ULL, 0x0008040000080000ULL, },
+ { 0x0807000008050000ULL, 0x0803000008010008ULL, },
+ { 0x0000080600000804ULL, 0x0000080200000800ULL, },
+ { 0x0808000008080000ULL, 0x0808000008080000ULL, }, /* 32 */
+ { 0x0000080800000808ULL, 0x0000080800000808ULL, },
+ { 0x0808010000080300ULL, 0x0008050000080700ULL, },
+ { 0x0000000802000008ULL, 0x0400000806000008ULL, },
+ { 0x0808020000080600ULL, 0x0008080200000806ULL, },
+ { 0x0000000804000008ULL, 0x0800000008040000ULL, },
+ { 0x0808030000080801ULL, 0x0000080700000008ULL, },
+ { 0x0000000806000000ULL, 0x0804000008080200ULL, },
+ { 0x0808040000080804ULL, 0x0000080804000008ULL, }, /* 40 */
+ { 0x0000000808000000ULL, 0x0808000000080800ULL, },
+ { 0x0808050000000807ULL, 0x0000000808010000ULL, },
+ { 0x0000000808020000ULL, 0x0808040000000806ULL, },
+ { 0x0808060000000808ULL, 0x0200000808060000ULL, },
+ { 0x0000000808040000ULL, 0x0008080000000808ULL, },
+ { 0x0808070000000808ULL, 0x0500000008080300ULL, },
+ { 0x0000000808060000ULL, 0x0008080400000008ULL, },
+ { 0x0808080000000808ULL, 0x0800000008080800ULL, }, /* 48 */
+ { 0x0000000808080000ULL, 0x0008080800000008ULL, },
+ { 0x0808080100000008ULL, 0x0803000000080805ULL, },
+ { 0x0000000008080200ULL, 0x0000080804000000ULL, },
+ { 0x0808080200000008ULL, 0x0806000000080808ULL, },
+ { 0x0000000008080400ULL, 0x0000080808000000ULL, },
+ { 0x0808080300000008ULL, 0x0808010000000808ULL, },
+ { 0x0000000008080600ULL, 0x0000000808040000ULL, },
+ { 0x0808080400000008ULL, 0x0808040000000808ULL, }, /* 56 */
+ { 0x0000000008080800ULL, 0x0000000808080000ULL, },
+ { 0x0808080500000000ULL, 0x0808070000000008ULL, },
+ { 0x0000000008080802ULL, 0x0000000808080400ULL, },
+ { 0x0808080600000000ULL, 0x0808080200000008ULL, },
+ { 0x0000000008080804ULL, 0x0000000008080800ULL, },
+ { 0x0808080700000000ULL, 0x0808080500000000ULL, },
+ { 0x0000000008080806ULL, 0x0000000008080804ULL, },
+ { 0x0100030200000000ULL, 0x0000000007000100ULL, }, /* 64 */
+ { 0x0501000000010200ULL, 0x0004010000000006ULL, },
+ { 0x0100010101020101ULL, 0x0002020801000000ULL, },
+ { 0x0000000000000300ULL, 0x0104010201000301ULL, },
+ { 0x0101000000010000ULL, 0x0100000102020001ULL, },
+ { 0x0200010108000005ULL, 0x0000000007010000ULL, },
+ { 0x0100000000020100ULL, 0x0100000001040100ULL, },
+ { 0x0601000401010101ULL, 0x0106000000000001ULL, },
+ { 0x0000000200010300ULL, 0x0300030001010000ULL, }, /* 72 */
+ { 0x0100020000020302ULL, 0x0100010101030100ULL, },
+ { 0x0103040402020200ULL, 0x0102000000000000ULL, },
+ { 0x0101040400010001ULL, 0x0201030000010103ULL, },
+ { 0x0300000301000300ULL, 0x0100010200000200ULL, },
+ { 0x0100000600000001ULL, 0x0401000100000000ULL, },
+ { 0x0000000000010401ULL, 0x0300010402000000ULL, },
+ { 0x0100010104000201ULL, 0x0200020200000003ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLOC_B(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLOC_B(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c
new file mode 100644
index 0000000000..897e90fbbc
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_d.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLOC.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLOC.D";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000040ULL, 0x0000000000000040ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000005ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000006ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000007ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000006ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000009ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x000000000000000aULL, 0x0000000000000006ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000bULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x000000000000000cULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x000000000000000dULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000eULL, 0x0000000000000006ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000fULL, 0x000000000000000bULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000010ULL, 0x0000000000000010ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000011ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000012ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000013ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x000000000000000cULL, },
+ { 0x0000000000000014ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000010ULL, },
+ { 0x0000000000000015ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000014ULL, },
+ { 0x0000000000000016ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000017ULL, 0x0000000000000005ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000018ULL, 0x0000000000000008ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000019ULL, 0x000000000000000bULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001aULL, 0x000000000000000eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001bULL, 0x0000000000000011ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001cULL, 0x0000000000000014ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001dULL, 0x0000000000000017ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001eULL, 0x000000000000001aULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001fULL, 0x000000000000001dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x0000000000000005ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000006ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, }, /* 72 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000002ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLOC_D(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLOC_D(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c
new file mode 100644
index 0000000000..85cf3e6f70
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_h.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLOC.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLOC.H";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0010001000100010ULL, 0x0010001000100010ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0003000000010003ULL, 0x0000000100030000ULL, },
+ { 0x0000000200000000ULL, 0x0002000000000002ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0005000000030000ULL, 0x0001000500000003ULL, },
+ { 0x0000000400000002ULL, 0x0000000000040000ULL, },
+ { 0x0006000200000006ULL, 0x0002000000060002ULL, },
+ { 0x0000000000040000ULL, 0x0000000400000000ULL, },
+ { 0x0007000500030001ULL, 0x0000000000000007ULL, },
+ { 0x0000000000000000ULL, 0x0006000400020000ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0009000000000000ULL, 0x0000000100030005ULL, },
+ { 0x0000000200040006ULL, 0x0008000000000000ULL, },
+ { 0x000a000000000002ULL, 0x0006000a00000000ULL, },
+ { 0x0000000400080000ULL, 0x0000000000040008ULL, },
+ { 0x000b000000010007ULL, 0x0000000000030009ULL, },
+ { 0x0000000600000000ULL, 0x0002000800000000ULL, },
+ { 0x000c00000004000cULL, 0x00000004000c0000ULL, }, /* 24 */
+ { 0x0000000800000000ULL, 0x0008000000000008ULL, },
+ { 0x000d000000070000ULL, 0x0001000b00000005ULL, },
+ { 0x0000000a00000004ULL, 0x0000000000080000ULL, },
+ { 0x000e0000000a0000ULL, 0x000600000002000eULL, },
+ { 0x0000000c00000008ULL, 0x0000000400000000ULL, },
+ { 0x000f0000000d0000ULL, 0x000b000000090000ULL, },
+ { 0x0000000e0000000cULL, 0x0000000a00000008ULL, },
+ { 0x0010000000100000ULL, 0x0010000000100000ULL, }, /* 32 */
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0010000100000003ULL, 0x0000000500000007ULL, },
+ { 0x0000000000020000ULL, 0x0004000000060000ULL, },
+ { 0x0010000200000006ULL, 0x0000000a0000000eULL, },
+ { 0x0000000000040000ULL, 0x00080000000c0000ULL, },
+ { 0x0010000300000009ULL, 0x0000000f00000000ULL, },
+ { 0x0000000000060000ULL, 0x000c000000100002ULL, },
+ { 0x001000040000000cULL, 0x0000001000040000ULL, }, /* 40 */
+ { 0x0000000000080000ULL, 0x0010000000000008ULL, },
+ { 0x001000050000000fULL, 0x0000000000090000ULL, },
+ { 0x00000000000a0000ULL, 0x001000040000000eULL, },
+ { 0x0010000600000010ULL, 0x00020000000e0000ULL, },
+ { 0x00000000000c0000ULL, 0x0000000800000010ULL, },
+ { 0x0010000700000010ULL, 0x0005000000100003ULL, },
+ { 0x00000000000e0000ULL, 0x0000000c00000000ULL, },
+ { 0x0010000800000010ULL, 0x0008000000100008ULL, }, /* 48 */
+ { 0x0000000000100000ULL, 0x0000001000000000ULL, },
+ { 0x0010000900000000ULL, 0x000b00000000000dULL, },
+ { 0x0000000000100002ULL, 0x0000001000040000ULL, },
+ { 0x0010000a00000000ULL, 0x000e000000000010ULL, },
+ { 0x0000000000100004ULL, 0x0000001000080000ULL, },
+ { 0x0010000b00000000ULL, 0x0010000100000010ULL, },
+ { 0x0000000000100006ULL, 0x00000000000c0000ULL, },
+ { 0x0010000c00000000ULL, 0x0010000400000010ULL, }, /* 56 */
+ { 0x0000000000100008ULL, 0x0000000000100000ULL, },
+ { 0x0010000d00000000ULL, 0x0010000700000000ULL, },
+ { 0x000000000010000aULL, 0x0000000000100004ULL, },
+ { 0x0010000e00000000ULL, 0x0010000a00000000ULL, },
+ { 0x000000000010000cULL, 0x0000000000100008ULL, },
+ { 0x0010000f00000000ULL, 0x0010000d00000000ULL, },
+ { 0x000000000010000eULL, 0x000000000010000cULL, },
+ { 0x0001000300000000ULL, 0x0000000000070001ULL, }, /* 64 */
+ { 0x0005000000000002ULL, 0x0000000100000000ULL, },
+ { 0x0001000100010001ULL, 0x0000000200010000ULL, },
+ { 0x0000000000000003ULL, 0x0001000100010003ULL, },
+ { 0x0001000000000000ULL, 0x0001000000020000ULL, },
+ { 0x0002000100080000ULL, 0x0000000000070000ULL, },
+ { 0x0001000000000001ULL, 0x0001000000010001ULL, },
+ { 0x0006000000010001ULL, 0x0001000000000000ULL, },
+ { 0x0000000000000003ULL, 0x0003000300010000ULL, }, /* 72 */
+ { 0x0001000200000003ULL, 0x0001000100010001ULL, },
+ { 0x0001000400020002ULL, 0x0001000000000000ULL, },
+ { 0x0001000400000000ULL, 0x0002000300000001ULL, },
+ { 0x0003000000010003ULL, 0x0001000100000002ULL, },
+ { 0x0001000000000000ULL, 0x0004000000000000ULL, },
+ { 0x0000000000000004ULL, 0x0003000100020000ULL, },
+ { 0x0001000100040002ULL, 0x0002000200000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLOC_H(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLOC_H(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c
new file mode 100644
index 0000000000..7ed97be2b4
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nloc_w.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLOC.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLOC.W";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000002000000020ULL, 0x0000002000000020ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000300000001ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000200000000ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000500000003ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000004ULL, },
+ { 0x0000000600000000ULL, 0x0000000200000006ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000000ULL, },
+ { 0x0000000700000003ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000600000002ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000900000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000004ULL, 0x0000000800000000ULL, },
+ { 0x0000000a00000000ULL, 0x0000000600000000ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000004ULL, },
+ { 0x0000000b00000001ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000200000000ULL, },
+ { 0x0000000c00000004ULL, 0x000000000000000cULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000800000000ULL, },
+ { 0x0000000d00000007ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x0000000e0000000aULL, 0x0000000600000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000f0000000dULL, 0x0000000b00000009ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000001100000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000400000006ULL, },
+ { 0x0000001200000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000004ULL, 0x000000080000000cULL, },
+ { 0x0000001300000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000006ULL, 0x0000000c00000012ULL, },
+ { 0x0000001400000000ULL, 0x0000000000000004ULL, }, /* 40 */
+ { 0x0000000000000008ULL, 0x0000001000000000ULL, },
+ { 0x0000001500000000ULL, 0x0000000000000009ULL, },
+ { 0x000000000000000aULL, 0x0000001400000000ULL, },
+ { 0x0000001600000000ULL, 0x000000020000000eULL, },
+ { 0x000000000000000cULL, 0x0000000000000000ULL, },
+ { 0x0000001700000000ULL, 0x0000000500000013ULL, },
+ { 0x000000000000000eULL, 0x0000000000000000ULL, },
+ { 0x0000001800000000ULL, 0x0000000800000018ULL, }, /* 48 */
+ { 0x0000000000000010ULL, 0x0000000000000000ULL, },
+ { 0x0000001900000000ULL, 0x0000000b00000000ULL, },
+ { 0x0000000000000012ULL, 0x0000000000000004ULL, },
+ { 0x0000001a00000000ULL, 0x0000000e00000000ULL, },
+ { 0x0000000000000014ULL, 0x0000000000000008ULL, },
+ { 0x0000001b00000000ULL, 0x0000001100000000ULL, },
+ { 0x0000000000000016ULL, 0x000000000000000cULL, },
+ { 0x0000001c00000000ULL, 0x0000001400000000ULL, }, /* 56 */
+ { 0x0000000000000018ULL, 0x0000000000000010ULL, },
+ { 0x0000001d00000000ULL, 0x0000001700000000ULL, },
+ { 0x000000000000001aULL, 0x0000000000000014ULL, },
+ { 0x0000001e00000000ULL, 0x0000001a00000000ULL, },
+ { 0x000000000000001cULL, 0x0000000000000018ULL, },
+ { 0x0000001f00000000ULL, 0x0000001d00000000ULL, },
+ { 0x000000000000001eULL, 0x000000000000001cULL, },
+ { 0x0000000100000000ULL, 0x0000000000000007ULL, }, /* 64 */
+ { 0x0000000500000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000002ULL, },
+ { 0x0000000200000008ULL, 0x0000000000000007ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0x0000000600000001ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000300000001ULL, }, /* 72 */
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000002ULL, 0x0000000100000000ULL, },
+ { 0x0000000100000000ULL, 0x0000000200000000ULL, },
+ { 0x0000000300000001ULL, 0x0000000100000000ULL, },
+ { 0x0000000100000000ULL, 0x0000000400000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000300000002ULL, },
+ { 0x0000000100000004ULL, 0x0000000200000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLOC_W(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLOC_W(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c
new file mode 100644
index 0000000000..2103d5fbfe
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_b.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLZC.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLZC.B";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0000020000020000ULL, 0x0200000200000200ULL, },
+ { 0x0301000301000301ULL, 0x0003010003010003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0002040000000204ULL, 0x0000000204000000ULL, },
+ { 0x0500000103050000ULL, 0x0103050000010305ULL, },
+ { 0x0004000004000004ULL, 0x0000040000040000ULL, },
+ { 0x0600020600020600ULL, 0x0206000206000206ULL, },
+ { 0x0006000400020000ULL, 0x0600040002000006ULL, },
+ { 0x0700050003000107ULL, 0x0005000300010700ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, }, /* 16 */
+ { 0x0800080008000800ULL, 0x0800080008000800ULL, },
+ { 0x0000020004000600ULL, 0x0800000200040006ULL, },
+ { 0x0801000300050007ULL, 0x0008010003000500ULL, },
+ { 0x0000040008000004ULL, 0x0008000004000800ULL, },
+ { 0x0802000600080200ULL, 0x0600080200060008ULL, },
+ { 0x0000060000040008ULL, 0x0200080000060000ULL, },
+ { 0x0803000801000700ULL, 0x0005000803000801ULL, },
+ { 0x0000080000080000ULL, 0x0800000800000800ULL, }, /* 24 */
+ { 0x0804000804000804ULL, 0x0008040008040008ULL, },
+ { 0x0000080200080400ULL, 0x0006000008000008ULL, },
+ { 0x0805000007000008ULL, 0x0100080300080500ULL, },
+ { 0x0000080400000800ULL, 0x0008040000080000ULL, },
+ { 0x0806000008020008ULL, 0x0600000802000806ULL, },
+ { 0x0000080600000804ULL, 0x0000080200000800ULL, },
+ { 0x0807000008050000ULL, 0x0803000008010008ULL, },
+ { 0x0000080800000808ULL, 0x0000080800000808ULL, }, /* 32 */
+ { 0x0808000008080000ULL, 0x0808000008080000ULL, },
+ { 0x0000000802000008ULL, 0x0400000806000008ULL, },
+ { 0x0808010000080300ULL, 0x0008050000080700ULL, },
+ { 0x0000000804000008ULL, 0x0800000008040000ULL, },
+ { 0x0808020000080600ULL, 0x0008080200000806ULL, },
+ { 0x0000000806000000ULL, 0x0804000008080200ULL, },
+ { 0x0808030000080801ULL, 0x0000080700000008ULL, },
+ { 0x0000000808000000ULL, 0x0808000000080800ULL, }, /* 40 */
+ { 0x0808040000080804ULL, 0x0000080804000008ULL, },
+ { 0x0000000808020000ULL, 0x0808040000000806ULL, },
+ { 0x0808050000000807ULL, 0x0000000808010000ULL, },
+ { 0x0000000808040000ULL, 0x0008080000000808ULL, },
+ { 0x0808060000000808ULL, 0x0200000808060000ULL, },
+ { 0x0000000808060000ULL, 0x0008080400000008ULL, },
+ { 0x0808070000000808ULL, 0x0500000008080300ULL, },
+ { 0x0000000808080000ULL, 0x0008080800000008ULL, }, /* 48 */
+ { 0x0808080000000808ULL, 0x0800000008080800ULL, },
+ { 0x0000000008080200ULL, 0x0000080804000000ULL, },
+ { 0x0808080100000008ULL, 0x0803000000080805ULL, },
+ { 0x0000000008080400ULL, 0x0000080808000000ULL, },
+ { 0x0808080200000008ULL, 0x0806000000080808ULL, },
+ { 0x0000000008080600ULL, 0x0000000808040000ULL, },
+ { 0x0808080300000008ULL, 0x0808010000000808ULL, },
+ { 0x0000000008080800ULL, 0x0000000808080000ULL, }, /* 56 */
+ { 0x0808080400000008ULL, 0x0808040000000808ULL, },
+ { 0x0000000008080802ULL, 0x0000000808080400ULL, },
+ { 0x0808080500000000ULL, 0x0808070000000008ULL, },
+ { 0x0000000008080804ULL, 0x0000000008080800ULL, },
+ { 0x0808080600000000ULL, 0x0808080200000008ULL, },
+ { 0x0000000008080806ULL, 0x0000000008080804ULL, },
+ { 0x0808080700000000ULL, 0x0808080500000000ULL, },
+ { 0x0001000002010101ULL, 0x0101040100010004ULL, }, /* 64 */
+ { 0x0000080101000004ULL, 0x0300000303020100ULL, },
+ { 0x0001000000000000ULL, 0x0200000000020203ULL, },
+ { 0x0101030101020001ULL, 0x0000000000010000ULL, },
+ { 0x0000010101000101ULL, 0x0002010000000100ULL, },
+ { 0x0002000000040200ULL, 0x0304010100000201ULL, },
+ { 0x0002010501000001ULL, 0x0002040200000001ULL, },
+ { 0x0000020000000000ULL, 0x0000010203010100ULL, },
+ { 0x0203040001000001ULL, 0x0001000200000201ULL, }, /* 72 */
+ { 0x0001000301000000ULL, 0x0002000000000001ULL, },
+ { 0x0000000000000003ULL, 0x0000010101040103ULL, },
+ { 0x0000000002000100ULL, 0x0000000101000000ULL, },
+ { 0x0003020000010004ULL, 0x0001000001010003ULL, },
+ { 0x0001020003020100ULL, 0x0000020001040201ULL, },
+ { 0x0102010102000000ULL, 0x0001000000030201ULL, },
+ { 0x0001000000010000ULL, 0x0001000001010300ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLZC_B(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLZC_B(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c
new file mode 100644
index 0000000000..b1ca3d44aa
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_d.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLZC.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLZC.D";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000040ULL, 0x0000000000000040ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000005ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000006ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000006ULL, },
+ { 0x0000000000000007ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000009ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000aULL, 0x0000000000000006ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x000000000000000bULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, }, /* 24 */
+ { 0x000000000000000cULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000dULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000eULL, 0x0000000000000006ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000000fULL, 0x000000000000000bULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000010ULL, 0x0000000000000010ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000011ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000012ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x000000000000000cULL, },
+ { 0x0000000000000013ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000010ULL, }, /* 40 */
+ { 0x0000000000000014ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000014ULL, },
+ { 0x0000000000000015ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000016ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000017ULL, 0x0000000000000005ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000018ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000019ULL, 0x000000000000000bULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001aULL, 0x000000000000000eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001bULL, 0x0000000000000011ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x000000000000001cULL, 0x0000000000000014ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001dULL, 0x0000000000000017ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001eULL, 0x000000000000001aULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000001fULL, 0x000000000000001dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLZC_D(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLZC_D(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c
new file mode 100644
index 0000000000..6531c67a86
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_h.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLZC.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLZC.H";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0010001000100010ULL, 0x0010001000100010ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x0000000200000000ULL, 0x0002000000000002ULL, },
+ { 0x0003000000010003ULL, 0x0000000100030000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0000000400000002ULL, 0x0000000000040000ULL, },
+ { 0x0005000000030000ULL, 0x0001000500000003ULL, },
+ { 0x0000000000040000ULL, 0x0000000400000000ULL, },
+ { 0x0006000200000006ULL, 0x0002000000060002ULL, },
+ { 0x0000000000000000ULL, 0x0006000400020000ULL, },
+ { 0x0007000500030001ULL, 0x0000000000000007ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0000000200040006ULL, 0x0008000000000000ULL, },
+ { 0x0009000000000000ULL, 0x0000000100030005ULL, },
+ { 0x0000000400080000ULL, 0x0000000000040008ULL, },
+ { 0x000a000000000002ULL, 0x0006000a00000000ULL, },
+ { 0x0000000600000000ULL, 0x0002000800000000ULL, },
+ { 0x000b000000010007ULL, 0x0000000000030009ULL, },
+ { 0x0000000800000000ULL, 0x0008000000000008ULL, }, /* 24 */
+ { 0x000c00000004000cULL, 0x00000004000c0000ULL, },
+ { 0x0000000a00000004ULL, 0x0000000000080000ULL, },
+ { 0x000d000000070000ULL, 0x0001000b00000005ULL, },
+ { 0x0000000c00000008ULL, 0x0000000400000000ULL, },
+ { 0x000e0000000a0000ULL, 0x000600000002000eULL, },
+ { 0x0000000e0000000cULL, 0x0000000a00000008ULL, },
+ { 0x000f0000000d0000ULL, 0x000b000000090000ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, }, /* 32 */
+ { 0x0010000000100000ULL, 0x0010000000100000ULL, },
+ { 0x0000000000020000ULL, 0x0004000000060000ULL, },
+ { 0x0010000100000003ULL, 0x0000000500000007ULL, },
+ { 0x0000000000040000ULL, 0x00080000000c0000ULL, },
+ { 0x0010000200000006ULL, 0x0000000a0000000eULL, },
+ { 0x0000000000060000ULL, 0x000c000000100002ULL, },
+ { 0x0010000300000009ULL, 0x0000000f00000000ULL, },
+ { 0x0000000000080000ULL, 0x0010000000000008ULL, }, /* 40 */
+ { 0x001000040000000cULL, 0x0000001000040000ULL, },
+ { 0x00000000000a0000ULL, 0x001000040000000eULL, },
+ { 0x001000050000000fULL, 0x0000000000090000ULL, },
+ { 0x00000000000c0000ULL, 0x0000000800000010ULL, },
+ { 0x0010000600000010ULL, 0x00020000000e0000ULL, },
+ { 0x00000000000e0000ULL, 0x0000000c00000000ULL, },
+ { 0x0010000700000010ULL, 0x0005000000100003ULL, },
+ { 0x0000000000100000ULL, 0x0000001000000000ULL, }, /* 48 */
+ { 0x0010000800000010ULL, 0x0008000000100008ULL, },
+ { 0x0000000000100002ULL, 0x0000001000040000ULL, },
+ { 0x0010000900000000ULL, 0x000b00000000000dULL, },
+ { 0x0000000000100004ULL, 0x0000001000080000ULL, },
+ { 0x0010000a00000000ULL, 0x000e000000000010ULL, },
+ { 0x0000000000100006ULL, 0x00000000000c0000ULL, },
+ { 0x0010000b00000000ULL, 0x0010000100000010ULL, },
+ { 0x0000000000100008ULL, 0x0000000000100000ULL, }, /* 56 */
+ { 0x0010000c00000000ULL, 0x0010000400000010ULL, },
+ { 0x000000000010000aULL, 0x0000000000100004ULL, },
+ { 0x0010000d00000000ULL, 0x0010000700000000ULL, },
+ { 0x000000000010000cULL, 0x0000000000100008ULL, },
+ { 0x0010000e00000000ULL, 0x0010000a00000000ULL, },
+ { 0x000000000010000eULL, 0x000000000010000cULL, },
+ { 0x0010000f00000000ULL, 0x0010000d00000000ULL, },
+ { 0x0000000000020001ULL, 0x0001000400000000ULL, }, /* 64 */
+ { 0x0000000900010000ULL, 0x0003000000030001ULL, },
+ { 0x0000000000000000ULL, 0x0002000000000002ULL, },
+ { 0x0001000300010000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100010001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000002ULL, 0x0003000100000002ULL, },
+ { 0x0000000100010000ULL, 0x0000000400000000ULL, },
+ { 0x0000000200000000ULL, 0x0000000100030001ULL, },
+ { 0x0002000400010000ULL, 0x0000000000000002ULL, }, /* 72 */
+ { 0x0000000000010000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000100010001ULL, },
+ { 0x0000000000020001ULL, 0x0000000000010000ULL, },
+ { 0x0000000200000000ULL, 0x0000000000010000ULL, },
+ { 0x0000000200030001ULL, 0x0000000200010002ULL, },
+ { 0x0001000100020000ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000010003ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLZC_H(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLZC_H(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c
new file mode 100644
index 0000000000..71db53c9fe
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_nlzc_w.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction NLZC.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "NLZC.W";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000002000000020ULL, 0x0000002000000020ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000200000000ULL, },
+ { 0x0000000300000001ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000004ULL, },
+ { 0x0000000500000003ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000000ULL, },
+ { 0x0000000600000000ULL, 0x0000000200000006ULL, },
+ { 0x0000000000000000ULL, 0x0000000600000002ULL, },
+ { 0x0000000700000003ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000000000004ULL, 0x0000000800000000ULL, },
+ { 0x0000000900000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000004ULL, },
+ { 0x0000000a00000000ULL, 0x0000000600000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000200000000ULL, },
+ { 0x0000000b00000001ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000800000000ULL, }, /* 24 */
+ { 0x0000000c00000004ULL, 0x000000000000000cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000008ULL, },
+ { 0x0000000d00000007ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000e0000000aULL, 0x0000000600000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000f0000000dULL, 0x0000000b00000009ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000000000000002ULL, 0x0000000400000006ULL, },
+ { 0x0000001100000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000004ULL, 0x000000080000000cULL, },
+ { 0x0000001200000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000006ULL, 0x0000000c00000012ULL, },
+ { 0x0000001300000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000008ULL, 0x0000001000000000ULL, }, /* 40 */
+ { 0x0000001400000000ULL, 0x0000000000000004ULL, },
+ { 0x000000000000000aULL, 0x0000001400000000ULL, },
+ { 0x0000001500000000ULL, 0x0000000000000009ULL, },
+ { 0x000000000000000cULL, 0x0000000000000000ULL, },
+ { 0x0000001600000000ULL, 0x000000020000000eULL, },
+ { 0x000000000000000eULL, 0x0000000000000000ULL, },
+ { 0x0000001700000000ULL, 0x0000000500000013ULL, },
+ { 0x0000000000000010ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000001800000000ULL, 0x0000000800000018ULL, },
+ { 0x0000000000000012ULL, 0x0000000000000004ULL, },
+ { 0x0000001900000000ULL, 0x0000000b00000000ULL, },
+ { 0x0000000000000014ULL, 0x0000000000000008ULL, },
+ { 0x0000001a00000000ULL, 0x0000000e00000000ULL, },
+ { 0x0000000000000016ULL, 0x000000000000000cULL, },
+ { 0x0000001b00000000ULL, 0x0000001100000000ULL, },
+ { 0x0000000000000018ULL, 0x0000000000000010ULL, }, /* 56 */
+ { 0x0000001c00000000ULL, 0x0000001400000000ULL, },
+ { 0x000000000000001aULL, 0x0000000000000014ULL, },
+ { 0x0000001d00000000ULL, 0x0000001700000000ULL, },
+ { 0x000000000000001cULL, 0x0000000000000018ULL, },
+ { 0x0000001e00000000ULL, 0x0000001a00000000ULL, },
+ { 0x000000000000001eULL, 0x000000000000001cULL, },
+ { 0x0000001f00000000ULL, 0x0000001d00000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000100000000ULL, }, /* 64 */
+ { 0x0000000000000001ULL, 0x0000000300000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000200000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000300000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000200000001ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000001ULL, },
+ { 0x0000000100000002ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_NLZC_W(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_NLZC_W(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c
new file mode 100644
index 0000000000..184f7f4a49
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_b.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction PCNT.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "PCNT.B";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0504030504030504ULL, 0x0305040305040305ULL, },
+ { 0x0304050304050304ULL, 0x0503040503040503ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, }, /* 8 */
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0505040303050504ULL, 0x0303050504030305ULL, },
+ { 0x0303040505030304ULL, 0x0505030304050503ULL, },
+ { 0x0604020604020604ULL, 0x0206040206040206ULL, },
+ { 0x0204060204060204ULL, 0x0602040602040602ULL, },
+ { 0x0702050403060107ULL, 0x0205040306010702ULL, },
+ { 0x0106030405020701ULL, 0x0603040502070106ULL, },
+ { 0x0800080008000800ULL, 0x0800080008000800ULL, }, /* 16 */
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0801060304050207ULL, 0x0008010603040502ULL, },
+ { 0x0007020504030601ULL, 0x0800070205040306ULL, },
+ { 0x0802040600080204ULL, 0x0600080204060008ULL, },
+ { 0x0006040208000604ULL, 0x0208000604020800ULL, },
+ { 0x0803020801040700ULL, 0x0605000803020801ULL, },
+ { 0x0005060007040108ULL, 0x0203080005060007ULL, },
+ { 0x0804000804000804ULL, 0x0008040008040008ULL, }, /* 24 */
+ { 0x0004080004080004ULL, 0x0800040800040800ULL, },
+ { 0x0805000607000408ULL, 0x0102080300080500ULL, },
+ { 0x0003080201080400ULL, 0x0706000508000308ULL, },
+ { 0x0806000408020008ULL, 0x0600040802000806ULL, },
+ { 0x0002080400060800ULL, 0x0208040006080002ULL, },
+ { 0x0807000208050004ULL, 0x0803000608010008ULL, },
+ { 0x0001080600030804ULL, 0x0005080200070800ULL, },
+ { 0x0808000008080000ULL, 0x0808000008080000ULL, }, /* 32 */
+ { 0x0000080800000808ULL, 0x0000080800000808ULL, },
+ { 0x0808010006080300ULL, 0x0408050002080700ULL, },
+ { 0x0000070802000508ULL, 0x0400030806000108ULL, },
+ { 0x0808020004080600ULL, 0x0008080200040806ULL, },
+ { 0x0000060804000208ULL, 0x0800000608040002ULL, },
+ { 0x0808030002080801ULL, 0x0004080700000608ULL, },
+ { 0x0000050806000007ULL, 0x0804000108080200ULL, },
+ { 0x0808040000080804ULL, 0x0000080804000008ULL, }, /* 40 */
+ { 0x0000040808000004ULL, 0x0808000004080800ULL, },
+ { 0x0808050000060807ULL, 0x0000040808010002ULL, },
+ { 0x0000030808020001ULL, 0x0808040000070806ULL, },
+ { 0x0808060000040808ULL, 0x0200000808060000ULL, },
+ { 0x0000020808040000ULL, 0x0608080000020808ULL, },
+ { 0x0808070000020808ULL, 0x0500000408080300ULL, },
+ { 0x0000010808060000ULL, 0x0308080400000508ULL, },
+ { 0x0808080000000808ULL, 0x0800000008080800ULL, }, /* 48 */
+ { 0x0000000808080000ULL, 0x0008080800000008ULL, },
+ { 0x0808080100000608ULL, 0x0803000004080805ULL, },
+ { 0x0000000708080200ULL, 0x0005080804000003ULL, },
+ { 0x0808080200000408ULL, 0x0806000000080808ULL, },
+ { 0x0000000608080400ULL, 0x0002080808000000ULL, },
+ { 0x0808080300000208ULL, 0x0808010000040808ULL, },
+ { 0x0000000508080600ULL, 0x0000070808040000ULL, },
+ { 0x0808080400000008ULL, 0x0808040000000808ULL, }, /* 56 */
+ { 0x0000000408080800ULL, 0x0000040808080000ULL, },
+ { 0x0808080500000006ULL, 0x0808070000000408ULL, },
+ { 0x0000000308080802ULL, 0x0000010808080400ULL, },
+ { 0x0808080600000004ULL, 0x0808080200000008ULL, },
+ { 0x0000000208080804ULL, 0x0000000608080800ULL, },
+ { 0x0808080700000002ULL, 0x0808080500000004ULL, },
+ { 0x0000000108080806ULL, 0x0000000308080804ULL, },
+ { 0x0204050402030401ULL, 0x0405030507060302ULL, }, /* 64 */
+ { 0x0706000404040501ULL, 0x0207060303060306ULL, },
+ { 0x0404050405060401ULL, 0x0404040805040302ULL, },
+ { 0x0305030405030404ULL, 0x0405020404020402ULL, },
+ { 0x0503050506060203ULL, 0x0302050505050405ULL, },
+ { 0x0304060308020406ULL, 0x0403020207040204ULL, },
+ { 0x0405030204040503ULL, 0x0303010207040503ULL, },
+ { 0x0605030404040602ULL, 0x0407040502020505ULL, },
+ { 0x0104020504050503ULL, 0x0705030404040403ULL, }, /* 72 */
+ { 0x0405050304050506ULL, 0x0402050302050504ULL, },
+ { 0x0304060604050404ULL, 0x0403040305030502ULL, },
+ { 0x0304050503030305ULL, 0x0404040505050306ULL, },
+ { 0x0502030504030502ULL, 0x0303030504050403ULL, },
+ { 0x0303040703030303ULL, 0x0603040404030405ULL, },
+ { 0x0302020402060704ULL, 0x0604030705030204ULL, },
+ { 0x0404050305040605ULL, 0x0404050504030405ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_PCNT_B(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_PCNT_B(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c
new file mode 100644
index 0000000000..3cc0d851b2
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_d.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction PCNT.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "PCNT.D";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000040ULL, 0x0000000000000040ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000021ULL, 0x0000000000000020ULL, },
+ { 0x000000000000001fULL, 0x0000000000000020ULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, }, /* 8 */
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000022ULL, 0x000000000000001fULL, },
+ { 0x000000000000001eULL, 0x0000000000000021ULL, },
+ { 0x0000000000000022ULL, 0x0000000000000020ULL, },
+ { 0x000000000000001eULL, 0x0000000000000020ULL, },
+ { 0x0000000000000023ULL, 0x000000000000001eULL, },
+ { 0x000000000000001dULL, 0x0000000000000022ULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, }, /* 16 */
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000024ULL, 0x000000000000001dULL, },
+ { 0x000000000000001cULL, 0x0000000000000023ULL, },
+ { 0x0000000000000022ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001eULL, 0x000000000000001eULL, },
+ { 0x0000000000000021ULL, 0x0000000000000021ULL, },
+ { 0x000000000000001fULL, 0x000000000000001fULL, },
+ { 0x0000000000000024ULL, 0x0000000000000020ULL, }, /* 24 */
+ { 0x000000000000001cULL, 0x0000000000000020ULL, },
+ { 0x0000000000000026ULL, 0x000000000000001bULL, },
+ { 0x000000000000001aULL, 0x0000000000000025ULL, },
+ { 0x0000000000000024ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001cULL, 0x000000000000001eULL, },
+ { 0x0000000000000022ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001eULL, 0x000000000000001eULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, }, /* 32 */
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000022ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001eULL, 0x000000000000001eULL, },
+ { 0x0000000000000024ULL, 0x0000000000000024ULL, },
+ { 0x000000000000001cULL, 0x000000000000001cULL, },
+ { 0x0000000000000026ULL, 0x0000000000000021ULL, },
+ { 0x000000000000001aULL, 0x000000000000001fULL, },
+ { 0x0000000000000028ULL, 0x000000000000001cULL, }, /* 40 */
+ { 0x0000000000000018ULL, 0x0000000000000024ULL, },
+ { 0x000000000000002aULL, 0x0000000000000017ULL, },
+ { 0x0000000000000016ULL, 0x0000000000000029ULL, },
+ { 0x000000000000002aULL, 0x0000000000000018ULL, },
+ { 0x0000000000000016ULL, 0x0000000000000028ULL, },
+ { 0x0000000000000029ULL, 0x000000000000001cULL, },
+ { 0x0000000000000017ULL, 0x0000000000000024ULL, },
+ { 0x0000000000000028ULL, 0x0000000000000020ULL, }, /* 48 */
+ { 0x0000000000000018ULL, 0x0000000000000020ULL, },
+ { 0x0000000000000027ULL, 0x0000000000000024ULL, },
+ { 0x0000000000000019ULL, 0x000000000000001cULL, },
+ { 0x0000000000000026ULL, 0x0000000000000026ULL, },
+ { 0x000000000000001aULL, 0x000000000000001aULL, },
+ { 0x0000000000000025ULL, 0x0000000000000025ULL, },
+ { 0x000000000000001bULL, 0x000000000000001bULL, },
+ { 0x0000000000000024ULL, 0x0000000000000024ULL, }, /* 56 */
+ { 0x000000000000001cULL, 0x000000000000001cULL, },
+ { 0x0000000000000023ULL, 0x0000000000000023ULL, },
+ { 0x000000000000001dULL, 0x000000000000001dULL, },
+ { 0x0000000000000022ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001eULL, 0x000000000000001eULL, },
+ { 0x0000000000000021ULL, 0x0000000000000021ULL, },
+ { 0x000000000000001fULL, 0x000000000000001fULL, },
+ { 0x0000000000000019ULL, 0x0000000000000023ULL, }, /* 64 */
+ { 0x000000000000001fULL, 0x0000000000000024ULL, },
+ { 0x0000000000000021ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001fULL, 0x000000000000001bULL, },
+ { 0x0000000000000023ULL, 0x0000000000000022ULL, },
+ { 0x0000000000000024ULL, 0x000000000000001cULL, },
+ { 0x000000000000001eULL, 0x000000000000001cULL, },
+ { 0x0000000000000022ULL, 0x0000000000000022ULL, },
+ { 0x000000000000001dULL, 0x0000000000000022ULL, }, /* 72 */
+ { 0x0000000000000025ULL, 0x000000000000001eULL, },
+ { 0x0000000000000024ULL, 0x000000000000001dULL, },
+ { 0x000000000000001fULL, 0x0000000000000024ULL, },
+ { 0x000000000000001dULL, 0x000000000000001eULL, },
+ { 0x000000000000001dULL, 0x0000000000000021ULL, },
+ { 0x000000000000001eULL, 0x0000000000000022ULL, },
+ { 0x0000000000000024ULL, 0x0000000000000022ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_PCNT_D(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_PCNT_D(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c
new file mode 100644
index 0000000000..f1052b3c26
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_h.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction PCNT.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "PCNT.H";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0010001000100010ULL, 0x0010001000100010ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0009000800070009ULL, 0x0008000700090008ULL, },
+ { 0x0007000800090007ULL, 0x0008000900070008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, }, /* 8 */
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x000a000700080009ULL, 0x0006000a00070008ULL, },
+ { 0x0006000900080007ULL, 0x000a000600090008ULL, },
+ { 0x000a00080006000aULL, 0x00080006000a0008ULL, },
+ { 0x00060008000a0006ULL, 0x0008000a00060008ULL, },
+ { 0x0009000900090008ULL, 0x0007000700070009ULL, },
+ { 0x0007000700070008ULL, 0x0009000900090007ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, }, /* 16 */
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0009000900090009ULL, 0x0008000700070007ULL, },
+ { 0x0007000700070007ULL, 0x0008000900090009ULL, },
+ { 0x000a000a00080006ULL, 0x0006000a000a0008ULL, },
+ { 0x000600060008000aULL, 0x000a000600060008ULL, },
+ { 0x000b000a00050007ULL, 0x000b000800050009ULL, },
+ { 0x00050006000b0009ULL, 0x00050008000b0007ULL, },
+ { 0x000c00080004000cULL, 0x00080004000c0008ULL, }, /* 24 */
+ { 0x00040008000c0004ULL, 0x0008000c00040008ULL, },
+ { 0x000d00060007000cULL, 0x0003000b00080005ULL, },
+ { 0x0003000a00090004ULL, 0x000d00050008000bULL, },
+ { 0x000e0004000a0008ULL, 0x0006000c0002000eULL, },
+ { 0x0002000c00060008ULL, 0x000a0004000e0002ULL, },
+ { 0x000f0002000d0004ULL, 0x000b000600090008ULL, },
+ { 0x0001000e0003000cULL, 0x0005000a00070008ULL, },
+ { 0x0010000000100000ULL, 0x0010000000100000ULL, }, /* 32 */
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x00100001000e0003ULL, 0x000c0005000a0007ULL, },
+ { 0x0000000f0002000dULL, 0x0004000b00060009ULL, },
+ { 0x00100002000c0006ULL, 0x0008000a0004000eULL, },
+ { 0x0000000e0004000aULL, 0x00080006000c0002ULL, },
+ { 0x00100003000a0009ULL, 0x0004000f0000000eULL, },
+ { 0x0000000d00060007ULL, 0x000c000100100002ULL, },
+ { 0x001000040008000cULL, 0x0000001000040008ULL, }, /* 40 */
+ { 0x0000000c00080004ULL, 0x00100000000c0008ULL, },
+ { 0x001000050006000fULL, 0x0000000c00090002ULL, },
+ { 0x0000000b000a0001ULL, 0x001000040007000eULL, },
+ { 0x0010000600040010ULL, 0x00020008000e0000ULL, },
+ { 0x0000000a000c0000ULL, 0x000e000800020010ULL, },
+ { 0x0010000700020010ULL, 0x0005000400100003ULL, },
+ { 0x00000009000e0000ULL, 0x000b000c0000000dULL, },
+ { 0x0010000800000010ULL, 0x0008000000100008ULL, }, /* 48 */
+ { 0x0000000800100000ULL, 0x0008001000000008ULL, },
+ { 0x001000090000000eULL, 0x000b0000000c000dULL, },
+ { 0x0000000700100002ULL, 0x0005001000040003ULL, },
+ { 0x0010000a0000000cULL, 0x000e000000080010ULL, },
+ { 0x0000000600100004ULL, 0x0002001000080000ULL, },
+ { 0x0010000b0000000aULL, 0x0010000100040010ULL, },
+ { 0x0000000500100006ULL, 0x0000000f000c0000ULL, },
+ { 0x0010000c00000008ULL, 0x0010000400000010ULL, }, /* 56 */
+ { 0x0000000400100008ULL, 0x0000000c00100000ULL, },
+ { 0x0010000d00000006ULL, 0x001000070000000cULL, },
+ { 0x000000030010000aULL, 0x0000000900100004ULL, },
+ { 0x0010000e00000004ULL, 0x0010000a00000008ULL, },
+ { 0x000000020010000cULL, 0x0000000600100008ULL, },
+ { 0x0010000f00000002ULL, 0x0010000d00000004ULL, },
+ { 0x000000010010000eULL, 0x000000030010000cULL, },
+ { 0x0006000900050005ULL, 0x00090008000d0005ULL, }, /* 64 */
+ { 0x000d000400080006ULL, 0x0009000900090009ULL, },
+ { 0x00080009000b0005ULL, 0x0008000c00090005ULL, },
+ { 0x0008000700080008ULL, 0x0009000600060006ULL, },
+ { 0x0008000a000c0005ULL, 0x0005000a000a0009ULL, },
+ { 0x00070009000a000aULL, 0x00070004000b0006ULL, },
+ { 0x0009000500080008ULL, 0x00060003000b0008ULL, },
+ { 0x000b000700080008ULL, 0x000b00090004000aULL, },
+ { 0x0005000700090008ULL, 0x000c000700080007ULL, }, /* 72 */
+ { 0x000900080009000bULL, 0x0006000800070009ULL, },
+ { 0x0007000c00090008ULL, 0x0007000700080007ULL, },
+ { 0x0007000a00060008ULL, 0x00080009000a0009ULL, },
+ { 0x0007000800070007ULL, 0x0006000800090007ULL, },
+ { 0x0006000b00060006ULL, 0x0009000800070009ULL, },
+ { 0x000500060008000bULL, 0x000a000a00080006ULL, },
+ { 0x000800080009000bULL, 0x0008000a00070009ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_PCNT_H(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_PCNT_H(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c
new file mode 100644
index 0000000000..625ef29406
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-count/test_msa_pcnt_w.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction PCNT.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Count";
+ char *instruction_name = "PCNT.W";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000002000000020ULL, 0x0000002000000020ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001100000010ULL, 0x0000000f00000011ULL, },
+ { 0x0000000f00000010ULL, 0x000000110000000fULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, }, /* 8 */
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001100000011ULL, 0x000000100000000fULL, },
+ { 0x0000000f0000000fULL, 0x0000001000000011ULL, },
+ { 0x0000001200000010ULL, 0x0000000e00000012ULL, },
+ { 0x0000000e00000010ULL, 0x000000120000000eULL, },
+ { 0x0000001200000011ULL, 0x0000000e00000010ULL, },
+ { 0x0000000e0000000fULL, 0x0000001200000010ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, }, /* 16 */
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001200000012ULL, 0x0000000f0000000eULL, },
+ { 0x0000000e0000000eULL, 0x0000001100000012ULL, },
+ { 0x000000140000000eULL, 0x0000001000000012ULL, },
+ { 0x0000000c00000012ULL, 0x000000100000000eULL, },
+ { 0x000000150000000cULL, 0x000000130000000eULL, },
+ { 0x0000000b00000014ULL, 0x0000000d00000012ULL, },
+ { 0x0000001400000010ULL, 0x0000000c00000014ULL, }, /* 24 */
+ { 0x0000000c00000010ULL, 0x000000140000000cULL, },
+ { 0x0000001300000013ULL, 0x0000000e0000000dULL, },
+ { 0x0000000d0000000dULL, 0x0000001200000013ULL, },
+ { 0x0000001200000012ULL, 0x0000001200000010ULL, },
+ { 0x0000000e0000000eULL, 0x0000000e00000010ULL, },
+ { 0x0000001100000011ULL, 0x0000001100000011ULL, },
+ { 0x0000000f0000000fULL, 0x0000000f0000000fULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, }, /* 32 */
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000001100000011ULL, 0x0000001100000011ULL, },
+ { 0x0000000f0000000fULL, 0x0000000f0000000fULL, },
+ { 0x0000001200000012ULL, 0x0000001200000012ULL, },
+ { 0x0000000e0000000eULL, 0x0000000e0000000eULL, },
+ { 0x0000001300000013ULL, 0x000000130000000eULL, },
+ { 0x0000000d0000000dULL, 0x0000000d00000012ULL, },
+ { 0x0000001400000014ULL, 0x000000100000000cULL, }, /* 40 */
+ { 0x0000000c0000000cULL, 0x0000001000000014ULL, },
+ { 0x0000001500000015ULL, 0x0000000c0000000bULL, },
+ { 0x0000000b0000000bULL, 0x0000001400000015ULL, },
+ { 0x0000001600000014ULL, 0x0000000a0000000eULL, },
+ { 0x0000000a0000000cULL, 0x0000001600000012ULL, },
+ { 0x0000001700000012ULL, 0x0000000900000013ULL, },
+ { 0x000000090000000eULL, 0x000000170000000dULL, },
+ { 0x0000001800000010ULL, 0x0000000800000018ULL, }, /* 48 */
+ { 0x0000000800000010ULL, 0x0000001800000008ULL, },
+ { 0x000000190000000eULL, 0x0000000b00000019ULL, },
+ { 0x0000000700000012ULL, 0x0000001500000007ULL, },
+ { 0x0000001a0000000cULL, 0x0000000e00000018ULL, },
+ { 0x0000000600000014ULL, 0x0000001200000008ULL, },
+ { 0x0000001b0000000aULL, 0x0000001100000014ULL, },
+ { 0x0000000500000016ULL, 0x0000000f0000000cULL, },
+ { 0x0000001c00000008ULL, 0x0000001400000010ULL, }, /* 56 */
+ { 0x0000000400000018ULL, 0x0000000c00000010ULL, },
+ { 0x0000001d00000006ULL, 0x000000170000000cULL, },
+ { 0x000000030000001aULL, 0x0000000900000014ULL, },
+ { 0x0000001e00000004ULL, 0x0000001a00000008ULL, },
+ { 0x000000020000001cULL, 0x0000000600000018ULL, },
+ { 0x0000001f00000002ULL, 0x0000001d00000004ULL, },
+ { 0x000000010000001eULL, 0x000000030000001cULL, },
+ { 0x0000000f0000000aULL, 0x0000001100000012ULL, }, /* 64 */
+ { 0x000000110000000eULL, 0x0000001200000012ULL, },
+ { 0x0000001100000010ULL, 0x000000140000000eULL, },
+ { 0x0000000f00000010ULL, 0x0000000f0000000cULL, },
+ { 0x0000001200000011ULL, 0x0000000f00000013ULL, },
+ { 0x0000001000000014ULL, 0x0000000b00000011ULL, },
+ { 0x0000000e00000010ULL, 0x0000000900000013ULL, },
+ { 0x0000001200000010ULL, 0x000000140000000eULL, },
+ { 0x0000000c00000011ULL, 0x000000130000000fULL, }, /* 72 */
+ { 0x0000001100000014ULL, 0x0000000e00000010ULL, },
+ { 0x0000001300000011ULL, 0x0000000e0000000fULL, },
+ { 0x000000110000000eULL, 0x0000001100000013ULL, },
+ { 0x0000000f0000000eULL, 0x0000000e00000010ULL, },
+ { 0x000000110000000cULL, 0x0000001100000010ULL, },
+ { 0x0000000b00000013ULL, 0x000000140000000eULL, },
+ { 0x0000001000000014ULL, 0x0000001200000010ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_PCNT_W(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_PCNT_W(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_b.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_b.c
new file mode 100644
index 0000000000..4a34f69953
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSL.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSL.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x9c71e7cc71675471ULL, 0x4767015ffe71c70cULL, }, /* 64 */
+ { 0x8c6be7cc29675571ULL, 0x4767015ffe7ba70cULL, },
+ { 0x8c6be7cc29625571ULL, 0x4b670b5efe7bb30cULL, },
+ { 0x8c6ae7cc29625541ULL, 0x4b670b5efe7bb30cULL, },
+ { 0x8caa01642982c541ULL, 0x1bf7bb1a143b33fcULL, },
+ { 0xfcbe01644d92c741ULL, 0x1bf7bb1a143f53fcULL, },
+ { 0xfcbe01644d93c741ULL, 0x12f7bb1a143f53fcULL, },
+ { 0xfcbe01604d93c709ULL, 0x12f7bb1a143f53fcULL, },
+ { 0xfc5eafa8cdd38b89ULL, 0x22d8cbfeaa2f5314ULL, }, /* 72 */
+ { 0xac5aafa8b9c38b89ULL, 0x22d8cbfeaa2b3314ULL, },
+ { 0xac5aafa8b9cf8b89ULL, 0x27d8c7ffaa2b2714ULL, },
+ { 0xac5aafa8b9cf8b81ULL, 0x27d8c7ffaa2b2714ULL, },
+ { 0x2c5a1748392fe301ULL, 0x87f187d9a84ba7a4ULL, },
+ { 0x7c4e17485d3fe201ULL, 0x87f187d9a842e7a4ULL, },
+ { 0x744e17485d31e201ULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, }, /* 80 */
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, }, /* 88 */
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x744f174c5f31e24fULL, 0x8df189d8a842e3a4ULL, },
+ { 0x8c6ae6cc28714240ULL, 0x49710958a862b30cULL, }, /* 96 */
+ { 0x8c6ae6cc28714240ULL, 0x49710958a862b30cULL, },
+ { 0x8c6ae6cc28714240ULL, 0x49710958a862b30cULL, },
+ { 0x8c6ae6cc28714240ULL, 0x49710958a862b30cULL, },
+ { 0xfcaa006428b1c240ULL, 0x09f18958282253fcULL, },
+ { 0xfcaa006428b1c240ULL, 0x09f18958282253fcULL, },
+ { 0xfcaa006428b1c240ULL, 0x09f18958282253fcULL, },
+ { 0xfcaa006428b1c240ULL, 0x09f18958282253fcULL, },
+ { 0xac4a80aca8f182c0ULL, 0x09f1c9d8a8222314ULL, }, /* 104 */
+ { 0xac4a80aca8f182c0ULL, 0x09f1c9d8a8222314ULL, },
+ { 0xac4a80aca8f182c0ULL, 0x09f1c9d8a8222314ULL, },
+ { 0xac4a80aca8f182c0ULL, 0x09f1c9d8a8222314ULL, },
+ { 0x744a004c2831e240ULL, 0x89f189d8a842e3a4ULL, },
+ { 0x744a004c2831e240ULL, 0x89f189d8a842e3a4ULL, },
+ { 0x744a004c2831e240ULL, 0x89f189d8a842e3a4ULL, },
+ { 0x744a004c2831e240ULL, 0x89f189d8a842e3a4ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_d.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_d.c
new file mode 100644
index 0000000000..0fc44fa195
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSL.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSL.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x9c71c71c71c71c71ULL, 0x4b6471c71c71c71cULL, }, /* 64 */
+ { 0x8871c71c71c71c71ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x8871c71c71c71c71ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886bc71c71c71c71ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886bc71c71c71c71ULL, 0x12f70b5efe7bb00cULL, },
+ { 0xfbebc71c71c71c71ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbebc71c71c71c71ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbfc71c71c71c71ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbfc71c71c71c71ULL, 0x27dfbb1a153f52fcULL, }, /* 72 */
+ { 0xac3fc71c71c71c71ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac3fc71c71c71c71ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5bc71c71c71c71ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x2c5bc71c71c71c71ULL, 0x8df0c6ffab2b2514ULL, },
+ { 0x705bc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x705bc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, }, /* 80 */
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, }, /* 88 */
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704fc71c71c71c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x886ae6cc28625c71ULL, 0x4b670b5ef942e2a4ULL, }, /* 96 */
+ { 0x886ae6cc28625c71ULL, 0x4b670b5ef942e2a4ULL, },
+ { 0x886ae6cc28625c71ULL, 0x4b670b5ef942e2a4ULL, },
+ { 0x886ae6cc28625c71ULL, 0x4b670b5ef942e2a4ULL, },
+ { 0xfbbe00634d93dc71ULL, 0x12f7bb1a1142e2a4ULL, },
+ { 0xfbbe00634d93dc71ULL, 0x12f7bb1a1142e2a4ULL, },
+ { 0xfbbe00634d93dc71ULL, 0x12f7bb1a1142e2a4ULL, },
+ { 0xfbbe00634d93dc71ULL, 0x12f7bb1a1142e2a4ULL, },
+ { 0xac5aaeaab9cf9c71ULL, 0x27d8c6ffa942e2a4ULL, }, /* 104 */
+ { 0xac5aaeaab9cf9c71ULL, 0x27d8c6ffa942e2a4ULL, },
+ { 0xac5aaeaab9cf9c71ULL, 0x27d8c6ffa942e2a4ULL, },
+ { 0xac5aaeaab9cf9c71ULL, 0x27d8c6ffa942e2a4ULL, },
+ { 0x704f164d5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704f164d5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704f164d5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704f164d5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_h.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_h.c
new file mode 100644
index 0000000000..cc2db04a2d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSL.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSL.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x8871e6cc31c71c71ULL, 0x4b1c0b5ffe71b00cULL, }, /* 64 */
+ { 0x886be6cc21c75571ULL, 0x4b1c0b5ffe7bb00cULL, },
+ { 0x886be6cc28625571ULL, 0x4b1c0b5efe7bb00cULL, },
+ { 0x886ae6cc28625541ULL, 0x4b1c0b5efe7bb00cULL, },
+ { 0xfbaa00644862d541ULL, 0x121cbb1a153b52fcULL, },
+ { 0xfbbe00644862c741ULL, 0x121cbb1a153f52fcULL, },
+ { 0xfbbe00644d93c741ULL, 0x129cbb1a153f52fcULL, },
+ { 0xfbbe00604d93c709ULL, 0x129cbb1a153f52fcULL, },
+ { 0xac5eaea8ad93c709ULL, 0x279cc6feab2f2514ULL, }, /* 72 */
+ { 0xac5aaea8bd938b89ULL, 0x279cc6feab2b2514ULL, },
+ { 0xac5aaea8b9cf8b89ULL, 0x279cc6ffab2b2514ULL, },
+ { 0xac5aaea8b9cf8b81ULL, 0x279cc6ffab2b2514ULL, },
+ { 0x705a164859cf8b81ULL, 0x8d9c88d9a94be2a4ULL, },
+ { 0x704e164859cfe201ULL, 0x8d9c88d9a942e2a4ULL, },
+ { 0x704e16485e31e201ULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, }, /* 80 */
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, }, /* 88 */
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x704f164c5e31e24fULL, 0x8d9c88d8a942e2a4ULL, },
+ { 0x886ae6cc1e315540ULL, 0x4b640b58e942b2a4ULL, }, /* 96 */
+ { 0x886ae6cc1e315540ULL, 0x4b640b58e942b2a4ULL, },
+ { 0x886ae6cc1e315540ULL, 0x4b640b58e942b2a4ULL, },
+ { 0x886ae6cc1e315540ULL, 0x4b640b58e942b2a4ULL, },
+ { 0xfbaa00645e31d540ULL, 0x1364bb58094252a4ULL, },
+ { 0xfbaa00645e31d540ULL, 0x1364bb58094252a4ULL, },
+ { 0xfbaa00645e31d540ULL, 0x1364bb58094252a4ULL, },
+ { 0xfbaa00645e31d540ULL, 0x1364bb58094252a4ULL, },
+ { 0xac4aa8649e31d540ULL, 0x2364c6d8a94222a4ULL, }, /* 104 */
+ { 0xac4aa8649e31d540ULL, 0x2364c6d8a94222a4ULL, },
+ { 0xac4aa8649e31d540ULL, 0x2364c6d8a94222a4ULL, },
+ { 0xac4aa8649e31d540ULL, 0x2364c6d8a94222a4ULL, },
+ { 0x704a10645e31d540ULL, 0x8b6488d8a942e2a4ULL, },
+ { 0x704a10645e31d540ULL, 0x8b6488d8a942e2a4ULL, },
+ { 0x704a10645e31d540ULL, 0x8b6488d8a942e2a4ULL, },
+ { 0x704a10645e31d540ULL, 0x8b6488d8a942e2a4ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_w.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_w.c
new file mode 100644
index 0000000000..21d6eec4db
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsl_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSL.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSL.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x8869c71c71c71c71ULL, 0x4b670b5ffe79c71cULL, }, /* 64 */
+ { 0x8869c71c28471c71ULL, 0x4b670b5ffe7bb00cULL, },
+ { 0x8869c71c28471c71ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x8869c71c28631c71ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbb9c71c28631c71ULL, 0x12f7bb1a153bb00cULL, },
+ { 0xfbb9c71c4de31c71ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbb9c71c4de31c71ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbdc71c4d931c71ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5dc71ccd931c71ULL, 0x27d8c6feab2f52fcULL, }, /* 72 */
+ { 0xac5dc71cb9931c71ULL, 0x27d8c6feab2b2514ULL, },
+ { 0xac5dc71cb9931c71ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac59c71cb9cf1c71ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x7049c71c39cf1c71ULL, 0x8df188d9a9432514ULL, },
+ { 0x7049c71c5e4f1c71ULL, 0x8df188d9a942e2a4ULL, },
+ { 0x7049c71c5e4f1c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, }, /* 80 */
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, }, /* 88 */
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704dc71c5e311c71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x886ae6cc28625c71ULL, 0x4b670b58f942e2a4ULL, }, /* 96 */
+ { 0x886ae6cc28625c71ULL, 0x4b670b58f942e2a4ULL, },
+ { 0x886ae6cc28625c71ULL, 0x4b670b58f942e2a4ULL, },
+ { 0x886ae6cc28625c71ULL, 0x4b670b58f942e2a4ULL, },
+ { 0xfbbae6cc4d93dc71ULL, 0x12f7bb581142e2a4ULL, },
+ { 0xfbbae6cc4d93dc71ULL, 0x12f7bb581142e2a4ULL, },
+ { 0xfbbae6cc4d93dc71ULL, 0x12f7bb581142e2a4ULL, },
+ { 0xfbbae6cc4d93dc71ULL, 0x12f7bb581142e2a4ULL, },
+ { 0xac5ae6ccb9cf9c71ULL, 0x27d8c6d8a942e2a4ULL, }, /* 104 */
+ { 0xac5ae6ccb9cf9c71ULL, 0x27d8c6d8a942e2a4ULL, },
+ { 0xac5ae6ccb9cf9c71ULL, 0x27d8c6d8a942e2a4ULL, },
+ { 0xac5ae6ccb9cf9c71ULL, 0x27d8c6d8a942e2a4ULL, },
+ { 0x704ae6cc5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704ae6cc5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704ae6cc5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ { 0x704ae6cc5e31dc71ULL, 0x8df188d8a942e2a4ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSL_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_b.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_b.c
new file mode 100644
index 0000000000..b1927c5c34
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSR.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSR.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c72e60c70c21570ULL, 0xcb677bde7e7bc60cULL, }, /* 64 */
+ { 0x186ae60c68c25570ULL, 0xcb677bde7e7bc00cULL, },
+ { 0x086ae60c68625570ULL, 0x4b670b5e7e7bf00cULL, },
+ { 0x086ae60c28625540ULL, 0x4b670b5e7e7bf00cULL, },
+ { 0x096e800329634740ULL, 0x42f70b1a157ff01cULL, },
+ { 0x0b3e80030d63c740ULL, 0x42f70b1a153ff21cULL, },
+ { 0x1b3e80030d93c740ULL, 0x12f73b1a153fd21cULL, },
+ { 0x1bbe80234d93c708ULL, 0x12f73b1a153fd21cULL, },
+ { 0x1abaae2a4d97cb08ULL, 0x17d8367f2b3bd314ULL, }, /* 72 */
+ { 0x1cdaae2a799f8b08ULL, 0x17d8367f2b2bd514ULL, },
+ { 0x0cdaae2a79cf8b08ULL, 0x27d846ff2b2be514ULL, },
+ { 0x0c5aae2a39cf8b00ULL, 0x27d846ff2b2be514ULL, },
+ { 0x0c5f962d38c9a200ULL, 0x2df148d82922e400ULL, },
+ { 0x004f962d1ec1e200ULL, 0x2df148d82942e200ULL, },
+ { 0x104f962d1e31e200ULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, }, /* 80 */
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, }, /* 88 */
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x104f960d5e31e24eULL, 0x8df108d82942e200ULL, },
+ { 0x106ae60c2832e540ULL, 0x8bf309d82a43e000ULL, }, /* 96 */
+ { 0x106ae60c2832d540ULL, 0x8bf70bd82e4be000ULL, },
+ { 0x106ae60c2832d540ULL, 0x8b670bd87e4be000ULL, },
+ { 0x106ae60c2832d540ULL, 0x8b670bd87e4be000ULL, },
+ { 0x116e80032933c740ULL, 0x82f70bd8154fe000ULL, },
+ { 0x133e80032933c740ULL, 0x82f70bd8153fe000ULL, },
+ { 0x1b3e80032933c740ULL, 0x82f70bd8153fe000ULL, },
+ { 0x1b3e80032933c740ULL, 0x82f70bd8153fe000ULL, },
+ { 0x1c5a800a293f8b40ULL, 0x87d806d92b2be100ULL, }, /* 104 */
+ { 0x0c5a800a29cf8b40ULL, 0x27d846db2b2be100ULL, },
+ { 0x0c5a800a29cf8b40ULL, 0x27d846df2b2be100ULL, },
+ { 0x0c5a800a29cf8b40ULL, 0x27d846ff2b2be100ULL, },
+ { 0x105f800d2a318240ULL, 0x8dd908d82922e200ULL, },
+ { 0x104f800d2e318240ULL, 0x8dd908d82922e200ULL, },
+ { 0x104f800d5e318240ULL, 0x8dd908d82922e200ULL, },
+ { 0x104f800d5e318240ULL, 0x8dd908d82922e200ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_d.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_d.c
new file mode 100644
index 0000000000..6499415daa
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSR.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSR.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71d00cULL, }, /* 64 */
+ { 0x1c71c71c71c71d40ULL, 0xcb670b5efe7bb00cULL, },
+ { 0x1c71c71c71c71d40ULL, 0xcb670b5efe7bb00cULL, },
+ { 0x1c71c71c71c75540ULL, 0xcb670b5efe7bb00cULL, },
+ { 0x1c71c71c71c75540ULL, 0xcb670b5efe7bb2fcULL, },
+ { 0x1c71c71c71c75508ULL, 0xd2f7bb1a153f52fcULL, },
+ { 0x1c71c71c71c75508ULL, 0xd2f7bb1a153f52fcULL, },
+ { 0x1c71c71c71c74708ULL, 0xd2f7bb1a153f52fcULL, },
+ { 0x1c71c71c71c74708ULL, 0xd2f7bb1a153f4514ULL, }, /* 72 */
+ { 0x1c71c71c71c74780ULL, 0xc7d8c6ffab2b2514ULL, },
+ { 0x1c71c71c71c74780ULL, 0xc7d8c6ffab2b2514ULL, },
+ { 0x1c71c71c71c70b80ULL, 0xc7d8c6ffab2b2514ULL, },
+ { 0x1c71c71c71c70b80ULL, 0xc7d8c6ffab2b22a0ULL, },
+ { 0x1c71c71c71c70a4eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c70a4eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, }, /* 80 */
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, }, /* 88 */
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c7624eULL, 0xcdf188d8a942e2a0ULL, },
+ { 0x1c71c71c71c75540ULL, 0xcdf188d8fe7bb00cULL, }, /* 96 */
+ { 0x1c71c71c71c75540ULL, 0xcdf188d8fe7bb00cULL, },
+ { 0x1c71c71c71c75540ULL, 0xcdf188d8fe7bb00cULL, },
+ { 0x1c71c71c71c75540ULL, 0xcdf188d8fe7bb00cULL, },
+ { 0x1c71c71c71c75540ULL, 0xcdf188d8fe7bb2fcULL, },
+ { 0x1c71c71c71c75540ULL, 0xd2f7bb1a153f52fcULL, },
+ { 0x1c71c71c71c75540ULL, 0xd2f7bb1a153f52fcULL, },
+ { 0x1c71c71c71c75540ULL, 0xd2f7bb1a153f52fcULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6ffab2b2514ULL, }, /* 104 */
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6ffab2b2514ULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6ffab2b2514ULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6ffab2b2514ULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6ffab22e2a0ULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6fea942e2a0ULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6fea942e2a0ULL, },
+ { 0x1c71c71c71c75540ULL, 0xc7d8c6fea942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_h.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_h.c
new file mode 100644
index 0000000000..2dc3dbe89b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSR.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSR.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x186ac6cc71c21c70ULL, 0xc7670b5e1e7bd00cULL, }, /* 64 */
+ { 0x086ac6cc71c21d40ULL, 0xc7670b5efe7bd00cULL, },
+ { 0x086ac6cc28621d40ULL, 0xc7670b5efe7bd00cULL, },
+ { 0x886ae6cc28625540ULL, 0xc7670b5efe7bd00cULL, },
+ { 0x8bbee06328635540ULL, 0xc7f73b1af53fd2fcULL, },
+ { 0xfbbee06328635508ULL, 0xc7f73b1a153fd2fcULL, },
+ { 0xfbbee0634d935508ULL, 0xc6f7bb1a153fd2fcULL, },
+ { 0xfbbec0634d934708ULL, 0xc6f7bb1a153fd2fcULL, },
+ { 0xfc5aceaa4d974708ULL, 0xc6d8c6ff1b2bc514ULL, }, /* 72 */
+ { 0xac5aceaa4d9f4780ULL, 0xc6d8c6ffab2bc514ULL, },
+ { 0xac5aceaab9cf4780ULL, 0xc7d8c6ffab2bc514ULL, },
+ { 0xac5aeeaab9cf0b80ULL, 0xc7d8c6ffab2bc514ULL, },
+ { 0xa84ff64db9c90b80ULL, 0xc7f188d8a942c2a0ULL, },
+ { 0xf04ff64db9c10a4eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0xf04ff64d5e310a4eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, }, /* 80 */
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, }, /* 88 */
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e31624eULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x886ae6cc5e325540ULL, 0xc7f3895ea943c2a0ULL, }, /* 96 */
+ { 0x886ae6cc5e325540ULL, 0xc7f78b5ea94bc2a0ULL, },
+ { 0x886ae6cc5e325540ULL, 0xc7678b5eae7bc2a0ULL, },
+ { 0x886ae6cc5e325540ULL, 0xc7678b5eae7bc2a0ULL, },
+ { 0x8bbee0635e335540ULL, 0xc7f7bb1aa53fc2a0ULL, },
+ { 0xfbbee0635e335540ULL, 0xc7f7bb1a153fc2a0ULL, },
+ { 0xfbbee0635e335540ULL, 0xc7f7bb1a153fc2a0ULL, },
+ { 0xfbbee0635e335540ULL, 0xc7f7bb1a153fc2a0ULL, },
+ { 0xac5ae06a5e3f5540ULL, 0xc7d8beffab2bc2a0ULL, }, /* 104 */
+ { 0xac5ae6aab9cf5540ULL, 0xc7d8c6ffab2bc2a0ULL, },
+ { 0xac5ae6aab9cf5540ULL, 0xc7d8c6ffab2bc2a0ULL, },
+ { 0xac5ae6aab9cf5540ULL, 0xc7d8c6ffab2bc2a0ULL, },
+ { 0xa84fe64d5e315540ULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e315540ULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e315540ULL, 0xc7f188d8a942c2a0ULL, },
+ { 0x704fd64d5e315540ULL, 0xc7f188d8a942c2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_w.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_w.c
new file mode 100644
index 0000000000..5073187340
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_binsr_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BINSR.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BINSR.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c6cc71c71c70ULL, 0xcb670b5e1c71d00cULL, }, /* 64 */
+ { 0x1c71c6cc71c71d40ULL, 0xcb670b5e1e7bb00cULL, },
+ { 0x1c71c6cc71c71d40ULL, 0x4b670b5e1e7bb00cULL, },
+ { 0x1c71e6cc71c75540ULL, 0x4b670b5e1e7bb00cULL, },
+ { 0x1c71e06371c75540ULL, 0x12f7bb1a1e7bb2fcULL, },
+ { 0x1c71e06371c75508ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x1c71e06371c75508ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x1c71c06371c74708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x1c71ceaa71c74708ULL, 0x27d8c6ff153f4514ULL, }, /* 72 */
+ { 0x1c71ceaa71c74780ULL, 0x27d8c6ff0b2b2514ULL, },
+ { 0x1c71ceaa71c74780ULL, 0x27d8c6ff0b2b2514ULL, },
+ { 0x1c71eeaa71c70b80ULL, 0x27d8c6ff0b2b2514ULL, },
+ { 0x1c71f64d71c70b80ULL, 0x0df188d80b2b22a0ULL, },
+ { 0x1c71f64d71c70a4eULL, 0x0df188d80942e2a0ULL, },
+ { 0x1c71f64d71c70a4eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, }, /* 80 */
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, }, /* 88 */
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c7624eULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71e6cc71c75540ULL, 0x8d670b5e0942e2a0ULL, }, /* 96 */
+ { 0x1c71e6cc71c75540ULL, 0xcb670b5e0942e2a0ULL, },
+ { 0x1c71e6cc71c75540ULL, 0xcb670b5e0942e2a0ULL, },
+ { 0x1c71e6cc71c75540ULL, 0xcb670b5e0942e2a0ULL, },
+ { 0x1c71e06371c75540ULL, 0x92f7bb1a0942e2a0ULL, },
+ { 0x1c71e06371c75540ULL, 0x92f7bb1a0942e2a0ULL, },
+ { 0x1c71e06371c75540ULL, 0x92f7bb1a0942e2a0ULL, },
+ { 0x1c71e06371c75540ULL, 0x92f7bb1a0942e2a0ULL, },
+ { 0x1c71e06a71c75540ULL, 0x97d8c6ff0942e2a0ULL, }, /* 104 */
+ { 0x1c71e6aa71c75540ULL, 0x27d8c6ff0942e2a0ULL, },
+ { 0x1c71e6aa71c75540ULL, 0x27d8c6ff0942e2a0ULL, },
+ { 0x1c71e6aa71c75540ULL, 0x27d8c6ff0942e2a0ULL, },
+ { 0x1c71e64d71c75540ULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c75540ULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c75540ULL, 0x8df188d80942e2a0ULL, },
+ { 0x1c71d64d71c75540ULL, 0x8df188d80942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BINSR_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmnz_v.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmnz_v.c
new file mode 100644
index 0000000000..ba1c635087
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmnz_v.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BMNZ.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BMNZ.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x9c7be7dc79e75d71ULL, 0xcf7f7bdffe7bf71cULL, }, /* 64 */
+ { 0x8c6be7dc38665d71ULL, 0xcf6f4bdffe7bb50cULL, },
+ { 0x886be7dc28625571ULL, 0xcb670b5efe7bb00cULL, },
+ { 0x886ae7dc28625571ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x882a015008024531ULL, 0x02670b1a143b100cULL, },
+ { 0xfbbe01734d93c739ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe01734d93c739ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe01734d93c739ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbdea7bb6dd38339ULL, 0x13d0b25eab2f62f4ULL, }, /* 72 */
+ { 0xa85aa7ba29c38331ULL, 0x03d0825eab2b2014ULL, },
+ { 0xac5aafbab9cf8bb1ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aafbab9cf8bb1ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x245a0f7e99adcaf1ULL, 0x2df9ccf9a942a510ULL, },
+ { 0x744e0f5ddc3dcaf9ULL, 0x2df9ccf9a942e7a0ULL, },
+ { 0x704e075d5c31c279ULL, 0x0df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, }, /* 80 */
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, }, /* 88 */
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f175d5e31e27fULL, 0x8df188d8a942e2a0ULL, },
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, }, /* 96 */
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+ { 0x000a004008004000ULL, 0x0061081800020000ULL, },
+ { 0x000a004008004000ULL, 0x0061081800020000ULL, },
+ { 0x000a004008004000ULL, 0x0061081800020000ULL, },
+ { 0x000a004008004000ULL, 0x0061081800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, }, /* 104 */
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMNZ_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMNZ_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMNZ_V__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMNZ_V__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmz_v.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmz_v.c
new file mode 100644
index 0000000000..b38ddc2c12
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bmz_v.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BMZ.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BMZ.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0860c60c20421440ULL, 0x430401461c71800cULL, }, /* 64 */
+ { 0x0860e68c20621440ULL, 0x4b040146fe71a00cULL, },
+ { 0x0860e6cc20625440ULL, 0x4b270946fe71b00cULL, },
+ { 0x8860e6cc20625540ULL, 0x4b270b46fe79b00cULL, },
+ { 0xfbf4e6ef65f3d748ULL, 0x5bb7bb46ff7df2fcULL, },
+ { 0xfbb400634593c708ULL, 0x12b7bb02153d52fcULL, },
+ { 0xfbb400634593c708ULL, 0x12b7bb02153d52fcULL, },
+ { 0xfbb400634593c708ULL, 0x12b7bb02153d52fcULL, },
+ { 0xac300862918fcf80ULL, 0x26bfcfa31539151cULL, }, /* 72 */
+ { 0xac70aeeab1cfcf80ULL, 0x27bfcfe7bf39351cULL, },
+ { 0xac50aeaab1cf8b80ULL, 0x2798c6e7ab292514ULL, },
+ { 0xac50aeaab1cf8b80ULL, 0x2798c6e7ab292514ULL, },
+ { 0xf845b6897653a30eULL, 0x879082c6ab2962a4ULL, },
+ { 0xf845160d5633a34eULL, 0x8f9082c2a969e2a4ULL, },
+ { 0xf845164d5633e34eULL, 0x8fb18ac2a969e2a4ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, }, /* 80 */
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, }, /* 88 */
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0x7045164d5631e24eULL, 0x8db188c0a940e2a0ULL, },
+ { 0xf86ff6cd7e73f74eULL, 0xcff78bdeff7bf2acULL, }, /* 96 */
+ { 0xf86ff6cd7e73f74eULL, 0xcff78bdeff7bf2acULL, },
+ { 0xf86ff6cd7e73f74eULL, 0xcff78bdeff7bf2acULL, },
+ { 0xf86ff6cd7e73f74eULL, 0xcff78bdeff7bf2acULL, },
+ { 0xfbfff6ef7ff3f74eULL, 0xdff7bbdeff7ff2fcULL, },
+ { 0xfbfff6ef7ff3f74eULL, 0xdff7bbdeff7ff2fcULL, },
+ { 0xfbfff6ef7ff3f74eULL, 0xdff7bbdeff7ff2fcULL, },
+ { 0xfbfff6ef7ff3f74eULL, 0xdff7bbdeff7ff2fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, }, /* 104 */
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMZ_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMZ_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMZ_V__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BMZ_V__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bsel_v.c b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bsel_v.c
new file mode 100644
index 0000000000..062e5a2fa0
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-move/test_msa_bsel_v.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction BSEL.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Move";
+ char *instruction_name = "BSEL.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xefcefcefcefcefceULL, 0xfcefcefcefcefcefULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xaa8aa8aa8aa8aa8aULL, 0xa8aa8aa8aa8aa8aaULL, },
+ { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+ { 0x5d75d75d75d75d75ULL, 0xd75d75d75d75d75dULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4544544544544544ULL, 0x5445445445445445ULL, },
+ { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+ { 0xdcddcddcddcddcddULL, 0xcddcddcddcddcddcULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+ { 0x3f73f73f73f73f73ULL, 0xf73f73f73f73f73fULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+ { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+ { 0xf3bf3bf3bf3bf3bfULL, 0x3bf3bf3bf3bf3bf3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+ { 0xe28e28e28e28e28eULL, 0x28e28e28e28e28e2ULL, },
+ { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+ { 0x0c60c60c60c60c60ULL, 0xc60c60c60c60c60cULL, },
+ { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+ { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x882a004008024500ULL, 0x02670b1a143b100cULL, },
+ { 0x884ae68c28621140ULL, 0x4b40025eea6ba004ULL, },
+ { 0x006a064c08204440ULL, 0x09670958bc52b008ULL, },
+ { 0xfbfe066f4db3c748ULL, 0x1bf7bb5abd7ff2fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xa81a002209838300ULL, 0x02d0821a012b0014ULL, },
+ { 0x73ae00414c11c608ULL, 0x10f7b918151652e8ULL, },
+ { 0x8c7aaeeab9ce4d80ULL, 0x276f4fffbe3b351cULL, }, /* 72 */
+ { 0xa83a00620983c700ULL, 0x02f78b1a153b101cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x204a060818018200ULL, 0x05d080d8a9022000ULL, },
+ { 0x504f164d4e30604eULL, 0x89610858a842e2a0ULL, },
+ { 0x700e00415c11c208ULL, 0x04f18898010242a0ULL, },
+ { 0x204b160c1a21a246ULL, 0x8dd080d8a942a000ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, }, /* 80 */
+ { 0x000a004008004000ULL, 0x0061081800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, }, /* 88 */
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x000a000008000000ULL, 0x0040001800020000ULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 96 */
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbfee6ef6df3d748ULL, 0x5bf7bb5eff7ff2fcULL, },
+ { 0xfbfee6ef6df3d748ULL, 0x5bf7bb5eff7ff2fcULL, },
+ { 0xfbfee6ef6df3d748ULL, 0x5bf7bb5eff7ff2fcULL, },
+ { 0xfbfee6ef6df3d748ULL, 0x5bf7bb5eff7ff2fcULL, },
+ { 0xfffeeeeffdffdfc8ULL, 0x7fffffffff7ff7fcULL, }, /* 104 */
+ { 0xfffeeeeffdffdfc8ULL, 0x7fffffffff7ff7fcULL, },
+ { 0xfffeeeeffdffdfc8ULL, 0x7fffffffff7ff7fcULL, },
+ { 0xfffeeeeffdffdfc8ULL, 0x7fffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ { 0xfffffeefffffffceULL, 0xffffffffff7ff7fcULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSEL_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSEL_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSEL_V__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSEL_V__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_b.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_b.c
new file mode 100644
index 0000000000..56fdee3f31
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BCLR.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BCLR.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, /* 0 */
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, },
+ { 0xfbfbfbfbfbfbfbfbULL, 0xfbfbfbfbfbfbfbfbULL, },
+ { 0xdfdfdfdfdfdfdfdfULL, 0xdfdfdfdfdfdfdfdfULL, },
+ { 0xefefefefefefefefULL, 0xefefefefefefefefULL, },
+ { 0xf7f7f7f7f7f7f7f7ULL, 0xf7f7f7f7f7f7f7f7ULL, },
+ { 0xf7bffef7bffef7bfULL, 0xfef7bffef7bffef7ULL, },
+ { 0xeffd7feffd7feffdULL, 0x7feffd7feffd7fefULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8a8a8a8a8a8a8a8aULL, 0x8a8a8a8a8a8a8a8aULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xa2a2a2a2a2a2a2a2ULL, 0xa2a2a2a2a2a2a2a2ULL, },
+ { 0xa2aaaaa2aaaaa2aaULL, 0xaaa2aaaaa2aaaaa2ULL, },
+ { 0xaaa82aaaa82aaaa8ULL, 0x2aaaa82aaaa82aaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, },
+ { 0x5151515151515151ULL, 0x5151515151515151ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x4545454545454545ULL, 0x4545454545454545ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5515545515545515ULL, 0x5455155455155455ULL, },
+ { 0x4555554555554555ULL, 0x5545555545555545ULL, },
+ { 0x4c4c4c4c4c4c4c4cULL, 0x4c4c4c4c4c4c4c4cULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xc8c8c8c8c8c8c8c8ULL, 0xc8c8c8c8c8c8c8c8ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xc4c4c4c4c4c4c4c4ULL, 0xc4c4c4c4c4c4c4c4ULL, },
+ { 0xc48cccc48cccc48cULL, 0xccc48cccc48cccc4ULL, },
+ { 0xcccc4ccccc4cccccULL, 0x4ccccc4ccccc4cccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3232323232323232ULL, 0x3232323232323232ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1313131313131313ULL, 0x1313131313131313ULL, },
+ { 0x2323232323232323ULL, 0x2323232323232323ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333323333323333ULL, 0x3233333233333233ULL, },
+ { 0x2331332331332331ULL, 0x3323313323313323ULL, },
+ { 0x630e38630e38630eULL, 0x38630e38630e3863ULL, }, /* 48 */
+ { 0xe28e38e28e38e28eULL, 0x38e28e38e28e38e2ULL, },
+ { 0xe38a38e38a38e38aULL, 0x38e38a38e38a38e3ULL, },
+ { 0xc38e18c38e18c38eULL, 0x18c38e18c38e18c3ULL, },
+ { 0xe38e28e38e28e38eULL, 0x28e38e28e38e28e3ULL, },
+ { 0xe38630e38630e386ULL, 0x30e38630e38630e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38c38e38c38e38cULL, 0x38e38c38e38c38e3ULL, },
+ { 0x1c71471c71471c71ULL, 0x471c71471c71471cULL, }, /* 56 */
+ { 0x1c70c61c70c61c70ULL, 0xc61c70c61c70c61cULL, },
+ { 0x1871c31871c31871ULL, 0xc31871c31871c318ULL, },
+ { 0x1c51c71c51c71c51ULL, 0xc71c51c71c51c71cULL, },
+ { 0x0c61c70c61c70c61ULL, 0xc70c61c70c61c70cULL, },
+ { 0x1471c71471c71471ULL, 0xc71471c71471c714ULL, },
+ { 0x1431c61431c61431ULL, 0xc61431c61431c614ULL, },
+ { 0x0c71470c71470c71ULL, 0x470c71470c71470cULL, },
+ { 0x886aa6cc28625540ULL, 0x4367031ebe73b00cULL, }, /* 64 */
+ { 0x802ae6c408625540ULL, 0x4b67035ade7bb00cULL, },
+ { 0x886aa6c828625540ULL, 0x4b660b5ef673900cULL, },
+ { 0x886aa6cc28605100ULL, 0x4b650a5efc7bb00cULL, },
+ { 0xfaba00634c93c708ULL, 0x1277b31a153752ecULL, },
+ { 0xf3be00634d934708ULL, 0x1277b31a153f52ecULL, },
+ { 0xebba00634d13c708ULL, 0x12f6bb1a153752ecULL, },
+ { 0xfa3e00430d91c308ULL, 0x12f5ba1a153b52fcULL, },
+ { 0xac5aaeaab8cb8b80ULL, 0x2758c6bfab232404ULL, }, /* 72 */
+ { 0xa41aaea299c70b80ULL, 0x2358c6fb8b2b2104ULL, },
+ { 0xac5aaeaab94f8380ULL, 0x27d8867fa3230504ULL, },
+ { 0xac5aae8ab9cd8b80ULL, 0x07d8c6fea92b2114ULL, },
+ { 0x704b164d5e31c24eULL, 0x85718098a942e2a0ULL, },
+ { 0x700f16455e31624eULL, 0x897180d88942e2a0ULL, },
+ { 0x604b16495c31e24eULL, 0x0df08858a142c2a0ULL, },
+ { 0x704f164d1e31e20eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_d.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_d.c
new file mode 100644
index 0000000000..0accccf093
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BCLR.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BCLR.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, /* 0 */
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, },
+ { 0xfffffbffffffffffULL, 0xfffffbffffffffffULL, },
+ { 0xffffffffffdfffffULL, 0xffffffffffdfffffULL, },
+ { 0xffffffffffffefffULL, 0xffffffffffffefffULL, },
+ { 0xfff7ffffffffffffULL, 0xfff7ffffffffffffULL, },
+ { 0xffffffffffffbfffULL, 0xfffffff7ffffffffULL, },
+ { 0xfffdffffffffffffULL, 0xffffffffefffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaa8aaaaaULL, 0xaaaaaaaaaa8aaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaa2aaaaaaaaaaaaULL, 0xaaa2aaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaa2aaaaaaaaULL, },
+ { 0xaaa8aaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, },
+ { 0x5555515555555555ULL, 0x5555515555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555554555ULL, 0x5555555555554555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555551555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555545555555ULL, },
+ { 0x4cccccccccccccccULL, 0x4cccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccc8ccccccccccULL, 0xccccc8ccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccc4ccccccccccccULL, 0xccc4ccccccccccccULL, },
+ { 0xcccccccccccc8cccULL, 0xccccccc4ccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333332ULL, 0x3333333333333332ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333133333ULL, 0x3333333333133333ULL, },
+ { 0x3333333333332333ULL, 0x3333333333332333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3331333333333333ULL, 0x3333333323333333ULL, },
+ { 0x638e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e2ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38a38e38e38e3ULL, },
+ { 0xe38e38e38e18e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e28e3ULL, },
+ { 0xe38638e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38a38eULL, 0x38e38e30e38e38e3ULL, },
+ { 0xe38c38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c31c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c51c71cULL, },
+ { 0x1c71c71c71c70c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71471c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c70c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7ba00cULL, }, /* 64 */
+ { 0x886ae6cc28625440ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe6bb00cULL, },
+ { 0x886ae6cc28621540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f42fcULL, },
+ { 0xfbbe00634d93c608ULL, 0x02f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a152f52fcULL, },
+ { 0xfbbe00634d938708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8a80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6feab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31a24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_h.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_h.c
new file mode 100644
index 0000000000..474e5297b8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BCLR.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BCLR.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, /* 0 */
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xfbfffbfffbfffbffULL, 0xfbfffbfffbfffbffULL, },
+ { 0xffdfffdfffdfffdfULL, 0xffdfffdfffdfffdfULL, },
+ { 0xefffefffefffefffULL, 0xefffefffefffefffULL, },
+ { 0xfff7fff7fff7fff7ULL, 0xfff7fff7fff7fff7ULL, },
+ { 0xbffffff7feffbfffULL, 0xfff7feffbffffff7ULL, },
+ { 0xfffdefffff7ffffdULL, 0xefffff7ffffdefffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa8aaa8aaa8aaa8aULL, 0xaa8aaa8aaa8aaa8aULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaa2aaa2aaa2aaa2ULL, 0xaaa2aaa2aaa2aaa2ULL, },
+ { 0xaaaaaaa2aaaaaaaaULL, 0xaaa2aaaaaaaaaaa2ULL, },
+ { 0xaaa8aaaaaa2aaaa8ULL, 0xaaaaaa2aaaa8aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, },
+ { 0x5155515551555155ULL, 0x5155515551555155ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x4555455545554555ULL, 0x4555455545554555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1555555554551555ULL, 0x5555545515555555ULL, },
+ { 0x5555455555555555ULL, 0x4555555555554555ULL, },
+ { 0x4ccc4ccc4ccc4cccULL, 0x4ccc4ccc4ccc4cccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xc8ccc8ccc8ccc8ccULL, 0xc8ccc8ccc8ccc8ccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccc4ccc4ccc4ccc4ULL, 0xccc4ccc4ccc4ccc4ULL, },
+ { 0x8cccccc4cccc8cccULL, 0xccc4cccc8cccccc4ULL, },
+ { 0xcccccccccc4cccccULL, 0xcccccc4cccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3332333233323332ULL, 0x3332333233323332ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3313331333133313ULL, 0x3313331333133313ULL, },
+ { 0x2333233323332333ULL, 0x2333233323332333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333332333333ULL, 0x3333323333333333ULL, },
+ { 0x3331233333333331ULL, 0x2333333333312333ULL, },
+ { 0x638e38e30e38638eULL, 0x38e30e38638e38e3ULL, }, /* 48 */
+ { 0xe38e38e28e38e38eULL, 0x38e28e38e38e38e2ULL, },
+ { 0xe38e38e38a38e38eULL, 0x38e38a38e38e38e3ULL, },
+ { 0xe38e38c38e18e38eULL, 0x38c38e18e38e38c3ULL, },
+ { 0xe38e28e38e38e38eULL, 0x28e38e38e38e28e3ULL, },
+ { 0xe38638e38e30e386ULL, 0x38e38e30e38638e3ULL, },
+ { 0xa38e38e38e38a38eULL, 0x38e38e38a38e38e3ULL, },
+ { 0xe38c28e38e38e38cULL, 0x28e38e38e38c28e3ULL, },
+ { 0x1c71471c71c71c71ULL, 0x471c71c71c71471cULL, }, /* 56 */
+ { 0x1c70c71c71c61c70ULL, 0xc71c71c61c70c71cULL, },
+ { 0x1871c31c71c71871ULL, 0xc31c71c71871c31cULL, },
+ { 0x1c51c71c71c71c51ULL, 0xc71c71c71c51c71cULL, },
+ { 0x0c71c71c61c70c71ULL, 0xc71c61c70c71c71cULL, },
+ { 0x1c71c71471c71c71ULL, 0xc71471c71c71c714ULL, },
+ { 0x1c71c71470c71c71ULL, 0xc71470c71c71c714ULL, },
+ { 0x1c71c71c71471c71ULL, 0xc71c71471c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5ef67ba00cULL, }, /* 64 */
+ { 0x886ae6c428625440ULL, 0x4b670b5e7e7ba00cULL, },
+ { 0x886ae2cc28625540ULL, 0x4a670b5ef67bb00cULL, },
+ { 0x086ac6cc28601540ULL, 0x4b650a5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x1277bb1a153f42fcULL, },
+ { 0xbbbe00634d93c608ULL, 0x1277bb1a153f42fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f73b1a153f52ecULL, },
+ { 0x7bbe00634d918708ULL, 0x12f5ba1a153b52fcULL, },
+ { 0xa85aaeaab9cb8b80ULL, 0x275886ffa32b2514ULL, }, /* 72 */
+ { 0xac5aaea2b9c78a80ULL, 0x2758c2ff2b2b2514ULL, },
+ { 0xa85aaaaa39cf8b80ULL, 0x26d846ffa32b2504ULL, },
+ { 0x2c5a8eaab9cd8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f064d5e31e24eULL, 0x8d7188d8a142e2a0ULL, },
+ { 0x304f16455e31e24eULL, 0x8d7188d82942e2a0ULL, },
+ { 0x704f124d5e31e24eULL, 0x8cf108d8a142e2a0ULL, },
+ { 0x704f164d5e31a24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_w.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_w.c
new file mode 100644
index 0000000000..818b12ff0a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bclr_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BCLR.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BCLR.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, /* 0 */
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xfffffbfffffffbffULL, 0xfffffbfffffffbffULL, },
+ { 0xffdfffffffdfffffULL, 0xffdfffffffdfffffULL, },
+ { 0xffffefffffffefffULL, 0xffffefffffffefffULL, },
+ { 0xfff7fffffff7ffffULL, 0xfff7fffffff7ffffULL, },
+ { 0xfffffff7ffffbfffULL, 0xfefffffffffffff7ULL, },
+ { 0xeffffffffffdffffULL, 0xffffff7fefffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa8aaaaaaa8aaaaaULL, 0xaa8aaaaaaa8aaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaa2aaaaaaa2aaaaULL, 0xaaa2aaaaaaa2aaaaULL, },
+ { 0xaaaaaaa2aaaaaaaaULL, 0xaaaaaaaaaaaaaaa2ULL, },
+ { 0xaaaaaaaaaaa8aaaaULL, 0xaaaaaa2aaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, },
+ { 0x5555515555555155ULL, 0x5555515555555155ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555455555554555ULL, 0x5555455555554555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555551555ULL, 0x5455555555555555ULL, },
+ { 0x4555555555555555ULL, 0x5555555545555555ULL, },
+ { 0x4ccccccc4cccccccULL, 0x4ccccccc4cccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccc8ccccccc8ccULL, 0xccccc8ccccccc8ccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccc4ccccccc4ccccULL, 0xccc4ccccccc4ccccULL, },
+ { 0xccccccc4cccc8cccULL, 0xccccccccccccccc4ULL, },
+ { 0xccccccccccccccccULL, 0xcccccc4cccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333233333332ULL, 0x3333333233333332ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3313333333133333ULL, 0x3313333333133333ULL, },
+ { 0x3333233333332333ULL, 0x3333233333332333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3233333333333333ULL, },
+ { 0x2333333333313333ULL, 0x3333333323333333ULL, },
+ { 0x638e38e30e38e38eULL, 0x38e38e38638e38e3ULL, }, /* 48 */
+ { 0xe38e38e28e38e38eULL, 0x38e38e38e38e38e2ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38a38e38e38e3ULL, },
+ { 0xe38e38e38e18e38eULL, 0x38c38e38e38e38e3ULL, },
+ { 0xe38e28e38e38e38eULL, 0x38e38e38e38e28e3ULL, },
+ { 0xe38638e38e30e38eULL, 0x38e38e38e38638e3ULL, },
+ { 0xe38e38e38e38a38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c61c71c71cULL, },
+ { 0x1c71c31c71c71871ULL, 0xc71c71c71c71c31cULL, },
+ { 0x1c51c71c71c71c71ULL, 0xc71c71c71c51c71cULL, },
+ { 0x1c71c71c71c70c71ULL, 0xc71c61c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71471c71c71c71cULL, },
+ { 0x1c71c71471c71c71ULL, 0xc61c71c71c71c714ULL, },
+ { 0x0c71c71c71c51c71ULL, 0xc71c71470c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x0b670b5efe7ba00cULL, }, /* 64 */
+ { 0x886ae6c428625440ULL, 0x4b670b5eee7bb00cULL, },
+ { 0x886ae2cc28625540ULL, 0x4b670b5efe6bb00cULL, },
+ { 0x886ac6cc28621540ULL, 0x4a670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f42fcULL, },
+ { 0xfbbe00634d93c608ULL, 0x12f7bb1a053f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a152f52fcULL, },
+ { 0xfbbe00634d938708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaea2b9cf8a80ULL, 0x23d8c6ffab2b2514ULL, },
+ { 0xac5aaaaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5a8eaab9cf8b80ULL, 0x26d8c6ffab2b2514ULL, },
+ { 0x704f064d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f16455e31e24eULL, 0x89f188d8a942e2a0ULL, },
+ { 0x704f124d5e31e24eULL, 0x0df188d8a942e2a0ULL, },
+ { 0x704f164d5e31a24eULL, 0x8cf188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BCLR_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_b.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_b.c
new file mode 100644
index 0000000000..78ba32f360
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BNEG.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BNEG.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, /* 0 */
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, },
+ { 0xfbfbfbfbfbfbfbfbULL, 0xfbfbfbfbfbfbfbfbULL, },
+ { 0xdfdfdfdfdfdfdfdfULL, 0xdfdfdfdfdfdfdfdfULL, },
+ { 0xefefefefefefefefULL, 0xefefefefefefefefULL, },
+ { 0xf7f7f7f7f7f7f7f7ULL, 0xf7f7f7f7f7f7f7f7ULL, },
+ { 0xf7bffef7bffef7bfULL, 0xfef7bffef7bffef7ULL, },
+ { 0xeffd7feffd7feffdULL, 0x7feffd7feffd7fefULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 8 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x2020202020202020ULL, 0x2020202020202020ULL, },
+ { 0x1010101010101010ULL, 0x1010101010101010ULL, },
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, },
+ { 0x0840010840010840ULL, 0x0108400108400108ULL, },
+ { 0x1002801002801002ULL, 0x8010028010028010ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, /* 16 */
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0xaeaeaeaeaeaeaeaeULL, 0xaeaeaeaeaeaeaeaeULL, },
+ { 0x8a8a8a8a8a8a8a8aULL, 0x8a8a8a8a8a8a8a8aULL, },
+ { 0xbabababababababaULL, 0xbabababababababaULL, },
+ { 0xa2a2a2a2a2a2a2a2ULL, 0xa2a2a2a2a2a2a2a2ULL, },
+ { 0xa2eaaba2eaaba2eaULL, 0xaba2eaaba2eaaba2ULL, },
+ { 0xbaa82abaa82abaa8ULL, 0x2abaa82abaa82abaULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, /* 24 */
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, },
+ { 0x5151515151515151ULL, 0x5151515151515151ULL, },
+ { 0x7575757575757575ULL, 0x7575757575757575ULL, },
+ { 0x4545454545454545ULL, 0x4545454545454545ULL, },
+ { 0x5d5d5d5d5d5d5d5dULL, 0x5d5d5d5d5d5d5d5dULL, },
+ { 0x5d15545d15545d15ULL, 0x545d15545d15545dULL, },
+ { 0x4557d54557d54557ULL, 0xd54557d54557d545ULL, },
+ { 0x4c4c4c4c4c4c4c4cULL, 0x4c4c4c4c4c4c4c4cULL, }, /* 32 */
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, },
+ { 0xc8c8c8c8c8c8c8c8ULL, 0xc8c8c8c8c8c8c8c8ULL, },
+ { 0xececececececececULL, 0xececececececececULL, },
+ { 0xdcdcdcdcdcdcdcdcULL, 0xdcdcdcdcdcdcdcdcULL, },
+ { 0xc4c4c4c4c4c4c4c4ULL, 0xc4c4c4c4c4c4c4c4ULL, },
+ { 0xc48ccdc48ccdc48cULL, 0xcdc48ccdc48ccdc4ULL, },
+ { 0xdcce4cdcce4cdcceULL, 0x4cdcce4cdcce4cdcULL, },
+ { 0xb3b3b3b3b3b3b3b3ULL, 0xb3b3b3b3b3b3b3b3ULL, }, /* 40 */
+ { 0x3232323232323232ULL, 0x3232323232323232ULL, },
+ { 0x3737373737373737ULL, 0x3737373737373737ULL, },
+ { 0x1313131313131313ULL, 0x1313131313131313ULL, },
+ { 0x2323232323232323ULL, 0x2323232323232323ULL, },
+ { 0x3b3b3b3b3b3b3b3bULL, 0x3b3b3b3b3b3b3b3bULL, },
+ { 0x3b73323b73323b73ULL, 0x323b73323b73323bULL, },
+ { 0x2331b32331b32331ULL, 0xb32331b32331b323ULL, },
+ { 0x630eb8630eb8630eULL, 0xb8630eb8630eb863ULL, }, /* 48 */
+ { 0xe28f39e28f39e28fULL, 0x39e28f39e28f39e2ULL, },
+ { 0xe78a3ce78a3ce78aULL, 0x3ce78a3ce78a3ce7ULL, },
+ { 0xc3ae18c3ae18c3aeULL, 0x18c3ae18c3ae18c3ULL, },
+ { 0xf39e28f39e28f39eULL, 0x28f39e28f39e28f3ULL, },
+ { 0xeb8630eb8630eb86ULL, 0x30eb8630eb8630ebULL, },
+ { 0xebce39ebce39ebceULL, 0x39ebce39ebce39ebULL, },
+ { 0xf38cb8f38cb8f38cULL, 0xb8f38cb8f38cb8f3ULL, },
+ { 0x9cf1479cf1479cf1ULL, 0x479cf1479cf1479cULL, }, /* 56 */
+ { 0x1d70c61d70c61d70ULL, 0xc61d70c61d70c61dULL, },
+ { 0x1875c31875c31875ULL, 0xc31875c31875c318ULL, },
+ { 0x3c51e73c51e73c51ULL, 0xe73c51e73c51e73cULL, },
+ { 0x0c61d70c61d70c61ULL, 0xd70c61d70c61d70cULL, },
+ { 0x1479cf1479cf1479ULL, 0xcf1479cf1479cf14ULL, },
+ { 0x1431c61431c61431ULL, 0xc61431c61431c614ULL, },
+ { 0x0c73470c73470c73ULL, 0x470c73470c73470cULL, },
+ { 0x896ea6dc29667541ULL, 0x43e7031ebe73b11cULL, }, /* 64 */
+ { 0x802ae7c4086ad541ULL, 0x4fe7035adefbb41cULL, },
+ { 0x986ea6c82ae25d41ULL, 0xcb664bdef673901cULL, },
+ { 0x89eaa6ec68605100ULL, 0x6b650a5ffc7fb40dULL, },
+ { 0xfaba40734c97e709ULL, 0x1a77b35a553753ecULL, },
+ { 0xf3fe016b6d9b4709ULL, 0x1677b31e35bf56ecULL, },
+ { 0xebba40674f13cf09ULL, 0x92f6fb9a1d3772ecULL, },
+ { 0xfa3e40430d91c348ULL, 0x32f5ba1b173b56fdULL, },
+ { 0xad5eeebab8cbab81ULL, 0x2f58cebfeb232404ULL, }, /* 72 */
+ { 0xa41aafa299c70b81ULL, 0x2358cefb8bab2104ULL, },
+ { 0xbc5eeeaebb4f8381ULL, 0xa7d9867fa3230504ULL, },
+ { 0xaddaee8af9cd8fc0ULL, 0x07dac7fea92f2115ULL, },
+ { 0x714b565d5f35c24fULL, 0x85718098e94ae3b0ULL, },
+ { 0x780f17457e39624fULL, 0x897180dc89c2e6b0ULL, },
+ { 0x604b56495cb1ea4fULL, 0x0df0c858a14ac2b0ULL, },
+ { 0x71cf566d1e33e60eULL, 0xadf389d9ab46e6a1ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_d.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_d.c
new file mode 100644
index 0000000000..44cd608688
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BNEG.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BNEG.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, /* 0 */
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, },
+ { 0xfffffbffffffffffULL, 0xfffffbffffffffffULL, },
+ { 0xffffffffffdfffffULL, 0xffffffffffdfffffULL, },
+ { 0xffffffffffffefffULL, 0xffffffffffffefffULL, },
+ { 0xfff7ffffffffffffULL, 0xfff7ffffffffffffULL, },
+ { 0xffffffffffffbfffULL, 0xfffffff7ffffffffULL, },
+ { 0xfffdffffffffffffULL, 0xffffffffefffffffULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 8 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000040000000000ULL, 0x0000040000000000ULL, },
+ { 0x0000000000200000ULL, 0x0000000000200000ULL, },
+ { 0x0000000000001000ULL, 0x0000000000001000ULL, },
+ { 0x0008000000000000ULL, 0x0008000000000000ULL, },
+ { 0x0000000000004000ULL, 0x0000000800000000ULL, },
+ { 0x0002000000000000ULL, 0x0000000010000000ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0xaaaaaeaaaaaaaaaaULL, 0xaaaaaeaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaa8aaaaaULL, 0xaaaaaaaaaa8aaaaaULL, },
+ { 0xaaaaaaaaaaaabaaaULL, 0xaaaaaaaaaaaabaaaULL, },
+ { 0xaaa2aaaaaaaaaaaaULL, 0xaaa2aaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaeaaaULL, 0xaaaaaaa2aaaaaaaaULL, },
+ { 0xaaa8aaaaaaaaaaaaULL, 0xaaaaaaaabaaaaaaaULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, }, /* 24 */
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, },
+ { 0x5555515555555555ULL, 0x5555515555555555ULL, },
+ { 0x5555555555755555ULL, 0x5555555555755555ULL, },
+ { 0x5555555555554555ULL, 0x5555555555554555ULL, },
+ { 0x555d555555555555ULL, 0x555d555555555555ULL, },
+ { 0x5555555555551555ULL, 0x5555555d55555555ULL, },
+ { 0x5557555555555555ULL, 0x5555555545555555ULL, },
+ { 0x4cccccccccccccccULL, 0x4cccccccccccccccULL, }, /* 32 */
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, },
+ { 0xccccc8ccccccccccULL, 0xccccc8ccccccccccULL, },
+ { 0xccccccccccecccccULL, 0xccccccccccecccccULL, },
+ { 0xccccccccccccdcccULL, 0xccccccccccccdcccULL, },
+ { 0xccc4ccccccccccccULL, 0xccc4ccccccccccccULL, },
+ { 0xcccccccccccc8cccULL, 0xccccccc4ccccccccULL, },
+ { 0xccceccccccccccccULL, 0xccccccccdcccccccULL, },
+ { 0xb333333333333333ULL, 0xb333333333333333ULL, }, /* 40 */
+ { 0x3333333333333332ULL, 0x3333333333333332ULL, },
+ { 0x3333373333333333ULL, 0x3333373333333333ULL, },
+ { 0x3333333333133333ULL, 0x3333333333133333ULL, },
+ { 0x3333333333332333ULL, 0x3333333333332333ULL, },
+ { 0x333b333333333333ULL, 0x333b333333333333ULL, },
+ { 0x3333333333337333ULL, 0x3333333b33333333ULL, },
+ { 0x3331333333333333ULL, 0x3333333323333333ULL, },
+ { 0x638e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e2ULL, },
+ { 0xe38e3ce38e38e38eULL, 0x38e38a38e38e38e3ULL, },
+ { 0xe38e38e38e18e38eULL, 0x38e38e38e3ae38e3ULL, },
+ { 0xe38e38e38e38f38eULL, 0x38e38e38e38e28e3ULL, },
+ { 0xe38638e38e38e38eULL, 0x38eb8e38e38e38e3ULL, },
+ { 0xe38e38e38e38a38eULL, 0x38e38e30e38e38e3ULL, },
+ { 0xe38c38e38e38e38eULL, 0x38e38e38f38e38e3ULL, },
+ { 0x9c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71c71dULL, },
+ { 0x1c71c31c71c71c71ULL, 0xc71c75c71c71c71cULL, },
+ { 0x1c71c71c71e71c71ULL, 0xc71c71c71c51c71cULL, },
+ { 0x1c71c71c71c70c71ULL, 0xc71c71c71c71d71cULL, },
+ { 0x1c79c71c71c71c71ULL, 0xc71471c71c71c71cULL, },
+ { 0x1c71c71c71c75c71ULL, 0xc71c71cf1c71c71cULL, },
+ { 0x1c73c71c71c71c71ULL, 0xc71c71c70c71c71cULL, },
+ { 0x886ae6cc28625541ULL, 0x4b670b5efe7ba00cULL, }, /* 64 */
+ { 0x886ae6cc28625440ULL, 0x5b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625541ULL, 0x4b670b5efe6bb00cULL, },
+ { 0x886ae6cc28621540ULL, 0x4b670b5ffe7bb00cULL, },
+ { 0xfbbe00634d93c709ULL, 0x12f7bb1a153f42fcULL, },
+ { 0xfbbe00634d93c608ULL, 0x02f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c709ULL, 0x12f7bb1a152f52fcULL, },
+ { 0xfbbe00634d938708ULL, 0x12f7bb1b153f52fcULL, },
+ { 0xac5aaeaab9cf8b81ULL, 0x27d8c6ffab2b3514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8a80ULL, 0x37d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b81ULL, 0x27d8c6ffab3b2514ULL, },
+ { 0xac5aaeaab9cfcb80ULL, 0x27d8c6feab2b2514ULL, },
+ { 0x704f164d5e31e24fULL, 0x8df188d8a942f2a0ULL, },
+ { 0x704f164d5e31e34eULL, 0x9df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24fULL, 0x8df188d8a952e2a0ULL, },
+ { 0x704f164d5e31a24eULL, 0x8df188d9a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_h.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_h.c
new file mode 100644
index 0000000000..5d17ceeba3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BNEG.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BNEG.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, /* 0 */
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xfbfffbfffbfffbffULL, 0xfbfffbfffbfffbffULL, },
+ { 0xffdfffdfffdfffdfULL, 0xffdfffdfffdfffdfULL, },
+ { 0xefffefffefffefffULL, 0xefffefffefffefffULL, },
+ { 0xfff7fff7fff7fff7ULL, 0xfff7fff7fff7fff7ULL, },
+ { 0xbffffff7feffbfffULL, 0xfff7feffbffffff7ULL, },
+ { 0xfffdefffff7ffffdULL, 0xefffff7ffffdefffULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 8 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0400040004000400ULL, 0x0400040004000400ULL, },
+ { 0x0020002000200020ULL, 0x0020002000200020ULL, },
+ { 0x1000100010001000ULL, 0x1000100010001000ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x4000000801004000ULL, 0x0008010040000008ULL, },
+ { 0x0002100000800002ULL, 0x1000008000021000ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, /* 16 */
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0xaeaaaeaaaeaaaeaaULL, 0xaeaaaeaaaeaaaeaaULL, },
+ { 0xaa8aaa8aaa8aaa8aULL, 0xaa8aaa8aaa8aaa8aULL, },
+ { 0xbaaabaaabaaabaaaULL, 0xbaaabaaabaaabaaaULL, },
+ { 0xaaa2aaa2aaa2aaa2ULL, 0xaaa2aaa2aaa2aaa2ULL, },
+ { 0xeaaaaaa2abaaeaaaULL, 0xaaa2abaaeaaaaaa2ULL, },
+ { 0xaaa8baaaaa2aaaa8ULL, 0xbaaaaa2aaaa8baaaULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, /* 24 */
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, },
+ { 0x5155515551555155ULL, 0x5155515551555155ULL, },
+ { 0x5575557555755575ULL, 0x5575557555755575ULL, },
+ { 0x4555455545554555ULL, 0x4555455545554555ULL, },
+ { 0x555d555d555d555dULL, 0x555d555d555d555dULL, },
+ { 0x1555555d54551555ULL, 0x555d54551555555dULL, },
+ { 0x5557455555d55557ULL, 0x455555d555574555ULL, },
+ { 0x4ccc4ccc4ccc4cccULL, 0x4ccc4ccc4ccc4cccULL, }, /* 32 */
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, },
+ { 0xc8ccc8ccc8ccc8ccULL, 0xc8ccc8ccc8ccc8ccULL, },
+ { 0xccecccecccecccecULL, 0xccecccecccecccecULL, },
+ { 0xdcccdcccdcccdcccULL, 0xdcccdcccdcccdcccULL, },
+ { 0xccc4ccc4ccc4ccc4ULL, 0xccc4ccc4ccc4ccc4ULL, },
+ { 0x8cccccc4cdcc8cccULL, 0xccc4cdcc8cccccc4ULL, },
+ { 0xcccedccccc4cccceULL, 0xdccccc4ccccedcccULL, },
+ { 0xb333b333b333b333ULL, 0xb333b333b333b333ULL, }, /* 40 */
+ { 0x3332333233323332ULL, 0x3332333233323332ULL, },
+ { 0x3733373337333733ULL, 0x3733373337333733ULL, },
+ { 0x3313331333133313ULL, 0x3313331333133313ULL, },
+ { 0x2333233323332333ULL, 0x2333233323332333ULL, },
+ { 0x333b333b333b333bULL, 0x333b333b333b333bULL, },
+ { 0x7333333b32337333ULL, 0x333b32337333333bULL, },
+ { 0x3331233333b33331ULL, 0x233333b333312333ULL, },
+ { 0x638eb8e30e38638eULL, 0xb8e30e38638eb8e3ULL, }, /* 48 */
+ { 0xe38f38e28e39e38fULL, 0x38e28e39e38f38e2ULL, },
+ { 0xe78e3ce38a38e78eULL, 0x3ce38a38e78e3ce3ULL, },
+ { 0xe3ae38c38e18e3aeULL, 0x38c38e18e3ae38c3ULL, },
+ { 0xf38e28e39e38f38eULL, 0x28e39e38f38e28e3ULL, },
+ { 0xe38638eb8e30e386ULL, 0x38eb8e30e38638ebULL, },
+ { 0xa38e38eb8f38a38eULL, 0x38eb8f38a38e38ebULL, },
+ { 0xe38c28e38eb8e38cULL, 0x28e38eb8e38c28e3ULL, },
+ { 0x9c71471cf1c79c71ULL, 0x471cf1c79c71471cULL, }, /* 56 */
+ { 0x1c70c71d71c61c70ULL, 0xc71d71c61c70c71dULL, },
+ { 0x1871c31c75c71871ULL, 0xc31c75c71871c31cULL, },
+ { 0x1c51c73c71e71c51ULL, 0xc73c71e71c51c73cULL, },
+ { 0x0c71d71c61c70c71ULL, 0xd71c61c70c71d71cULL, },
+ { 0x1c79c71471cf1c79ULL, 0xc71471cf1c79c714ULL, },
+ { 0x5c71c71470c75c71ULL, 0xc71470c75c71c714ULL, },
+ { 0x1c73d71c71471c73ULL, 0xd71c71471c73d71cULL, },
+ { 0x8c6af6cc28665541ULL, 0x4be74b5ef67ba00cULL, }, /* 64 */
+ { 0xc86ae6c4286a5440ULL, 0x4be70f5e7e7ba00cULL, },
+ { 0x8c6ae2cca8625541ULL, 0x4a678b5ef67bb01cULL, },
+ { 0x086ac6cc28601540ULL, 0x4b650a5efe7fb00dULL, },
+ { 0xffbe10634d97c709ULL, 0x1277fb1a1d3f42fcULL, },
+ { 0xbbbe006b4d9bc608ULL, 0x1277bf1a953f42fcULL, },
+ { 0xffbe0463cd93c709ULL, 0x13f73b1a1d3f52ecULL, },
+ { 0x7bbe20634d918708ULL, 0x12f5ba1a153b52fdULL, },
+ { 0xa85abeaab9cb8b81ULL, 0x275886ffa32b3514ULL, }, /* 72 */
+ { 0xec5aaea2b9c78a80ULL, 0x2758c2ff2b2b3514ULL, },
+ { 0xa85aaaaa39cf8b81ULL, 0x26d846ffa32b2504ULL, },
+ { 0x2c5a8eaab9cdcb80ULL, 0x27dac7ffab2f2515ULL, },
+ { 0x744f064d5e35e24fULL, 0x8d71c8d8a142f2a0ULL, },
+ { 0x304f16455e39e34eULL, 0x8d718cd82942f2a0ULL, },
+ { 0x744f124dde31e24fULL, 0x8cf108d8a142e2b0ULL, },
+ { 0xf04f364d5e33a24eULL, 0x8df389d8a946e2a1ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_w.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_w.c
new file mode 100644
index 0000000000..90d21f453d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bneg_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BNEG.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BNEG.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, /* 0 */
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xfffffbfffffffbffULL, 0xfffffbfffffffbffULL, },
+ { 0xffdfffffffdfffffULL, 0xffdfffffffdfffffULL, },
+ { 0xffffefffffffefffULL, 0xffffefffffffefffULL, },
+ { 0xfff7fffffff7ffffULL, 0xfff7fffffff7ffffULL, },
+ { 0xfffffff7ffffbfffULL, 0xfefffffffffffff7ULL, },
+ { 0xeffffffffffdffffULL, 0xffffff7fefffffffULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 8 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000040000000400ULL, 0x0000040000000400ULL, },
+ { 0x0020000000200000ULL, 0x0020000000200000ULL, },
+ { 0x0000100000001000ULL, 0x0000100000001000ULL, },
+ { 0x0008000000080000ULL, 0x0008000000080000ULL, },
+ { 0x0000000800004000ULL, 0x0100000000000008ULL, },
+ { 0x1000000000020000ULL, 0x0000008010000000ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0xaaaaaeaaaaaaaeaaULL, 0xaaaaaeaaaaaaaeaaULL, },
+ { 0xaa8aaaaaaa8aaaaaULL, 0xaa8aaaaaaa8aaaaaULL, },
+ { 0xaaaabaaaaaaabaaaULL, 0xaaaabaaaaaaabaaaULL, },
+ { 0xaaa2aaaaaaa2aaaaULL, 0xaaa2aaaaaaa2aaaaULL, },
+ { 0xaaaaaaa2aaaaeaaaULL, 0xabaaaaaaaaaaaaa2ULL, },
+ { 0xbaaaaaaaaaa8aaaaULL, 0xaaaaaa2abaaaaaaaULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, /* 24 */
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, },
+ { 0x5555515555555155ULL, 0x5555515555555155ULL, },
+ { 0x5575555555755555ULL, 0x5575555555755555ULL, },
+ { 0x5555455555554555ULL, 0x5555455555554555ULL, },
+ { 0x555d5555555d5555ULL, 0x555d5555555d5555ULL, },
+ { 0x5555555d55551555ULL, 0x545555555555555dULL, },
+ { 0x4555555555575555ULL, 0x555555d545555555ULL, },
+ { 0x4ccccccc4cccccccULL, 0x4ccccccc4cccccccULL, }, /* 32 */
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, },
+ { 0xccccc8ccccccc8ccULL, 0xccccc8ccccccc8ccULL, },
+ { 0xccecccccccecccccULL, 0xccecccccccecccccULL, },
+ { 0xccccdcccccccdcccULL, 0xccccdcccccccdcccULL, },
+ { 0xccc4ccccccc4ccccULL, 0xccc4ccccccc4ccccULL, },
+ { 0xccccccc4cccc8cccULL, 0xcdccccccccccccc4ULL, },
+ { 0xdcccccccccceccccULL, 0xcccccc4cdcccccccULL, },
+ { 0xb3333333b3333333ULL, 0xb3333333b3333333ULL, }, /* 40 */
+ { 0x3333333233333332ULL, 0x3333333233333332ULL, },
+ { 0x3333373333333733ULL, 0x3333373333333733ULL, },
+ { 0x3313333333133333ULL, 0x3313333333133333ULL, },
+ { 0x3333233333332333ULL, 0x3333233333332333ULL, },
+ { 0x333b3333333b3333ULL, 0x333b3333333b3333ULL, },
+ { 0x3333333b33337333ULL, 0x323333333333333bULL, },
+ { 0x2333333333313333ULL, 0x333333b323333333ULL, },
+ { 0x638e38e30e38e38eULL, 0xb8e38e38638e38e3ULL, }, /* 48 */
+ { 0xe38e38e28e38e38fULL, 0x38e38e39e38e38e2ULL, },
+ { 0xe38e3ce38e38e78eULL, 0x38e38a38e38e3ce3ULL, },
+ { 0xe3ae38e38e18e38eULL, 0x38c38e38e3ae38e3ULL, },
+ { 0xe38e28e38e38f38eULL, 0x38e39e38e38e28e3ULL, },
+ { 0xe38638e38e30e38eULL, 0x38eb8e38e38638e3ULL, },
+ { 0xe38e38eb8e38a38eULL, 0x39e38e38e38e38ebULL, },
+ { 0xf38e38e38e3ae38eULL, 0x38e38eb8f38e38e3ULL, },
+ { 0x9c71c71cf1c71c71ULL, 0x471c71c79c71c71cULL, }, /* 56 */
+ { 0x1c71c71d71c71c70ULL, 0xc71c71c61c71c71dULL, },
+ { 0x1c71c31c71c71871ULL, 0xc71c75c71c71c31cULL, },
+ { 0x1c51c71c71e71c71ULL, 0xc73c71c71c51c71cULL, },
+ { 0x1c71d71c71c70c71ULL, 0xc71c61c71c71d71cULL, },
+ { 0x1c79c71c71cf1c71ULL, 0xc71471c71c79c71cULL, },
+ { 0x1c71c71471c75c71ULL, 0xc61c71c71c71c714ULL, },
+ { 0x0c71c71c71c51c71ULL, 0xc71c71470c71c71cULL, },
+ { 0x886af6cc28625541ULL, 0x0b670b5efe7ba00cULL, }, /* 64 */
+ { 0x886ae6c428625440ULL, 0x4f670b5eee7bb00cULL, },
+ { 0x886ae2cc28625541ULL, 0xcb670b5efe6bb00cULL, },
+ { 0x886ac6cc28621540ULL, 0x4a670b5efe7bb00dULL, },
+ { 0xfbbe10634d93c709ULL, 0x52f7bb1a153f42fcULL, },
+ { 0xfbbe006b4d93c608ULL, 0x16f7bb1a053f52fcULL, },
+ { 0xfbbe04634d93c709ULL, 0x92f7bb1a152f52fcULL, },
+ { 0xfbbe20634d938708ULL, 0x13f7bb1a153f52fdULL, },
+ { 0xac5abeaab9cf8b81ULL, 0x67d8c6ffab2b3514ULL, }, /* 72 */
+ { 0xac5aaea2b9cf8a80ULL, 0x23d8c6ffbb2b2514ULL, },
+ { 0xac5aaaaab9cf8b81ULL, 0xa7d8c6ffab3b2514ULL, },
+ { 0xac5a8eaab9cfcb80ULL, 0x26d8c6ffab2b2515ULL, },
+ { 0x704f064d5e31e24fULL, 0xcdf188d8a942f2a0ULL, },
+ { 0x704f16455e31e34eULL, 0x89f188d8b942e2a0ULL, },
+ { 0x704f124d5e31e24fULL, 0x0df188d8a952e2a0ULL, },
+ { 0x704f364d5e31a24eULL, 0x8cf188d8a942e2a1ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BNEG_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_b.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_b.c
new file mode 100644
index 0000000000..8aabf4bb88
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BSET.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BSET.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 8 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x2020202020202020ULL, 0x2020202020202020ULL, },
+ { 0x1010101010101010ULL, 0x1010101010101010ULL, },
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, },
+ { 0x0840010840010840ULL, 0x0108400108400108ULL, },
+ { 0x1002801002801002ULL, 0x8010028010028010ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0xaeaeaeaeaeaeaeaeULL, 0xaeaeaeaeaeaeaeaeULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xbabababababababaULL, 0xbabababababababaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaeaabaaeaabaaeaULL, 0xabaaeaabaaeaabaaULL, },
+ { 0xbaaaaabaaaaabaaaULL, 0xaabaaaaabaaaaabaULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7575757575757575ULL, 0x7575757575757575ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5d5d5d5d5d5d5d5dULL, 0x5d5d5d5d5d5d5d5dULL, },
+ { 0x5d55555d55555d55ULL, 0x555d55555d55555dULL, },
+ { 0x5557d55557d55557ULL, 0xd55557d55557d555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xececececececececULL, 0xececececececececULL, },
+ { 0xdcdcdcdcdcdcdcdcULL, 0xdcdcdcdcdcdcdcdcULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccdcccccdccccULL, 0xcdcccccdcccccdccULL, },
+ { 0xdcceccdcceccdcceULL, 0xccdcceccdcceccdcULL, },
+ { 0xb3b3b3b3b3b3b3b3ULL, 0xb3b3b3b3b3b3b3b3ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3737373737373737ULL, 0x3737373737373737ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3b3b3b3b3b3b3b3bULL, 0x3b3b3b3b3b3b3b3bULL, },
+ { 0x3b73333b73333b73ULL, 0x333b73333b73333bULL, },
+ { 0x3333b33333b33333ULL, 0xb33333b33333b333ULL, },
+ { 0xe38eb8e38eb8e38eULL, 0xb8e38eb8e38eb8e3ULL, }, /* 48 */
+ { 0xe38f39e38f39e38fULL, 0x39e38f39e38f39e3ULL, },
+ { 0xe78e3ce78e3ce78eULL, 0x3ce78e3ce78e3ce7ULL, },
+ { 0xe3ae38e3ae38e3aeULL, 0x38e3ae38e3ae38e3ULL, },
+ { 0xf39e38f39e38f39eULL, 0x38f39e38f39e38f3ULL, },
+ { 0xeb8e38eb8e38eb8eULL, 0x38eb8e38eb8e38ebULL, },
+ { 0xebce39ebce39ebceULL, 0x39ebce39ebce39ebULL, },
+ { 0xf38eb8f38eb8f38eULL, 0xb8f38eb8f38eb8f3ULL, },
+ { 0x9cf1c79cf1c79cf1ULL, 0xc79cf1c79cf1c79cULL, }, /* 56 */
+ { 0x1d71c71d71c71d71ULL, 0xc71d71c71d71c71dULL, },
+ { 0x1c75c71c75c71c75ULL, 0xc71c75c71c75c71cULL, },
+ { 0x3c71e73c71e73c71ULL, 0xe73c71e73c71e73cULL, },
+ { 0x1c71d71c71d71c71ULL, 0xd71c71d71c71d71cULL, },
+ { 0x1c79cf1c79cf1c79ULL, 0xcf1c79cf1c79cf1cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c73c71c73c71c73ULL, 0xc71c73c71c73c71cULL, },
+ { 0x896ee6dc29667541ULL, 0x4be70b5efe7bb11cULL, }, /* 64 */
+ { 0x886ae7cc286ad541ULL, 0x4fe70b5efefbb41cULL, },
+ { 0x986ee6cc2ae25d41ULL, 0xcb674bdefe7bb01cULL, },
+ { 0x89eae6ec68625540ULL, 0x6b670b5ffe7fb40dULL, },
+ { 0xfbbe40734d97e709ULL, 0x1af7bb5a553f53fcULL, },
+ { 0xfbfe016b6d9bc709ULL, 0x16f7bb1e35bf56fcULL, },
+ { 0xfbbe40674f93cf09ULL, 0x92f7fb9a1d3f72fcULL, },
+ { 0xfbbe40634d93c748ULL, 0x32f7bb1b173f56fdULL, },
+ { 0xad5eeebab9cfab81ULL, 0x2fd8ceffeb2b2514ULL, }, /* 72 */
+ { 0xac5aafaab9cf8b81ULL, 0x27d8ceffabab2514ULL, },
+ { 0xbc5eeeaebbcf8b81ULL, 0xa7d9c6ffab2b2514ULL, },
+ { 0xaddaeeaaf9cf8fc0ULL, 0x27dac7ffab2f2515ULL, },
+ { 0x714f565d5f35e24fULL, 0x8df188d8e94ae3b0ULL, },
+ { 0x784f174d7e39e24fULL, 0x8df188dca9c2e6b0ULL, },
+ { 0x704f564d5eb1ea4fULL, 0x8df1c8d8a94ae2b0ULL, },
+ { 0x71cf566d5e33e64eULL, 0xadf389d9ab46e6a1ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_d.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_d.c
new file mode 100644
index 0000000000..e3f9a7e4ca
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BSET.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BSET.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 8 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000040000000000ULL, 0x0000040000000000ULL, },
+ { 0x0000000000200000ULL, 0x0000000000200000ULL, },
+ { 0x0000000000001000ULL, 0x0000000000001000ULL, },
+ { 0x0008000000000000ULL, 0x0008000000000000ULL, },
+ { 0x0000000000004000ULL, 0x0000000800000000ULL, },
+ { 0x0002000000000000ULL, 0x0000000010000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0xaaaaaeaaaaaaaaaaULL, 0xaaaaaeaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaabaaaULL, 0xaaaaaaaaaaaabaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaeaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaabaaaaaaaULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555755555ULL, 0x5555555555755555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x555d555555555555ULL, 0x555d555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555d55555555ULL, },
+ { 0x5557555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccecccccULL, 0xccccccccccecccccULL, },
+ { 0xccccccccccccdcccULL, 0xccccccccccccdcccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccceccccccccccccULL, 0xccccccccdcccccccULL, },
+ { 0xb333333333333333ULL, 0xb333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333373333333333ULL, 0x3333373333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333b333333333333ULL, 0x333b333333333333ULL, },
+ { 0x3333333333337333ULL, 0x3333333b33333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e3ce38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e3ae38e3ULL, },
+ { 0xe38e38e38e38f38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38eb8e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38f38e38e3ULL, },
+ { 0x9c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71dULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c75c71c71c71cULL, },
+ { 0x1c71c71c71e71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71d71cULL, },
+ { 0x1c79c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c75c71ULL, 0xc71c71cf1c71c71cULL, },
+ { 0x1c73c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625541ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x5b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625541ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5ffe7bb00cULL, },
+ { 0xfbbe00634d93c709ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c709ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1b153f52fcULL, },
+ { 0xac5aaeaab9cf8b81ULL, 0x27d8c6ffab2b3514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x37d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b81ULL, 0x27d8c6ffab3b2514ULL, },
+ { 0xac5aaeaab9cfcb80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24fULL, 0x8df188d8a942f2a0ULL, },
+ { 0x704f164d5e31e34eULL, 0x9df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24fULL, 0x8df188d8a952e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d9a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_h.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_h.c
new file mode 100644
index 0000000000..cf9f608180
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BSET.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BSET.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 8 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0400040004000400ULL, 0x0400040004000400ULL, },
+ { 0x0020002000200020ULL, 0x0020002000200020ULL, },
+ { 0x1000100010001000ULL, 0x1000100010001000ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x4000000801004000ULL, 0x0008010040000008ULL, },
+ { 0x0002100000800002ULL, 0x1000008000021000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0xaeaaaeaaaeaaaeaaULL, 0xaeaaaeaaaeaaaeaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xbaaabaaabaaabaaaULL, 0xbaaabaaabaaabaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xeaaaaaaaabaaeaaaULL, 0xaaaaabaaeaaaaaaaULL, },
+ { 0xaaaabaaaaaaaaaaaULL, 0xbaaaaaaaaaaabaaaULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5575557555755575ULL, 0x5575557555755575ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x555d555d555d555dULL, 0x555d555d555d555dULL, },
+ { 0x5555555d55555555ULL, 0x555d55555555555dULL, },
+ { 0x5557555555d55557ULL, 0x555555d555575555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccecccecccecccecULL, 0xccecccecccecccecULL, },
+ { 0xdcccdcccdcccdcccULL, 0xdcccdcccdcccdcccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccccdccccccULL, 0xcccccdccccccccccULL, },
+ { 0xcccedcccccccccceULL, 0xdccccccccccedcccULL, },
+ { 0xb333b333b333b333ULL, 0xb333b333b333b333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3733373337333733ULL, 0x3733373337333733ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333b333b333b333bULL, 0x333b333b333b333bULL, },
+ { 0x7333333b33337333ULL, 0x333b33337333333bULL, },
+ { 0x3333333333b33333ULL, 0x333333b333333333ULL, },
+ { 0xe38eb8e38e38e38eULL, 0xb8e38e38e38eb8e3ULL, }, /* 48 */
+ { 0xe38f38e38e39e38fULL, 0x38e38e39e38f38e3ULL, },
+ { 0xe78e3ce38e38e78eULL, 0x3ce38e38e78e3ce3ULL, },
+ { 0xe3ae38e38e38e3aeULL, 0x38e38e38e3ae38e3ULL, },
+ { 0xf38e38e39e38f38eULL, 0x38e39e38f38e38e3ULL, },
+ { 0xe38e38eb8e38e38eULL, 0x38eb8e38e38e38ebULL, },
+ { 0xe38e38eb8f38e38eULL, 0x38eb8f38e38e38ebULL, },
+ { 0xe38e38e38eb8e38eULL, 0x38e38eb8e38e38e3ULL, },
+ { 0x9c71c71cf1c79c71ULL, 0xc71cf1c79c71c71cULL, }, /* 56 */
+ { 0x1c71c71d71c71c71ULL, 0xc71d71c71c71c71dULL, },
+ { 0x1c71c71c75c71c71ULL, 0xc71c75c71c71c71cULL, },
+ { 0x1c71c73c71e71c71ULL, 0xc73c71e71c71c73cULL, },
+ { 0x1c71d71c71c71c71ULL, 0xd71c71c71c71d71cULL, },
+ { 0x1c79c71c71cf1c79ULL, 0xc71c71cf1c79c71cULL, },
+ { 0x5c71c71c71c75c71ULL, 0xc71c71c75c71c71cULL, },
+ { 0x1c73d71c71c71c73ULL, 0xd71c71c71c73d71cULL, },
+ { 0x8c6af6cc28665541ULL, 0x4be74b5efe7bb00cULL, }, /* 64 */
+ { 0xc86ae6cc286a5540ULL, 0x4be70f5efe7bb00cULL, },
+ { 0x8c6ae6cca8625541ULL, 0x4b678b5efe7bb01cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7fb00dULL, },
+ { 0xffbe10634d97c709ULL, 0x12f7fb1a1d3f52fcULL, },
+ { 0xfbbe006b4d9bc708ULL, 0x12f7bf1a953f52fcULL, },
+ { 0xffbe0463cd93c709ULL, 0x13f7bb1a1d3f52fcULL, },
+ { 0xfbbe20634d93c708ULL, 0x12f7bb1a153f52fdULL, },
+ { 0xac5abeaab9cf8b81ULL, 0x27d8c6ffab2b3514ULL, }, /* 72 */
+ { 0xec5aaeaab9cf8b80ULL, 0x27d8c6ffab2b3514ULL, },
+ { 0xac5aaeaab9cf8b81ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cfcb80ULL, 0x27dac7ffab2f2515ULL, },
+ { 0x744f164d5e35e24fULL, 0x8df1c8d8a942f2a0ULL, },
+ { 0x704f164d5e39e34eULL, 0x8df18cd8a942f2a0ULL, },
+ { 0x744f164dde31e24fULL, 0x8df188d8a942e2b0ULL, },
+ { 0xf04f364d5e33e24eULL, 0x8df389d8a946e2a1ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_w.c b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_w.c
new file mode 100644
index 0000000000..77478116f2
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/bit-set/test_msa_bset_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction BSET.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Bit Set";
+ char *instruction_name = "BSET.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 8 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000040000000400ULL, 0x0000040000000400ULL, },
+ { 0x0020000000200000ULL, 0x0020000000200000ULL, },
+ { 0x0000100000001000ULL, 0x0000100000001000ULL, },
+ { 0x0008000000080000ULL, 0x0008000000080000ULL, },
+ { 0x0000000800004000ULL, 0x0100000000000008ULL, },
+ { 0x1000000000020000ULL, 0x0000008010000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0xaaaaaeaaaaaaaeaaULL, 0xaaaaaeaaaaaaaeaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaabaaaaaaabaaaULL, 0xaaaabaaaaaaabaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaeaaaULL, 0xabaaaaaaaaaaaaaaULL, },
+ { 0xbaaaaaaaaaaaaaaaULL, 0xaaaaaaaabaaaaaaaULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5575555555755555ULL, 0x5575555555755555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x555d5555555d5555ULL, 0x555d5555555d5555ULL, },
+ { 0x5555555d55555555ULL, 0x555555555555555dULL, },
+ { 0x5555555555575555ULL, 0x555555d555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccecccccccecccccULL, 0xccecccccccecccccULL, },
+ { 0xccccdcccccccdcccULL, 0xccccdcccccccdcccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xcdccccccccccccccULL, },
+ { 0xdcccccccccceccccULL, 0xccccccccdcccccccULL, },
+ { 0xb3333333b3333333ULL, 0xb3333333b3333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333373333333733ULL, 0x3333373333333733ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333b3333333b3333ULL, 0x333b3333333b3333ULL, },
+ { 0x3333333b33337333ULL, 0x333333333333333bULL, },
+ { 0x3333333333333333ULL, 0x333333b333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38fULL, 0x38e38e39e38e38e3ULL, },
+ { 0xe38e3ce38e38e78eULL, 0x38e38e38e38e3ce3ULL, },
+ { 0xe3ae38e38e38e38eULL, 0x38e38e38e3ae38e3ULL, },
+ { 0xe38e38e38e38f38eULL, 0x38e39e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38eb8e38e38e38e3ULL, },
+ { 0xe38e38eb8e38e38eULL, 0x39e38e38e38e38ebULL, },
+ { 0xf38e38e38e3ae38eULL, 0x38e38eb8f38e38e3ULL, },
+ { 0x9c71c71cf1c71c71ULL, 0xc71c71c79c71c71cULL, }, /* 56 */
+ { 0x1c71c71d71c71c71ULL, 0xc71c71c71c71c71dULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c75c71c71c71cULL, },
+ { 0x1c71c71c71e71c71ULL, 0xc73c71c71c71c71cULL, },
+ { 0x1c71d71c71c71c71ULL, 0xc71c71c71c71d71cULL, },
+ { 0x1c79c71c71cf1c71ULL, 0xc71c71c71c79c71cULL, },
+ { 0x1c71c71c71c75c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886af6cc28625541ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x4f670b5efe7bb00cULL, },
+ { 0x886ae6cc28625541ULL, 0xcb670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00dULL, },
+ { 0xfbbe10634d93c709ULL, 0x52f7bb1a153f52fcULL, },
+ { 0xfbbe006b4d93c708ULL, 0x16f7bb1a153f52fcULL, },
+ { 0xfbbe04634d93c709ULL, 0x92f7bb1a153f52fcULL, },
+ { 0xfbbe20634d93c708ULL, 0x13f7bb1a153f52fdULL, },
+ { 0xac5abeaab9cf8b81ULL, 0x67d8c6ffab2b3514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffbb2b2514ULL, },
+ { 0xac5aaeaab9cf8b81ULL, 0xa7d8c6ffab3b2514ULL, },
+ { 0xac5aaeaab9cfcb80ULL, 0x27d8c6ffab2b2515ULL, },
+ { 0x704f164d5e31e24fULL, 0xcdf188d8a942f2a0ULL, },
+ { 0x704f164d5e31e34eULL, 0x8df188d8b942e2a0ULL, },
+ { 0x704f164d5e31e24fULL, 0x8df188d8a952e2a0ULL, },
+ { 0x704f364d5e31e24eULL, 0x8df188d8a942e2a1ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_BSET_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c
new file mode 100644
index 0000000000..29a2990011
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MADD_Q.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MADD_Q.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xfffefffdfffefffeULL, 0xfffdfffefffefffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, }, /* 8 */
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, }, /* 16 */
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0x38e138e138e138e1ULL, 0x38e138e138e138e1ULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0x221f221f221f221fULL, 0x221f221f221f221fULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0x12f2da0f4bd712f2ULL, 0xda0f4bd712f2da0fULL, },
+ { 0xfffbfffcfffcfffbULL, 0xfffcfffcfffbfffcULL, },
+ { 0xfffafffbfffbfffaULL, 0xfffbfffbfffafffbULL, }, /* 24 */
+ { 0xfffafffbfffbfffaULL, 0xfffbfffbfffafffbULL, },
+ { 0xc716c717c717c716ULL, 0xc717c717c716c717ULL, },
+ { 0xfff9fffafffafff9ULL, 0xfffafffafff9fffaULL, },
+ { 0xddd6ddd7ddd7ddd6ULL, 0xddd7ddd7ddd6ddd7ULL, },
+ { 0xfff7fff8fff8fff7ULL, 0xfff8fff8fff7fff8ULL, },
+ { 0xed0025e4b41ded00ULL, 0x25e4b41ded0025e4ULL, },
+ { 0xfff5fff6fff6fff5ULL, 0xfff6fff6fff5fff6ULL, },
+ { 0xfff5fff6fff6fff5ULL, 0xfff6fff6fff5fff6ULL, }, /* 32 */
+ { 0xfff5fff6fff6fff5ULL, 0xfff6fff6fff5fff6ULL, },
+ { 0x2217221822182217ULL, 0x2218221822172218ULL, },
+ { 0xfff4fff5fff5fff4ULL, 0xfff5fff5fff4fff5ULL, },
+ { 0x146f14701470146fULL, 0x14701470146f1470ULL, },
+ { 0xfff3fff4fff4fff3ULL, 0xfff4fff4fff3fff4ULL, },
+ { 0x0b53e9322d770b53ULL, 0xe9322d770b53e932ULL, },
+ { 0xfff2fff3fff3fff2ULL, 0xfff3fff3fff2fff3ULL, },
+ { 0xfff1fff2fff2fff1ULL, 0xfff2fff2fff1fff2ULL, }, /* 40 */
+ { 0xfff1fff2fff2fff1ULL, 0xfff2fff2fff1fff2ULL, },
+ { 0xddceddcfddcfddceULL, 0xddcfddcfddceddcfULL, },
+ { 0xffeffff0fff0ffefULL, 0xfff0fff0ffeffff0ULL, },
+ { 0xeb73eb74eb74eb73ULL, 0xeb74eb74eb73eb74ULL, },
+ { 0xffedffeeffeeffedULL, 0xffeeffeeffedffeeULL, },
+ { 0xf48c16afd26af48cULL, 0x16afd26af48c16afULL, },
+ { 0xffecffedffecffecULL, 0xffedffecffecffedULL, },
+ { 0xffecffecffecffecULL, 0xffecffecffecffecULL, }, /* 48 */
+ { 0xffecffecffecffecULL, 0xffecffecffecffecULL, },
+ { 0x12e2d9ff4bc712e2ULL, 0xd9ff4bc712e2d9ffULL, },
+ { 0xffebffebffecffebULL, 0xffebffecffebffebULL, },
+ { 0x0b4be9292d6f0b4bULL, 0xe9292d6f0b4be929ULL, },
+ { 0xffeaffeaffebffeaULL, 0xffeaffebffeaffeaULL, },
+ { 0x063c1932650f063cULL, 0x1932650f063c1932ULL, },
+ { 0xffe9ffe9ffebffe9ULL, 0xffe9ffebffe9ffe9ULL, },
+ { 0xffe8ffe9ffeaffe8ULL, 0xffe9ffeaffe8ffe9ULL, }, /* 56 */
+ { 0xffe8ffe9ffeaffe8ULL, 0xffe9ffeaffe8ffe9ULL, },
+ { 0xecf125d6b40fecf1ULL, 0x25d6b40fecf125d6ULL, },
+ { 0xffe6ffe8ffe8ffe6ULL, 0xffe8ffe8ffe6ffe8ULL, },
+ { 0xf48516a9d264f485ULL, 0x16a9d264f48516a9ULL, },
+ { 0xffe5ffe7ffe6ffe5ULL, 0xffe7ffe6ffe5ffe7ULL, },
+ { 0xf992e69e9ac2f992ULL, 0xe69e9ac2f992e69eULL, },
+ { 0xffe3ffe7ffe4ffe3ULL, 0xffe7ffe4ffe3ffe7ULL, },
+ { 0x6f9c04dd0ca138aaULL, 0x2c5200e6ffe731d8ULL, }, /* 64 */
+ { 0x739604c9251a12b8ULL, 0x377dfac7ffa6fe02ULL, },
+ { 0x7fff14cc0ef4c520ULL, 0x4ef5f5b700a7e6d8ULL, },
+ { 0x171110672cabb158ULL, 0x0bc4eb2201aef931ULL, },
+ { 0x1b0b105345248b66ULL, 0x16efe503016dc55bULL, },
+ { 0x1b2f10537427a4c0ULL, 0x19be0a1804f3fb27ULL, },
+ { 0x1df71014499cd899ULL, 0x1fa528c6f6de1330ULL, },
+ { 0x1a3a10257fffe5d0ULL, 0x0ebe68e9e8780024ULL, },
+ { 0x6860202869d99838ULL, 0x263663d9e979e8faULL, }, /* 72 */
+ { 0x6b281fe93f4ecc11ULL, 0x2c1d7fffdb640103ULL, },
+ { 0x7fff539865cb3619ULL, 0x38847fff139c0bc0ULL, },
+ { 0x369a456c32245120ULL, 0x15027fff4d19033dULL, },
+ { 0xcdac41074fdb3d58ULL, 0xd1d1756a4e201596ULL, },
+ { 0xc9ef41187fff4a8fULL, 0xc0ea7fff3fba028aULL, },
+ { 0x808a32ec4c586596ULL, 0x9d687fff7937fa07ULL, },
+ { 0xe31436ce7fff6c79ULL, 0x030a7fff7fff00c4ULL, },
+ { 0xfe192c037fff7fffULL, 0x04d47fff7e7a0049ULL, }, /* 80 */
+ { 0xfe292c257fff4707ULL, 0x058b3b197fff0078ULL, },
+ { 0xff5c101739ce0661ULL, 0x074420c72b2a009aULL, },
+ { 0xfecc12e4645704e6ULL, 0x00ca02430de90076ULL, },
+ { 0xffeb0f2b7fff0829ULL, 0x014002760dbe002cULL, },
+ { 0xffeb0f367fff0487ULL, 0x016f012210050048ULL, },
+ { 0xfff8058b39ce0068ULL, 0x01e100a00567005cULL, },
+ { 0xfff006826457004fULL, 0x0034000b01bd0046ULL, },
+ { 0xfffe05397fff0083ULL, 0x0052000b01b7001aULL, }, /* 88 */
+ { 0xfffe053d7fff0048ULL, 0x005e000501ff002aULL, },
+ { 0xffff01e839ce0006ULL, 0x007b000200ac0036ULL, },
+ { 0xfffe023d64570004ULL, 0x000d000000370029ULL, },
+ { 0xffff01cc7fff0006ULL, 0x001400000036000fULL, },
+ { 0xffff01cd7fff0003ULL, 0x00160000003e0018ULL, },
+ { 0xffff00a839ce0000ULL, 0x001c00000014001eULL, },
+ { 0xfffe00c564570000ULL, 0x0003000000060017ULL, },
+ { 0xffff009e7fff0000ULL, 0x0004000000050008ULL, }, /* 96 */
+ { 0xffff007e7fff0000ULL, 0x0006000000040003ULL, },
+ { 0xffff00657fff0000ULL, 0x0009000000030001ULL, },
+ { 0xffff00517fff0000ULL, 0x000e000000020000ULL, },
+ { 0xffff00517fff0000ULL, 0x0010000000020000ULL, },
+ { 0xffff00517fff0000ULL, 0x0012000000020000ULL, },
+ { 0xffff00517fff0000ULL, 0x0014000000020000ULL, },
+ { 0xffff00517fff0000ULL, 0x0016000000020000ULL, },
+ { 0xffff001d39ce0000ULL, 0x001c000000000000ULL, }, /* 104 */
+ { 0xffff000a1a1b0000ULL, 0x0024000000000000ULL, },
+ { 0xffff00030bca0000ULL, 0x002f000000000000ULL, },
+ { 0xffff000105530000ULL, 0x003d000000000000ULL, },
+ { 0xfffe0001093d0000ULL, 0x0006000000000000ULL, },
+ { 0xfffc000110090000ULL, 0x0000000000000000ULL, },
+ { 0xfff800011bd50000ULL, 0x0000000000000000ULL, },
+ { 0xfff0000130500000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c
new file mode 100644
index 0000000000..529d60d1e9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MADD_Q.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MADD_Q.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xfffffffefffffffeULL, 0xfffffffdfffffffeULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, }, /* 8 */
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, }, /* 16 */
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0x38e38e3638e38e36ULL, 0x38e38e3638e38e36ULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0x2222221e2222221eULL, 0x2222221e2222221eULL, },
+ { 0xfffffffbfffffffbULL, 0xfffffffbfffffffbULL, },
+ { 0x12f684b94bda12f2ULL, 0xda12f68012f684b9ULL, },
+ { 0xfffffffbfffffffbULL, 0xfffffffbfffffffbULL, },
+ { 0xfffffffafffffffaULL, 0xfffffffafffffffaULL, }, /* 24 */
+ { 0xfffffffafffffffaULL, 0xfffffffafffffffaULL, },
+ { 0xc71c71c0c71c71c0ULL, 0xc71c71c0c71c71c0ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xddddddd5ddddddd5ULL, 0xddddddd5ddddddd5ULL, },
+ { 0xfffffff6fffffff6ULL, 0xfffffff6fffffff6ULL, },
+ { 0xed097b38b425ecffULL, 0x25ed0970ed097b38ULL, },
+ { 0xfffffff5fffffff4ULL, 0xfffffff4fffffff5ULL, },
+ { 0xfffffff5fffffff4ULL, 0xfffffff4fffffff5ULL, }, /* 32 */
+ { 0xfffffff5fffffff4ULL, 0xfffffff4fffffff5ULL, },
+ { 0x2222221722222216ULL, 0x2222221622222217ULL, },
+ { 0xfffffff4fffffff3ULL, 0xfffffff3fffffff4ULL, },
+ { 0x147ae13c147ae13bULL, 0x147ae13b147ae13cULL, },
+ { 0xfffffff4fffffff3ULL, 0xfffffff3fffffff4ULL, },
+ { 0x0b60b5ff2d82d821ULL, 0xe93e93dc0b60b5ffULL, },
+ { 0xfffffff3fffffff3ULL, 0xfffffff3fffffff3ULL, },
+ { 0xfffffff2fffffff2ULL, 0xfffffff2fffffff2ULL, }, /* 40 */
+ { 0xfffffff2fffffff2ULL, 0xfffffff2fffffff2ULL, },
+ { 0xddddddcfddddddcfULL, 0xddddddcfddddddcfULL, },
+ { 0xfffffff0fffffff0ULL, 0xfffffff0fffffff0ULL, },
+ { 0xeb851ea8eb851ea8ULL, 0xeb851ea8eb851ea8ULL, },
+ { 0xffffffefffffffefULL, 0xffffffefffffffefULL, },
+ { 0xf49f49e3d27d27c1ULL, 0x16c16c05f49f49e3ULL, },
+ { 0xffffffeeffffffeeULL, 0xffffffeeffffffeeULL, },
+ { 0xffffffeeffffffeeULL, 0xffffffedffffffeeULL, }, /* 48 */
+ { 0xffffffeeffffffeeULL, 0xffffffedffffffeeULL, },
+ { 0x12f684ac4bda12e5ULL, 0xda12f67212f684acULL, },
+ { 0xffffffeeffffffeeULL, 0xffffffecffffffeeULL, },
+ { 0x0b60b5f92d82d81cULL, 0xe93e93d50b60b5f9ULL, },
+ { 0xffffffedffffffeeULL, 0xffffffebffffffedULL, },
+ { 0x06522c2c6522c3e1ULL, 0x1948b0e706522c2cULL, },
+ { 0xffffffecffffffeeULL, 0xffffffeaffffffecULL, },
+ { 0xffffffebffffffedULL, 0xffffffeaffffffebULL, }, /* 56 */
+ { 0xffffffebffffffedULL, 0xffffffeaffffffebULL, },
+ { 0xed097b2db425ecf6ULL, 0x25ed0965ed097b2dULL, },
+ { 0xffffffeaffffffebULL, 0xffffffe9ffffffeaULL, },
+ { 0xf49f49ded27d27bdULL, 0x16c16c00f49f49deULL, },
+ { 0xffffffe9ffffffeaULL, 0xffffffe9ffffffe9ULL, },
+ { 0xf9add3a99add3bf7ULL, 0xe6b74eecf9add3a9ULL, },
+ { 0xffffffe8ffffffe8ULL, 0xffffffe8ffffffe8ULL, },
+ { 0x6fb7e8710cbdc0baULL, 0x2c6b142e000499ecULL, }, /* 64 */
+ { 0x73b239bf253787bbULL, 0x379780d7ffc424b2ULL, },
+ { 0x7fffffff0f12777aULL, 0x4f10996a00c57ee6ULL, },
+ { 0x1713a7162cca6b1fULL, 0x0be04dd301cca255ULL, },
+ { 0x1b0df86445443220ULL, 0x170cba7c018c2d1bULL, },
+ { 0x1b323a657448a831ULL, 0x19dc4690051313a9ULL, },
+ { 0x1dfa85ec49be7952ULL, 0x1fc3e11af6fe2ffbULL, },
+ { 0x1a3e24c87fffffffULL, 0x0edd19b6e8983fd8ULL, },
+ { 0x6863454e69daefbeULL, 0x26563249e9999a0cULL, }, /* 72 */
+ { 0x6b2b90d53f50c0dfULL, 0x2c3dccd3db84b65eULL, },
+ { 0x7fffffff65cdd2a2ULL, 0x38a5553713bd77aaULL, },
+ { 0x369baa383226e26fULL, 0x1523c32e4d39d083ULL, },
+ { 0xcdaf514f4fded614ULL, 0xd1f377974e40f3f2ULL, },
+ { 0xc9f2f02b7fffffffULL, 0xc10cb0333fdb03cfULL, },
+ { 0x808e9a644c590fccULL, 0x9d8b1e2a79575ca8ULL, },
+ { 0xe31932487fffffffULL, 0x032ce40b7fffffffULL, },
+ { 0xfe196fe57fffffffULL, 0x050bc0117e7bb00bULL, }, /* 80 */
+ { 0xfe299f467fffffffULL, 0x05cb2b207fffffffULL, },
+ { 0xff5d018239cf8b7fULL, 0x0798e21e2b2b2513ULL, },
+ { 0xfecdfe1e645a7d99ULL, 0x00d3dcf00dea608dULL, },
+ { 0xffebe0507fffffffULL, 0x0150aaf30dc02967ULL, },
+ { 0xffec8bad7fffffffULL, 0x01828e9310087db0ULL, },
+ { 0xfff9423b39cf8b7fULL, 0x01fae4ad056841b8ULL, },
+ { 0xfff35804645a7d99ULL, 0x003737ba01be3861ULL, },
+ { 0xffff2aee7fffffffULL, 0x0057bed401b8eeafULL, }, /* 88 */
+ { 0xffff32047fffffffULL, 0x0064bf7c02021ffbULL, },
+ { 0xffffb89f39cf8b7fULL, 0x00841c7300ad6409ULL, },
+ { 0xffff79fe645a7d99ULL, 0x000e642e0037e4a5ULL, },
+ { 0xfffff72f7fffffffULL, 0x0016de7600373b15ULL, },
+ { 0xfffff77a7fffffffULL, 0x001a420100406619ULL, },
+ { 0xfffffd0b39cf8b7fULL, 0x00226e950015b801ULL, },
+ { 0xfffffa72645a7d99ULL, 0x0003c03400070049ULL, },
+ { 0xffffffa27fffffffULL, 0x0005f5d70006eb0bULL, }, /* 96 */
+ { 0xfffffff97fffffffULL, 0x000978af0006d60eULL, },
+ { 0xffffffff7fffffffULL, 0x000f0d050006c150ULL, },
+ { 0xffffffff7fffffffULL, 0x0017eac30006acd1ULL, },
+ { 0xffffffff7fffffffULL, 0x001b76100007c878ULL, },
+ { 0xffffffff7fffffffULL, 0x001f87d000091335ULL, },
+ { 0xffffffff7fffffffULL, 0x002433ef000a94d9ULL, },
+ { 0xffffffff7fffffffULL, 0x0029914d000c5680ULL, },
+ { 0xffffffff39cf8b7fULL, 0x003681f800042937ULL, }, /* 104 */
+ { 0xffffffff1a1c28c3ULL, 0x004779e10001673fULL, },
+ { 0xffffffff0bcae025ULL, 0x005dba1000007928ULL, },
+ { 0xffffffff055376c1ULL, 0x007ae77c000028dcULL, },
+ { 0xfffffffe093ed554ULL, 0x000d636d00000d2bULL, },
+ { 0xfffffffc100c9463ULL, 0x0001755c0000043eULL, },
+ { 0xfffffff81bdc128cULL, 0x000028ab0000015eULL, },
+ { 0xfffffff0305c8babULL, 0x0000046e00000070ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADD_Q_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c
new file mode 100644
index 0000000000..a4713f2321
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MADDR_Q.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MADDR_Q.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 16 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x38e538e538e538e5ULL, 0x38e538e538e538e5ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x2224222422242224ULL, 0x2224222422242224ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x12f9da154bdd12f9ULL, 0xda154bdd12f9da15ULL, },
+ { 0x0003000300020003ULL, 0x0003000200030003ULL, },
+ { 0x0002000200010002ULL, 0x0002000100020002ULL, }, /* 24 */
+ { 0x0002000200010002ULL, 0x0002000100020002ULL, },
+ { 0xc71ec71ec71dc71eULL, 0xc71ec71dc71ec71eULL, },
+ { 0x0001000100000001ULL, 0x0001000000010001ULL, },
+ { 0xdddedddedddddddeULL, 0xdddedddddddedddeULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xed0925edb425ed09ULL, 0x25edb425ed0925edULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, /* 32 */
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x2222222322222222ULL, 0x2223222222222223ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x147b147c147b147bULL, 0x147c147b147b147cULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0x0b61e93f2d840b61ULL, 0xe93f2d840b61e93fULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, }, /* 40 */
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0xdddedddfdddedddeULL, 0xdddfdddedddedddfULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0xeb85eb86eb85eb85ULL, 0xeb86eb85eb85eb86ULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0xf49f16c2d27df49fULL, 0x16c2d27df49f16c2ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0xffff00000001ffffULL, 0x00000001ffff0000ULL, }, /* 48 */
+ { 0xffff00000001ffffULL, 0x00000001ffff0000ULL, },
+ { 0x12f6da134bdc12f6ULL, 0xda134bdc12f6da13ULL, },
+ { 0xffff00000002ffffULL, 0x00000002ffff0000ULL, },
+ { 0x0b60e93e2d860b60ULL, 0xe93e2d860b60e93eULL, },
+ { 0xffffffff0003ffffULL, 0xffff0003ffffffffULL, },
+ { 0x0651194765270651ULL, 0x1947652706511947ULL, },
+ { 0xfffffffe0004ffffULL, 0xfffe0004fffffffeULL, },
+ { 0xfffffffe0003ffffULL, 0xfffe0003fffffffeULL, }, /* 56 */
+ { 0xfffffffe0003ffffULL, 0xfffe0003fffffffeULL, },
+ { 0xed0925ecb428ed09ULL, 0x25ecb428ed0925ecULL, },
+ { 0xffffffff0002ffffULL, 0xffff0002ffffffffULL, },
+ { 0xf49e16c1d27ef49eULL, 0x16c1d27ef49e16c1ULL, },
+ { 0xfffeffff0001fffeULL, 0xffff0001fffeffffULL, },
+ { 0xf9ace6b69adef9acULL, 0xe6b69adef9ace6b6ULL, },
+ { 0xfffeffff0001fffeULL, 0xffff0001fffeffffULL, },
+ { 0x6fb804f50cbf38c5ULL, 0x2c6a0103000331f0ULL, }, /* 64 */
+ { 0x73b204e2253812d4ULL, 0x3796fae5ffc2fe1aULL, },
+ { 0x7fff14e60f13c53dULL, 0x4f0ff5d500c4e6f1ULL, },
+ { 0x171210822ccab176ULL, 0x0bdeeb4001ccf94aULL, },
+ { 0x1b0c106f45438b85ULL, 0x170ae522018bc574ULL, },
+ { 0x1b30106f7447a4e0ULL, 0x19d90a380512fb41ULL, },
+ { 0x1df8103049bdd8baULL, 0x1fc028e7f6fd134bULL, },
+ { 0x1a3c10417fffe5f1ULL, 0x0eda690ae8970040ULL, },
+ { 0x6862204569da985aULL, 0x265363fae999e917ULL, }, /* 72 */
+ { 0x6b2a20063f50cc34ULL, 0x2c3a7fffdb840121ULL, },
+ { 0x7fff53b565ce363dULL, 0x38a17fff13bd0bdfULL, },
+ { 0x369a458932275144ULL, 0x15207fff4d3a035dULL, },
+ { 0xcdad41254fde3d7dULL, 0xd1ef756a4e4215b6ULL, },
+ { 0xc9f141367fff4ab4ULL, 0xc1097fff3fdc02abULL, },
+ { 0x808c330a4c5865bbULL, 0x9d887fff7959fa29ULL, },
+ { 0xe31636ed7fff6c9fULL, 0x032b7fff7fff00e7ULL, },
+ { 0xfe192c1c7fff7fffULL, 0x05097fff7e7a0057ULL, }, /* 80 */
+ { 0xfe292c3e7fff4707ULL, 0x05c83b1a7fff008fULL, },
+ { 0xff5d102139cf0662ULL, 0x079520c82b2b00b8ULL, },
+ { 0xfece12f0645904e7ULL, 0x00d302440dea008eULL, },
+ { 0xffec0f357fff082bULL, 0x014f02780dc00035ULL, },
+ { 0xffed0f417fff0488ULL, 0x0181012410080057ULL, },
+ { 0xfff9059039cf0068ULL, 0x01f900a205680070ULL, },
+ { 0xfff3068864590050ULL, 0x0037000b01be0056ULL, },
+ { 0xffff053f7fff0085ULL, 0x0057000c01b90020ULL, }, /* 88 */
+ { 0xffff05437fff004aULL, 0x0064000602020035ULL, },
+ { 0x000001eb39cf0007ULL, 0x0083000300ad0044ULL, },
+ { 0x0000024164590005ULL, 0x000e000000380034ULL, },
+ { 0x000001cf7fff0008ULL, 0x0016000000370014ULL, },
+ { 0x000001d07fff0004ULL, 0x0019000000400021ULL, },
+ { 0x000000a939cf0000ULL, 0x002100000016002bULL, },
+ { 0x000000c664590000ULL, 0x0004000000070021ULL, },
+ { 0x0000009f7fff0000ULL, 0x000600000007000cULL, }, /* 96 */
+ { 0x000000807fff0000ULL, 0x000a000000070005ULL, },
+ { 0x000000677fff0000ULL, 0x0010000000070002ULL, },
+ { 0x000000537fff0000ULL, 0x0019000000070001ULL, },
+ { 0x000000537fff0000ULL, 0x001d000000080002ULL, },
+ { 0x000000537fff0000ULL, 0x0021000000090003ULL, },
+ { 0x000000537fff0000ULL, 0x00260000000a0005ULL, },
+ { 0x000000537fff0000ULL, 0x002c0000000c0008ULL, },
+ { 0x0000001e39cf0000ULL, 0x003a00000004000aULL, }, /* 104 */
+ { 0x0000000b1a1c0000ULL, 0x004c00000001000dULL, },
+ { 0x000000040bcb0000ULL, 0x0064000000000011ULL, },
+ { 0x0000000105530000ULL, 0x0083000000000016ULL, },
+ { 0x00000001093e0000ULL, 0x000e000000000011ULL, },
+ { 0x00000001100b0000ULL, 0x000200000000000dULL, },
+ { 0x000000011bd90000ULL, 0x000000000000000aULL, },
+ { 0x0000000130570000ULL, 0x0000000000000008ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c
new file mode 100644
index 0000000000..19eccbf5ba
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MADDR_Q.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MADDR_Q.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 16 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x38e38e3b38e38e3bULL, 0x38e38e3b38e38e3bULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x2222222522222225ULL, 0x2222222522222225ULL, },
+ { 0x0000000300000003ULL, 0x0000000300000003ULL, },
+ { 0x12f684c14bda12faULL, 0xda12f68812f684c1ULL, },
+ { 0x0000000400000003ULL, 0x0000000400000004ULL, },
+ { 0x0000000300000002ULL, 0x0000000300000003ULL, }, /* 24 */
+ { 0x0000000300000002ULL, 0x0000000300000003ULL, },
+ { 0xc71c71cac71c71c9ULL, 0xc71c71cac71c71caULL, },
+ { 0x0000000200000001ULL, 0x0000000200000002ULL, },
+ { 0xdddddddfdddddddeULL, 0xdddddddfdddddddfULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xed097b43b425ed0aULL, 0x25ed097ced097b43ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x2222222322222223ULL, 0x2222222422222223ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x147ae148147ae148ULL, 0x147ae149147ae148ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0b60b60c2d82d82eULL, 0xe93e93ea0b60b60cULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, }, /* 40 */
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xdddddddfdddddddeULL, 0xdddddddfdddddddfULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xeb851eb9eb851eb8ULL, 0xeb851eb9eb851eb9ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xf49f49f5d27d27d3ULL, 0x16c16c17f49f49f5ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x12f684be4bda12f8ULL, 0xda12f68512f684beULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0x0b60b60c2d82d830ULL, 0xe93e93e90b60b60cULL, },
+ { 0x0000000000000003ULL, 0xffffffff00000000ULL, },
+ { 0x06522c3f6522c3f7ULL, 0x1948b0fb06522c3fULL, },
+ { 0x0000000000000004ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000003ULL, 0xffffffff00000000ULL, }, /* 56 */
+ { 0x0000000000000003ULL, 0xffffffff00000000ULL, },
+ { 0xed097b43b425ed0cULL, 0x25ed097bed097b43ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0xf49f49f5d27d27d4ULL, 0x16c16c17f49f49f5ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0xf9add3c19add3c0eULL, 0xe6b74f04f9add3c1ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x6fb7e8890cbdc0d3ULL, 0x2c6b144700049a05ULL, }, /* 64 */
+ { 0x73b239d7253787d5ULL, 0x379780f0ffc424ccULL, },
+ { 0x7fffffff0f127795ULL, 0x4f10998300c57f01ULL, },
+ { 0x1713a7162cca6b3bULL, 0x0be04ded01cca270ULL, },
+ { 0x1b0df8644544323dULL, 0x170cba96018c2d37ULL, },
+ { 0x1b323a657448a84fULL, 0x19dc46aa051313c6ULL, },
+ { 0x1dfa85ed49be7970ULL, 0x1fc3e135f6fe3018ULL, },
+ { 0x1a3e24ca7fffffffULL, 0x0edd19d1e8983ff6ULL, },
+ { 0x6863455169daefbfULL, 0x26563264e9999a2bULL, }, /* 72 */
+ { 0x6b2b90d93f50c0e0ULL, 0x2c3dccefdb84b67dULL, },
+ { 0x7fffffff65cdd2a4ULL, 0x38a5555313bd77c9ULL, },
+ { 0x369baa393226e271ULL, 0x1523c34a4d39d0a3ULL, },
+ { 0xcdaf51504fded617ULL, 0xd1f377b44e40f412ULL, },
+ { 0xc9f2f02d7fffffffULL, 0xc10cb0503fdb03f0ULL, },
+ { 0x808e9a674c590fccULL, 0x9d8b1e4779575ccaULL, },
+ { 0xe319324b7fffffffULL, 0x032ce4297fffffffULL, },
+ { 0xfe196fe67fffffffULL, 0x050bc0417e7bb00bULL, }, /* 80 */
+ { 0xfe299f487fffffffULL, 0x05cb2b577fffffffULL, },
+ { 0xff5d018339cf8b80ULL, 0x0798e2662b2b2514ULL, },
+ { 0xfecdfe20645a7d9bULL, 0x00d3dcf80dea608eULL, },
+ { 0xffebe0517fffffffULL, 0x0150ab000dc02968ULL, },
+ { 0xffec8baf7fffffffULL, 0x01828ea210087db2ULL, },
+ { 0xfff9423c39cf8b80ULL, 0x01fae4c1056841b9ULL, },
+ { 0xfff35806645a7d9bULL, 0x003737bc01be3862ULL, },
+ { 0xffff2aee7fffffffULL, 0x0057bed801b8eeb0ULL, }, /* 88 */
+ { 0xffff32047fffffffULL, 0x0064bf8102021ffcULL, },
+ { 0xffffb89f39cf8b80ULL, 0x00841c7a00ad640aULL, },
+ { 0xffff79fe645a7d9bULL, 0x000e642f0037e4a6ULL, },
+ { 0xfffff7307fffffffULL, 0x0016de7800373b16ULL, },
+ { 0xfffff77b7fffffffULL, 0x001a42040040661aULL, },
+ { 0xfffffd0c39cf8b80ULL, 0x00226e990015b802ULL, },
+ { 0xfffffa75645a7d9bULL, 0x0003c0350007004aULL, },
+ { 0xffffffa37fffffffULL, 0x0005f5d90006eb0dULL, }, /* 96 */
+ { 0xfffffffa7fffffffULL, 0x000978b30006d610ULL, },
+ { 0x000000007fffffffULL, 0x000f0d0c0006c153ULL, },
+ { 0x000000007fffffffULL, 0x0017eacf0006acd5ULL, },
+ { 0x000000007fffffffULL, 0x001b761e0007c87dULL, },
+ { 0x000000007fffffffULL, 0x001f87e00009133bULL, },
+ { 0x000000007fffffffULL, 0x00243402000a94e0ULL, },
+ { 0x000000007fffffffULL, 0x00299164000c5689ULL, },
+ { 0x0000000039cf8b80ULL, 0x003682160004293bULL, }, /* 104 */
+ { 0x000000001a1c28c4ULL, 0x00477a0900016741ULL, },
+ { 0x000000000bcae026ULL, 0x005dba4500007929ULL, },
+ { 0x00000000055376c2ULL, 0x007ae7c2000028ddULL, },
+ { 0x00000000093ed557ULL, 0x000d637500000d2cULL, },
+ { 0x00000000100c9469ULL, 0x0001755d0000043fULL, },
+ { 0x000000001bdc1297ULL, 0x000028ac0000015eULL, },
+ { 0x00000000305c8bbfULL, 0x0000046e00000071ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c
new file mode 100644
index 0000000000..b584736ed1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MSUB_Q.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MSUB_Q.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xfffcfffdfffcfffcULL, 0xfffdfffcfffcfffdULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, }, /* 8 */
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffbfffbfffbfffbULL, 0xfffbfffbfffbfffbULL, }, /* 16 */
+ { 0xfffbfffbfffbfffbULL, 0xfffbfffbfffbfffbULL, },
+ { 0xc716c716c716c716ULL, 0xc716c716c716c716ULL, },
+ { 0xfff9fff9fff9fff9ULL, 0xfff9fff9fff9fff9ULL, },
+ { 0xddd6ddd6ddd6ddd6ULL, 0xddd6ddd6ddd6ddd6ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xed0125e4b41ced01ULL, 0x25e4b41ced0125e4ULL, },
+ { 0xfff7fff6fff6fff7ULL, 0xfff6fff6fff7fff6ULL, },
+ { 0xfff7fff6fff6fff7ULL, 0xfff6fff6fff7fff6ULL, }, /* 24 */
+ { 0xfff7fff6fff6fff7ULL, 0xfff6fff6fff7fff6ULL, },
+ { 0x38da38d938d938daULL, 0x38d938d938da38d9ULL, },
+ { 0xfff6fff5fff5fff6ULL, 0xfff5fff5fff6fff5ULL, },
+ { 0x2218221722172218ULL, 0x2217221722182217ULL, },
+ { 0xfff6fff5fff5fff6ULL, 0xfff5fff5fff6fff5ULL, },
+ { 0x12ecda084bcf12ecULL, 0xda084bcf12ecda08ULL, },
+ { 0xfff6fff5fff5fff6ULL, 0xfff5fff5fff6fff5ULL, },
+ { 0xfff5fff4fff4fff5ULL, 0xfff4fff4fff5fff4ULL, }, /* 32 */
+ { 0xfff5fff4fff4fff5ULL, 0xfff4fff4fff5fff4ULL, },
+ { 0xddd2ddd1ddd1ddd2ULL, 0xddd1ddd1ddd2ddd1ULL, },
+ { 0xfff4fff3fff3fff4ULL, 0xfff3fff3fff4fff3ULL, },
+ { 0xeb78eb77eb77eb78ULL, 0xeb77eb77eb78eb77ULL, },
+ { 0xfff3fff2fff2fff3ULL, 0xfff2fff2fff3fff2ULL, },
+ { 0xf49216b3d26ef492ULL, 0x16b3d26ef49216b3ULL, },
+ { 0xfff2fff1fff1fff2ULL, 0xfff1fff1fff2fff1ULL, },
+ { 0xfff2fff1fff1fff2ULL, 0xfff1fff1fff2fff1ULL, }, /* 40 */
+ { 0xfff2fff1fff1fff2ULL, 0xfff1fff1fff2fff1ULL, },
+ { 0x2214221322132214ULL, 0x2213221322142213ULL, },
+ { 0xfff2fff1fff1fff2ULL, 0xfff1fff1fff2fff1ULL, },
+ { 0x146d146c146c146dULL, 0x146c146c146d146cULL, },
+ { 0xfff2fff1fff1fff2ULL, 0xfff1fff1fff2fff1ULL, },
+ { 0x0b52e92f2d740b52ULL, 0xe92f2d740b52e92fULL, },
+ { 0xfff1fff0fff1fff1ULL, 0xfff0fff1fff1fff0ULL, },
+ { 0xfff0fff0fff0fff0ULL, 0xfff0fff0fff0fff0ULL, }, /* 48 */
+ { 0xfff0fff0fff0fff0ULL, 0xfff0fff0fff0fff0ULL, },
+ { 0xecf925dcb414ecf9ULL, 0x25dcb414ecf925dcULL, },
+ { 0xffefffefffeeffefULL, 0xffefffeeffefffefULL, },
+ { 0xf48e16b0d26af48eULL, 0x16b0d26af48e16b0ULL, },
+ { 0xffeeffeeffedffeeULL, 0xffeeffedffeeffeeULL, },
+ { 0xf99be6a59ac8f99bULL, 0xe6a59ac8f99be6a5ULL, },
+ { 0xffedffedffebffedULL, 0xffedffebffedffedULL, },
+ { 0xffedffecffebffedULL, 0xffecffebffedffecULL, }, /* 56 */
+ { 0xffedffecffebffedULL, 0xffecffebffedffecULL, },
+ { 0x12e3d9fe4bc512e3ULL, 0xd9fe4bc512e3d9feULL, },
+ { 0xffedffebffebffedULL, 0xffebffebffedffebULL, },
+ { 0x0b4de9292d6e0b4dULL, 0xe9292d6e0b4de929ULL, },
+ { 0xffecffeaffebffecULL, 0xffeaffebffecffeaULL, },
+ { 0x063e1932650e063eULL, 0x1932650e063e1932ULL, },
+ { 0xffecffe8ffebffecULL, 0xffe8ffebffecffe8ULL, },
+ { 0x9032faf1f32dc724ULL, 0xd37cfee8ffe7cdf6ULL, }, /* 64 */
+ { 0x8c37fb04dab3ed15ULL, 0xc8500506002701cbULL, },
+ { 0x8000eb00f0d83aacULL, 0xb0d70a15ff2518f4ULL, },
+ { 0xe8edef64d3204e73ULL, 0xf40714a9fe1d069aULL, },
+ { 0xe4f2ef77baa67464ULL, 0xe8db1ac7fe5d3a6fULL, },
+ { 0xe4cdef768ba25b09ULL, 0xe60bf5b1fad604a2ULL, },
+ { 0xe204efb4b62c272fULL, 0xe023d70208eaec98ULL, },
+ { 0xe5c0efa2800019f7ULL, 0xf10996de174fffa3ULL, },
+ { 0x9799df9e9625678eULL, 0xd9909bed164d16ccULL, }, /* 72 */
+ { 0x94d0dfdcc0af33b4ULL, 0xd3a880002461fec2ULL, },
+ { 0x8000ac2c9a31c9abULL, 0xc7408000ec28f404ULL, },
+ { 0xc964ba57cdd7aea3ULL, 0xeac18000b2aafc86ULL, },
+ { 0x3251bebbb01fc26aULL, 0x2df18a94b1a2ea2cULL, },
+ { 0x360dbea98000b532ULL, 0x3ed78000c007fd37ULL, },
+ { 0x7f71ccd4b3a69a2aULL, 0x62588000868905b9ULL, },
+ { 0x1ce6c8f180009346ULL, 0xfcb580008000fefbULL, },
+ { 0x37e5be19a862dbafULL, 0xfea58b5e8000fe57ULL, }, /* 80 */
+ { 0x39c0be4bdd7bcb85ULL, 0xfed88000953fff6aULL, },
+ { 0x5f7d948aca8d9bc1ULL, 0xff3480008000ff95ULL, },
+ { 0x0bb4a742f1e1847fULL, 0xfe7e80008000ff7cULL, },
+ { 0x16a395c8f655d6c0ULL, 0xff618b5e8000ff29ULL, },
+ { 0x1763961afc30c464ULL, 0xff788000953fffb4ULL, },
+ { 0x26ab8000fa188e23ULL, 0xffa280008000ffcaULL, },
+ { 0x04bd964dfe708000ULL, 0xff4e80008000ffbdULL, },
+ { 0x092a817dfeeed540ULL, 0xffb68b5e8000ff93ULL, }, /* 88 */
+ { 0x097881deff94c239ULL, 0xffc08000953fffd9ULL, },
+ { 0x0fa88000ff5889feULL, 0xffd380008000ffe4ULL, },
+ { 0x01eb964dffd38000ULL, 0xffaa80008000ffddULL, },
+ { 0x03b5817dffe1d540ULL, 0xffdc8b5e8000ffc7ULL, },
+ { 0x03d481defff3c239ULL, 0xffe18000953fffebULL, },
+ { 0x06548000ffeb89feULL, 0xffea80008000fff1ULL, },
+ { 0x00c6964dfffa8000ULL, 0xffd680008000ffedULL, },
+ { 0x017e817dfffbd540ULL, 0xffee8b5e8000ffe1ULL, }, /* 96 */
+ { 0x02e28000fffcf1b8ULL, 0xfff895b98000ffcdULL, },
+ { 0x05938000fffdfb3aULL, 0xfffc9f298000ffadULL, },
+ { 0x0ac88000fffdfe67ULL, 0xfffea7c28000ff79ULL, },
+ { 0x0b238063fffefdb0ULL, 0xfffe8000953fffd0ULL, },
+ { 0x0b8180c5fffffca8ULL, 0xfffe8000a6f7ffefULL, },
+ { 0x0be28127fffffb2bULL, 0xfffe8000b5befffaULL, },
+ { 0x0c478189fffff904ULL, 0xfffe8000c211fffdULL, },
+ { 0x144c8000fffef2a8ULL, 0xfffe80009905fffdULL, }, /* 104 */
+ { 0x218f8000fffce682ULL, 0xfffe80008000fffdULL, },
+ { 0x377d8000fff9cf4eULL, 0xfffe80008000fffdULL, },
+ { 0x5bc08000fff5a2fbULL, 0xfffe80008000fffdULL, },
+ { 0x0b3f964dfffd8d66ULL, 0xfffc80008000fffcULL, },
+ { 0x0160a8b7ffff8000ULL, 0xfff880008000fffbULL, },
+ { 0x002bb7ecffff8000ULL, 0xfff080008000fff9ULL, },
+ { 0x0005c47affff8000ULL, 0xffe180008000fff7ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c
new file mode 100644
index 0000000000..56191924a1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MSUB_Q.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MSUB_Q.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffdfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, }, /* 8 */
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffbfffffffbULL, 0xfffffffbfffffffbULL, }, /* 16 */
+ { 0xfffffffbfffffffbULL, 0xfffffffbfffffffbULL, },
+ { 0xc71c71c1c71c71c1ULL, 0xc71c71c1c71c71c1ULL, },
+ { 0xfffffffafffffffaULL, 0xfffffffafffffffaULL, },
+ { 0xddddddd7ddddddd7ULL, 0xddddddd7ddddddd7ULL, },
+ { 0xfffffff9fffffff9ULL, 0xfffffff9fffffff9ULL, },
+ { 0xed097b3ab425ed01ULL, 0x25ed0973ed097b3aULL, },
+ { 0xfffffff7fffffff7ULL, 0xfffffff7fffffff7ULL, },
+ { 0xfffffff7fffffff7ULL, 0xfffffff7fffffff7ULL, }, /* 24 */
+ { 0xfffffff7fffffff7ULL, 0xfffffff7fffffff7ULL, },
+ { 0x38e38e3038e38e30ULL, 0x38e38e3038e38e30ULL, },
+ { 0xfffffff7fffffff7ULL, 0xfffffff7fffffff7ULL, },
+ { 0x2222221922222219ULL, 0x2222221922222219ULL, },
+ { 0xfffffff7fffffff7ULL, 0xfffffff7fffffff7ULL, },
+ { 0x12f684b44bda12edULL, 0xda12f67c12f684b4ULL, },
+ { 0xfffffff6fffffff7ULL, 0xfffffff7fffffff6ULL, },
+ { 0xfffffff5fffffff6ULL, 0xfffffff6fffffff5ULL, }, /* 32 */
+ { 0xfffffff5fffffff6ULL, 0xfffffff6fffffff5ULL, },
+ { 0xddddddd2ddddddd3ULL, 0xddddddd3ddddddd2ULL, },
+ { 0xfffffff4fffffff5ULL, 0xfffffff5fffffff4ULL, },
+ { 0xeb851eabeb851eacULL, 0xeb851eaceb851eabULL, },
+ { 0xfffffff2fffffff3ULL, 0xfffffff3fffffff2ULL, },
+ { 0xf49f49e6d27d27c4ULL, 0x16c16c09f49f49e6ULL, },
+ { 0xfffffff1fffffff1ULL, 0xfffffff1fffffff1ULL, },
+ { 0xfffffff1fffffff1ULL, 0xfffffff1fffffff1ULL, }, /* 40 */
+ { 0xfffffff1fffffff1ULL, 0xfffffff1fffffff1ULL, },
+ { 0x2222221322222213ULL, 0x2222221322222213ULL, },
+ { 0xfffffff1fffffff1ULL, 0xfffffff1fffffff1ULL, },
+ { 0x147ae138147ae138ULL, 0x147ae138147ae138ULL, },
+ { 0xfffffff0fffffff0ULL, 0xfffffff0fffffff0ULL, },
+ { 0x0b60b5fb2d82d81dULL, 0xe93e93d90b60b5fbULL, },
+ { 0xffffffefffffffefULL, 0xffffffefffffffefULL, },
+ { 0xffffffeeffffffeeULL, 0xffffffefffffffeeULL, }, /* 48 */
+ { 0xffffffeeffffffeeULL, 0xffffffefffffffeeULL, },
+ { 0xed097b2fb425ecf6ULL, 0x25ed0969ed097b2fULL, },
+ { 0xffffffecffffffecULL, 0xffffffeeffffffecULL, },
+ { 0xf49f49e0d27d27bdULL, 0x16c16c04f49f49e0ULL, },
+ { 0xffffffebffffffeaULL, 0xffffffedffffffebULL, },
+ { 0xf9add3ab9add3bf6ULL, 0xe6b74ef0f9add3abULL, },
+ { 0xffffffeaffffffe8ULL, 0xffffffecffffffeaULL, },
+ { 0xffffffeaffffffe8ULL, 0xffffffebffffffeaULL, }, /* 56 */
+ { 0xffffffeaffffffe8ULL, 0xffffffebffffffeaULL, },
+ { 0x12f684a74bda12deULL, 0xda12f66f12f684a7ULL, },
+ { 0xffffffe9ffffffe8ULL, 0xffffffeaffffffe9ULL, },
+ { 0x0b60b5f42d82d815ULL, 0xe93e93d20b60b5f4ULL, },
+ { 0xffffffe8ffffffe7ULL, 0xffffffe8ffffffe8ULL, },
+ { 0x06522c276522c3d9ULL, 0x1948b0e406522c27ULL, },
+ { 0xffffffe7ffffffe7ULL, 0xffffffe7ffffffe7ULL, },
+ { 0x9048175df3423f14ULL, 0xd394eba0fffb65e2ULL, }, /* 64 */
+ { 0x8c4dc60edac87812ULL, 0xc8687ef6003bdb1bULL, },
+ { 0x80000000f0ed8852ULL, 0xb0ef6662ff3a80e6ULL, },
+ { 0xe8ec58e8d33594acULL, 0xf41fb1f8fe335d76ULL, },
+ { 0xe4f20799babbcdaaULL, 0xe8f3454efe73d2afULL, },
+ { 0xe4cdc5978bb75798ULL, 0xe623b939faecec20ULL, },
+ { 0xe2057a0fb6418676ULL, 0xe03c1eae0901cfcdULL, },
+ { 0xe5c1db3280000000ULL, 0xf122e6111767bfefULL, },
+ { 0x979cbaab96251040ULL, 0xd9a9cd7d166665baULL, }, /* 72 */
+ { 0x94d46f23c0af3f1eULL, 0xd3c232f2247b4967ULL, },
+ { 0x800000009a322d5aULL, 0xc75aaa8dec42881aULL, },
+ { 0xc96455c6cdd91d8cULL, 0xeadc3c95b2c62f40ULL, },
+ { 0x3250aeaeb02129e6ULL, 0x2e0c882bb1bf0bd0ULL, },
+ { 0x360d0fd180000000ULL, 0x3ef34f8ec024fbf2ULL, },
+ { 0x7f716597b3a6f032ULL, 0x6274e19686a8a318ULL, },
+ { 0x1ce6cdb280000000ULL, 0xfcd31bb480000000ULL, },
+ { 0x37e70b49a8625540ULL, 0xfeb1f7e080000000ULL, }, /* 80 */
+ { 0x39c31699dd7c5546ULL, 0xfee37780953f52fcULL, },
+ { 0x5f82316fca8f431eULL, 0xff3c0af780000000ULL, },
+ { 0x0bb5432ff1e2e177ULL, 0xfe8d6e9580000000ULL, },
+ { 0x16a56af3f656d2b3ULL, 0xff67ba1b80000000ULL, },
+ { 0x17664384fc31bf42ULL, 0xff7e4aa4953f52fcULL, },
+ { 0x26b0cbfdfa1b830bULL, 0xffa6ab9180000000ULL, },
+ { 0x04be31a4fe719ab1ULL, 0xff57124580000000ULL, },
+ { 0x092c8a1ffeef4c68ULL, 0xffba958e80000000ULL, }, /* 88 */
+ { 0x097aa960ff949347ULL, 0xffc4dede953f52fcULL, },
+ { 0x0fac7158ff59ab27ULL, 0xffd7471a80000000ULL, },
+ { 0x01ebdf01ffd41248ULL, 0xffb2fdd380000000ULL, },
+ { 0x03b76546ffe1ee50ULL, 0xffe05b1780000000ULL, },
+ { 0x03d70afdfff427aaULL, 0xffe50b86953f52fcULL, },
+ { 0x065971c1ffeda8dfULL, 0xffed6fa980000000ULL, },
+ { 0x00c741e8fffb2801ULL, 0xffdce50280000000ULL, },
+ { 0x01816947fffcaf39ULL, 0xfff1931580000000ULL, }, /* 96 */
+ { 0x02e97a17fffdbb03ULL, 0xfffa128380000000ULL, },
+ { 0x05a1edf3fffe7250ULL, 0xfffd906f80000000ULL, },
+ { 0x0ae508c5fffeefc8ULL, 0xfffeffc380000000ULL, },
+ { 0x0b41cf1bffff94c3ULL, 0xffff25bb953f52fcULL, },
+ { 0x0ba1ab79ffffd5c1ULL, 0xffff4613a6f7bf69ULL, },
+ { 0x0c04b828ffffef5bULL, 0xffff61a0b5bf25caULL, },
+ { 0x0c6b104efffff971ULL, 0xffff7918c21285a5ULL, },
+ { 0x148886c7fffff5d8ULL, 0xffffa3179907b21bULL, }, /* 104 */
+ { 0x21f39335fffff046ULL, 0xffffc00380000000ULL, },
+ { 0x38235e38ffffe7a6ULL, 0xffffd3ee80000000ULL, },
+ { 0x5cd2ce93ffffda4bULL, 0xffffe1a680000000ULL, },
+ { 0x0b60ff8afffff60aULL, 0xffffc69a80000000ULL, },
+ { 0x01651818fffffd5eULL, 0xffff937480000000ULL, },
+ { 0x002bc65fffffff4dULL, 0xffff32bb80000000ULL, },
+ { 0x00055dbfffffffd0ULL, 0xfffe7bd280000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUB_Q_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c
new file mode 100644
index 0000000000..0be6d51418
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MSUBR_Q.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MSUBR_Q.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xc71bc71bc71bc71bULL, 0xc71bc71bc71bc71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xdddcdddcdddcdddcULL, 0xdddcdddcdddcdddcULL, },
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xed0725ebb423ed07ULL, 0x25ebb423ed0725ebULL, },
+ { 0xfffdfffdfffefffdULL, 0xfffdfffefffdfffdULL, },
+ { 0xfffefffefffffffeULL, 0xfffefffffffefffeULL, }, /* 24 */
+ { 0xfffefffefffffffeULL, 0xfffefffffffefffeULL, },
+ { 0x38e238e238e338e2ULL, 0x38e238e338e238e2ULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0x2222222222232222ULL, 0x2222222322222222ULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, },
+ { 0x12f7da134bdb12f7ULL, 0xda134bdb12f7da13ULL, },
+ { 0x0001000000010001ULL, 0x0000000100010000ULL, },
+ { 0x0001000000010001ULL, 0x0000000100010000ULL, }, /* 32 */
+ { 0x0001000000010001ULL, 0x0000000100010000ULL, },
+ { 0xdddedddddddedddeULL, 0xdddddddedddeddddULL, },
+ { 0x0001000000010001ULL, 0x0000000100010000ULL, },
+ { 0xeb85eb84eb85eb85ULL, 0xeb84eb85eb85eb84ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, /* 40 */
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x2222222122222222ULL, 0x2221222222222221ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x147b147a147b147bULL, 0x147a147b147b147aULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0b61e93e2d830b61ULL, 0xe93e2d830b61e93eULL, },
+ { 0x0001000000000001ULL, 0x0000000000010000ULL, },
+ { 0x00010000ffff0001ULL, 0x0000ffff00010000ULL, }, /* 48 */
+ { 0x00010000ffff0001ULL, 0x0000ffff00010000ULL, },
+ { 0xed0a25edb424ed0aULL, 0x25edb424ed0a25edULL, },
+ { 0x00010000fffe0001ULL, 0x0000fffe00010000ULL, },
+ { 0xf4a016c2d27af4a0ULL, 0x16c2d27af4a016c2ULL, },
+ { 0x00010001fffd0001ULL, 0x0001fffd00010001ULL, },
+ { 0xf9afe6b99ad9f9afULL, 0xe6b99ad9f9afe6b9ULL, },
+ { 0x00010002fffc0001ULL, 0x0002fffc00010002ULL, },
+ { 0x00010002fffd0001ULL, 0x0002fffd00010002ULL, }, /* 56 */
+ { 0x00010002fffd0001ULL, 0x0002fffd00010002ULL, },
+ { 0x12f7da144bd812f7ULL, 0xda144bd812f7da14ULL, },
+ { 0x00010001fffe0001ULL, 0x0001fffe00010001ULL, },
+ { 0x0b62e93f2d820b62ULL, 0xe93f2d820b62e93fULL, },
+ { 0x00020001ffff0002ULL, 0x0001ffff00020001ULL, },
+ { 0x0654194a65220654ULL, 0x194a65220654194aULL, },
+ { 0x00020001ffff0002ULL, 0x0001ffff00020001ULL, },
+ { 0x9048fb0bf341c73bULL, 0xd396fefdfffdce10ULL, }, /* 64 */
+ { 0x8c4efb1edac8ed2cULL, 0xc86a051b003e01e6ULL, },
+ { 0x8000eb1af0ed3ac3ULL, 0xb0f10a2bff3c190fULL, },
+ { 0xe8edef7ed3364e8aULL, 0xf42214c0fe3406b6ULL, },
+ { 0xe4f3ef91babd747bULL, 0xe8f61adefe753a8cULL, },
+ { 0xe4cfef918bb95b20ULL, 0xe627f5c8faee04bfULL, },
+ { 0xe207efd0b6432746ULL, 0xe040d7190903ecb5ULL, },
+ { 0xe5c3efbf80001a0fULL, 0xf12696f61769ffc0ULL, },
+ { 0x979ddfbb962567a6ULL, 0xd9ad9c06166716e9ULL, }, /* 72 */
+ { 0x94d5dffac0af33ccULL, 0xd3c68000247cfedfULL, },
+ { 0x8000ac4b9a31c9c4ULL, 0xc75f8000ec43f421ULL, },
+ { 0xc965ba77cdd8aebdULL, 0xeae08000b2c6fca3ULL, },
+ { 0x3252bedbb021c284ULL, 0x2e118a95b1beea4aULL, },
+ { 0x360ebeca8000b54dULL, 0x3ef78000c024fd55ULL, },
+ { 0x7f73ccf6b3a79a46ULL, 0x6278800086a705d7ULL, },
+ { 0x1ce9c91380009362ULL, 0xfcd580008000ff19ULL, },
+ { 0x37ebbe42a862dbb9ULL, 0xfeb38b5e8000fe89ULL, }, /* 80 */
+ { 0x39c7be75dd7ccb94ULL, 0xfee48000953fff7cULL, },
+ { 0x5f8994cfca8f9bdeULL, 0xff3c80008000ffa2ULL, },
+ { 0x0bb6a77cf1e284a3ULL, 0xfe8d80008000ff8cULL, },
+ { 0x16a7960ef656d6ccULL, 0xff688b5e8000ff44ULL, },
+ { 0x17689660fc31c475ULL, 0xff7f8000953fffbeULL, },
+ { 0x26b48000fa1a8e43ULL, 0xffa780008000ffd1ULL, },
+ { 0x04bf964dfe718000ULL, 0xff5880008000ffc6ULL, },
+ { 0x092e817dfeefd540ULL, 0xffbb8b5e8000ffa2ULL, }, /* 88 */
+ { 0x097c81dfff94c239ULL, 0xffc58000953fffdfULL, },
+ { 0x0faf8000ff5989ffULL, 0xffd780008000ffe9ULL, },
+ { 0x01ec964dffd48000ULL, 0xffb280008000ffe4ULL, },
+ { 0x03b8817dffe2d540ULL, 0xffe08b5e8000ffd3ULL, },
+ { 0x03d881dffff4c239ULL, 0xffe58000953ffff0ULL, },
+ { 0x065b8000ffed89ffULL, 0xffed80008000fff5ULL, },
+ { 0x00c7964dfffb8000ULL, 0xffdc80008000fff2ULL, },
+ { 0x0181817dfffdd540ULL, 0xfff18b5e8000ffe9ULL, }, /* 96 */
+ { 0x02e98000fffef1b9ULL, 0xfffa95ba8000ffdbULL, },
+ { 0x05a18000fffffb3bULL, 0xfffe9f2a8000ffc4ULL, },
+ { 0x0ae38000fffffe68ULL, 0xffffa7c48000ff9fULL, },
+ { 0x0b4080630000fdb2ULL, 0xffff8000953fffdeULL, },
+ { 0x0ba080c60000fcabULL, 0xffff8000a6f7fff4ULL, },
+ { 0x0c0381280000fb2fULL, 0xffff8000b5befffcULL, },
+ { 0x0c69818a0000f90aULL, 0xffff8000c211ffffULL, },
+ { 0x148580000000f2b4ULL, 0xffff80009905ffffULL, }, /* 104 */
+ { 0x21ee80000000e69aULL, 0xffff80008000ffffULL, },
+ { 0x381a80000000cf7cULL, 0xffff80008000ffffULL, },
+ { 0x5cc480000000a354ULL, 0xffff80008000ffffULL, },
+ { 0x0b5f964d00008dd4ULL, 0xfffe80008000ffffULL, },
+ { 0x0165a8b700008000ULL, 0xfffc80008000ffffULL, },
+ { 0x002cb7ec00008000ULL, 0xfff880008000ffffULL, },
+ { 0x0005c47b00008000ULL, 0xfff180008000ffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBR_Q_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBR_Q_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBR_Q_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBR_Q_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c
new file mode 100644
index 0000000000..7d57cb500a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c
@@ -0,0 +1,216 @@
+/*
+ * Test program for MSA instruction MSUBR_Q.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MSUBR_Q.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 16 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x38e38e3b38e38e3bULL, 0x38e38e3b38e38e3bULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x2222222522222225ULL, 0x2222222522222225ULL, },
+ { 0x0000000300000003ULL, 0x0000000300000003ULL, },
+ { 0x12f684c14bda12faULL, 0xda12f68812f684c1ULL, },
+ { 0x0000000400000003ULL, 0x0000000400000004ULL, },
+ { 0x0000000300000002ULL, 0x0000000300000003ULL, }, /* 24 */
+ { 0x0000000300000002ULL, 0x0000000300000003ULL, },
+ { 0xc71c71cac71c71c9ULL, 0xc71c71cac71c71caULL, },
+ { 0x0000000200000001ULL, 0x0000000200000002ULL, },
+ { 0xdddddddfdddddddeULL, 0xdddddddfdddddddfULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xed097b43b425ed0aULL, 0x25ed097ced097b43ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x2222222322222223ULL, 0x2222222422222223ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x147ae148147ae148ULL, 0x147ae149147ae148ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0b60b60c2d82d82eULL, 0xe93e93ea0b60b60cULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, }, /* 40 */
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xdddddddfdddddddeULL, 0xdddddddfdddddddfULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xeb851eb9eb851eb8ULL, 0xeb851eb9eb851eb9ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000001ULL, },
+ { 0xf49f49f5d27d27d3ULL, 0x16c16c17f49f49f5ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x12f684be4bda12f8ULL, 0xda12f68512f684beULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0x0b60b60c2d82d830ULL, 0xe93e93e90b60b60cULL, },
+ { 0x0000000000000003ULL, 0xffffffff00000000ULL, },
+ { 0x06522c3f6522c3f7ULL, 0x1948b0fb06522c3fULL, },
+ { 0x0000000000000004ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000003ULL, 0xffffffff00000000ULL, }, /* 56 */
+ { 0x0000000000000003ULL, 0xffffffff00000000ULL, },
+ { 0xed097b43b425ed0cULL, 0x25ed097bed097b43ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0xf49f49f5d27d27d4ULL, 0x16c16c17f49f49f5ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0xf9add3c19add3c0eULL, 0xe6b74f04f9add3c1ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x6fb7e8890cbdc0d3ULL, 0x2c6b144700049a05ULL, }, /* 64 */
+ { 0x73b239d7253787d5ULL, 0x379780f0ffc424ccULL, },
+ { 0x7fffffff0f127795ULL, 0x4f10998300c57f01ULL, },
+ { 0x1713a7162cca6b3bULL, 0x0be04ded01cca270ULL, },
+ { 0x1b0df8644544323dULL, 0x170cba96018c2d37ULL, },
+ { 0x1b323a657448a84fULL, 0x19dc46aa051313c6ULL, },
+ { 0x1dfa85ed49be7970ULL, 0x1fc3e135f6fe3018ULL, },
+ { 0x1a3e24ca7fffffffULL, 0x0edd19d1e8983ff6ULL, },
+ { 0x6863455169daefbfULL, 0x26563264e9999a2bULL, }, /* 72 */
+ { 0x6b2b90d93f50c0e0ULL, 0x2c3dccefdb84b67dULL, },
+ { 0x7fffffff65cdd2a4ULL, 0x38a5555313bd77c9ULL, },
+ { 0x369baa393226e271ULL, 0x1523c34a4d39d0a3ULL, },
+ { 0xcdaf51504fded617ULL, 0xd1f377b44e40f412ULL, },
+ { 0xc9f2f02d7fffffffULL, 0xc10cb0503fdb03f0ULL, },
+ { 0x808e9a674c590fccULL, 0x9d8b1e4779575ccaULL, },
+ { 0xe319324b7fffffffULL, 0x032ce4297fffffffULL, },
+ { 0xfe196fe67fffffffULL, 0x050bc0417e7bb00bULL, }, /* 80 */
+ { 0xfe299f487fffffffULL, 0x05cb2b577fffffffULL, },
+ { 0xff5d018339cf8b80ULL, 0x0798e2662b2b2514ULL, },
+ { 0xfecdfe20645a7d9bULL, 0x00d3dcf80dea608eULL, },
+ { 0xffebe0517fffffffULL, 0x0150ab000dc02968ULL, },
+ { 0xffec8baf7fffffffULL, 0x01828ea210087db2ULL, },
+ { 0xfff9423c39cf8b80ULL, 0x01fae4c1056841b9ULL, },
+ { 0xfff35806645a7d9bULL, 0x003737bc01be3862ULL, },
+ { 0xffff2aee7fffffffULL, 0x0057bed801b8eeb0ULL, }, /* 88 */
+ { 0xffff32047fffffffULL, 0x0064bf8102021ffcULL, },
+ { 0xffffb89f39cf8b80ULL, 0x00841c7a00ad640aULL, },
+ { 0xffff79fe645a7d9bULL, 0x000e642f0037e4a6ULL, },
+ { 0xfffff7307fffffffULL, 0x0016de7800373b16ULL, },
+ { 0xfffff77b7fffffffULL, 0x001a42040040661aULL, },
+ { 0xfffffd0c39cf8b80ULL, 0x00226e990015b802ULL, },
+ { 0xfffffa75645a7d9bULL, 0x0003c0350007004aULL, },
+ { 0xffffffa37fffffffULL, 0x0005f5d90006eb0dULL, }, /* 96 */
+ { 0xfffffffa7fffffffULL, 0x000978b30006d610ULL, },
+ { 0x000000007fffffffULL, 0x000f0d0c0006c153ULL, },
+ { 0x000000007fffffffULL, 0x0017eacf0006acd5ULL, },
+ { 0x000000007fffffffULL, 0x001b761e0007c87dULL, },
+ { 0x000000007fffffffULL, 0x001f87e00009133bULL, },
+ { 0x000000007fffffffULL, 0x00243402000a94e0ULL, },
+ { 0x000000007fffffffULL, 0x00299164000c5689ULL, },
+ { 0x0000000039cf8b80ULL, 0x003682160004293bULL, }, /* 104 */
+ { 0x000000001a1c28c4ULL, 0x00477a0900016741ULL, },
+ { 0x000000000bcae026ULL, 0x005dba4500007929ULL, },
+ { 0x00000000055376c2ULL, 0x007ae7c2000028ddULL, },
+ { 0x00000000093ed557ULL, 0x000d637500000d2cULL, },
+ { 0x00000000100c9469ULL, 0x0001755d0000043fULL, },
+ { 0x000000001bdc1297ULL, 0x000028ac0000015eULL, },
+ { 0x00000000305c8bbfULL, 0x0000046e00000071ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDR_Q_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_h.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_h.c
new file mode 100644
index 0000000000..cce7e9e8ac
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MUL_Q.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MUL_Q.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, },
+ { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x12f6da134bdb12f6ULL, 0xda134bdb12f6da13ULL, },
+ { 0xed0925edb425ed09ULL, 0x25edb425ed0925edULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
+ { 0x38e338e338e338e3ULL, 0x38e338e338e338e3ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0xed0925ecb425ed09ULL, 0x25ecb425ed0925ecULL, },
+ { 0x12f5da124bd912f5ULL, 0xda124bd912f5da12ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x147b147b147b147bULL, 0x147b147b147b147bULL, },
+ { 0xeb84eb84eb84eb84ULL, 0xeb84eb84eb84eb84ULL, },
+ { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
+ { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0xeb84eb84eb84eb84ULL, 0xeb84eb84eb84eb84ULL, },
+ { 0x147a147a147a147aULL, 0x147a147a147a147aULL, },
+ { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
+ { 0x0b60e93e2d820b60ULL, 0xe93e2d820b60e93eULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x12f6da134bdb12f6ULL, 0xda134bdb12f6da13ULL, },
+ { 0xed0925ecb425ed09ULL, 0x25ecb425ed0925ecULL, },
+ { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
+ { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
+ { 0x0652194865240652ULL, 0x1948652406521948ULL, },
+ { 0xf9ade6b79adcf9adULL, 0xe6b79adcf9ade6b7ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xed0925edb425ed09ULL, 0x25edb425ed0925edULL, },
+ { 0x12f5da124bd912f5ULL, 0xda124bd912f5da12ULL, },
+ { 0xf49f16c1d27cf49fULL, 0x16c1d27cf49f16c1ULL, },
+ { 0x0b60e93e2d820b60ULL, 0xe93e2d820b60e93eULL, },
+ { 0xf9ade6b79adcf9adULL, 0xe6b79adcf9ade6b7ULL, },
+ { 0x0651194965220651ULL, 0x1949652206511949ULL, },
+ { 0x6fb904f60cbd38c7ULL, 0x2c6b0102000431f1ULL, }, /* 64 */
+ { 0x03faffec1879da0eULL, 0x0b2bf9e1ffbfcc2aULL, },
+ { 0x4e261003e9dab268ULL, 0x1778faf00101e8d6ULL, },
+ { 0x9712fb9b1db7ec38ULL, 0xbccff56b01071259ULL, },
+ { 0x03faffec1879da0eULL, 0x0b2bf9e1ffbfcc2aULL, },
+ { 0x002400002f03195aULL, 0x02cf2515038635ccULL, },
+ { 0x02c8ffc1d57533d9ULL, 0x05e71eaef1eb1809ULL, },
+ { 0xfc43001139150d37ULL, 0xef194023f19aecf4ULL, },
+ { 0x4e261003e9dab268ULL, 0x1778faf00101e8d6ULL, }, /* 72 */
+ { 0x02c8ffc1d57533d9ULL, 0x05e71eaef1eb1809ULL, },
+ { 0x36aa33af267d6a08ULL, 0x0c67196238380abdULL, },
+ { 0xb69bf1d4cc591b07ULL, 0xdc7e3510397df77dULL, },
+ { 0x9712fb9b1db7ec38ULL, 0xbccff56b01071259ULL, },
+ { 0xfc43001139150d37ULL, 0xef194023f19aecf4ULL, },
+ { 0xb69bf1d4cc591b07ULL, 0xdc7e3510397df77dULL, },
+ { 0x628a03e2455006e3ULL, 0x65a26eec3ac806bdULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MUL_Q_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MUL_Q_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_w.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_w.c
new file mode 100644
index 0000000000..81d2635d7d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mul_q_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MUL_Q.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MUL_Q.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e38e3938e38e39ULL, 0x38e38e3938e38e39ULL, },
+ { 0xc71c71c6c71c71c6ULL, 0xc71c71c6c71c71c6ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, },
+ { 0xed097b42b425ed09ULL, 0x25ed097bed097b42ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c6c71c71c6ULL, 0xc71c71c6c71c71c6ULL, },
+ { 0x38e38e3838e38e38ULL, 0x38e38e3838e38e38ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0xed097b42b425ed09ULL, 0x25ed097aed097b42ULL, },
+ { 0x12f684bd4bda12f5ULL, 0xda12f68412f684bdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x147ae148147ae148ULL, 0x147ae148147ae148ULL, },
+ { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, },
+ { 0x0b60b60b2d82d82eULL, 0xe93e93e90b60b60bULL, },
+ { 0xf49f49f4d27d27d2ULL, 0x16c16c17f49f49f4ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, },
+ { 0x147ae147147ae147ULL, 0x147ae147147ae147ULL, },
+ { 0xf49f49f4d27d27d2ULL, 0x16c16c16f49f49f4ULL, },
+ { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, },
+ { 0xed097b42b425ed09ULL, 0x25ed097aed097b42ULL, },
+ { 0x0b60b60b2d82d82eULL, 0xe93e93e90b60b60bULL, },
+ { 0xf49f49f4d27d27d2ULL, 0x16c16c16f49f49f4ULL, },
+ { 0x06522c3f6522c3f3ULL, 0x1948b0fc06522c3fULL, },
+ { 0xf9add3c09add3c0dULL, 0xe6b74f03f9add3c0ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xed097b42b425ed09ULL, 0x25ed097bed097b42ULL, },
+ { 0x12f684bd4bda12f5ULL, 0xda12f68412f684bdULL, },
+ { 0xf49f49f4d27d27d2ULL, 0x16c16c17f49f49f4ULL, },
+ { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, },
+ { 0xf9add3c09add3c0dULL, 0xe6b74f03f9add3c0ULL, },
+ { 0x06522c3f6522c3f1ULL, 0x1948b0fc06522c3fULL, },
+ { 0x6fb7e8890cbdc0d2ULL, 0x2c6b144600049a04ULL, }, /* 64 */
+ { 0x03fa514e1879c701ULL, 0x0b2c6ca9ffbf8ac6ULL, },
+ { 0x4e252086e9daefbfULL, 0x1779189301015a34ULL, },
+ { 0x9713a7171db7f3a5ULL, 0xbccfb4690107236fULL, },
+ { 0x03fa514e1879c701ULL, 0x0b2c6ca9ffbf8ac6ULL, },
+ { 0x002442012f047611ULL, 0x02cf8c140386e68eULL, },
+ { 0x02c84b87d575d121ULL, 0x05e79a8af1eb1c52ULL, },
+ { 0xfc439edc3916c1e4ULL, 0xef19389cf19a0fddULL, },
+ { 0x4e252086e9daefbfULL, 0x1779189301015a34ULL, }, /* 72 */
+ { 0x02c84b87d575d121ULL, 0x05e79a8af1eb1c52ULL, },
+ { 0x36a93aff267d11c3ULL, 0x0c6788643838c14cULL, },
+ { 0xb69baa39cc590fcdULL, 0xdc7e6df7397c58d9ULL, },
+ { 0x9713a7171db7f3a5ULL, 0xbccfb4690107236fULL, },
+ { 0xfc439edc3916c1e4ULL, 0xef19389cf19a0fddULL, },
+ { 0xb69baa39cc590fcdULL, 0xdc7e6df7397c58d9ULL, },
+ { 0x628a97e4455157d3ULL, 0x65a1c5e13ac736e1ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MUL_Q_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MUL_Q_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c
new file mode 100644
index 0000000000..d5b00f1eb0
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MULR_Q.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MULR_Q.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, },
+ { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
+ { 0x2223222322232223ULL, 0x2223222322232223ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x12f7da134bdb12f7ULL, 0xda134bdb12f7da13ULL, },
+ { 0xed0a25eeb425ed0aULL, 0x25eeb425ed0a25eeULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71cc71cc71cc71cULL, 0xc71cc71cc71cc71cULL, },
+ { 0x38e338e338e338e3ULL, 0x38e338e338e338e3ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xed0925edb426ed09ULL, 0x25edb426ed0925edULL, },
+ { 0x12f6da134bda12f6ULL, 0xda134bda12f6da13ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2223222322232223ULL, 0x2223222322232223ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x147c147c147c147cULL, 0x147c147c147c147cULL, },
+ { 0xeb85eb85eb85eb85ULL, 0xeb85eb85eb85eb85ULL, },
+ { 0x0b61e93e2d840b61ULL, 0xe93e2d840b61e93eULL, },
+ { 0xf49f16c2d27cf49fULL, 0x16c2d27cf49f16c2ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xeb85eb85eb85eb85ULL, 0xeb85eb85eb85eb85ULL, },
+ { 0x147b147b147b147bULL, 0x147b147b147b147bULL, },
+ { 0xf49f16c1d27df49fULL, 0x16c1d27df49f16c1ULL, },
+ { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x12f7da134bdb12f7ULL, 0xda134bdb12f7da13ULL, },
+ { 0xed0925edb426ed09ULL, 0x25edb426ed0925edULL, },
+ { 0x0b61e93e2d840b61ULL, 0xe93e2d840b61e93eULL, },
+ { 0xf49f16c1d27df49fULL, 0x16c1d27df49f16c1ULL, },
+ { 0x0652194865240652ULL, 0x1948652406521948ULL, },
+ { 0xf9aee6b79addf9aeULL, 0xe6b79addf9aee6b7ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xed0a25eeb425ed0aULL, 0x25eeb425ed0a25eeULL, },
+ { 0x12f6da134bda12f6ULL, 0xda134bda12f6da13ULL, },
+ { 0xf49f16c2d27cf49fULL, 0x16c2d27cf49f16c2ULL, },
+ { 0x0b60e93e2d830b60ULL, 0xe93e2d830b60e93eULL, },
+ { 0xf9aee6b79addf9aeULL, 0xe6b79addf9aee6b7ULL, },
+ { 0x0652194965230652ULL, 0x1949652306521949ULL, },
+ { 0x6fba04f60cbe38c7ULL, 0x2c6b0102000531f1ULL, }, /* 64 */
+ { 0x03faffed1879da0fULL, 0x0b2cf9e2ffbfcc2aULL, },
+ { 0x4e261004e9dbb269ULL, 0x1779faf00102e8d7ULL, },
+ { 0x9713fb9c1db7ec39ULL, 0xbccff56b01081259ULL, },
+ { 0x03faffed1879da0fULL, 0x0b2cf9e2ffbfcc2aULL, },
+ { 0x002400002f04195bULL, 0x02cf2516038735cdULL, },
+ { 0x02c8ffc1d57633daULL, 0x05e71eaff1eb180aULL, },
+ { 0xfc44001139160d37ULL, 0xef1a4023f19aecf5ULL, },
+ { 0x4e261004e9dbb269ULL, 0x1779faf00102e8d7ULL, }, /* 72 */
+ { 0x02c8ffc1d57633daULL, 0x05e71eaff1eb180aULL, },
+ { 0x36aa33af267e6a09ULL, 0x0c67196338390abeULL, },
+ { 0xb69bf1d4cc591b07ULL, 0xdc7f3511397df77eULL, },
+ { 0x9713fb9c1db7ec39ULL, 0xbccff56b01081259ULL, },
+ { 0xfc44001139160d37ULL, 0xef1a4023f19aecf5ULL, },
+ { 0xb69bf1d4cc591b07ULL, 0xdc7f3511397df77eULL, },
+ { 0x628a03e3455006e4ULL, 0x65a36eec3ac806beULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULR_Q_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULR_Q_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c
new file mode 100644
index 0000000000..78c9e22394
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MULR_Q.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Fixed Multiply";
+ char *instruction_name = "MULR_Q.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e38e3a38e38e3aULL, 0x38e38e3a38e38e3aULL, },
+ { 0xc71c71c7c71c71c7ULL, 0xc71c71c7c71c71c7ULL, },
+ { 0x2222222322222223ULL, 0x2222222322222223ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, },
+ { 0xed097b43b425ed09ULL, 0x25ed097ced097b43ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c7c71c71c7ULL, 0xc71c71c7c71c71c7ULL, },
+ { 0x38e38e3838e38e38ULL, 0x38e38e3838e38e38ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xed097b42b425ed0aULL, 0x25ed097bed097b42ULL, },
+ { 0x12f684bd4bda12f6ULL, 0xda12f68512f684bdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222322222223ULL, 0x2222222322222223ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x147ae148147ae148ULL, 0x147ae148147ae148ULL, },
+ { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, },
+ { 0x0b60b60c2d82d82eULL, 0xe93e93e90b60b60cULL, },
+ { 0xf49f49f5d27d27d2ULL, 0x16c16c17f49f49f5ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xeb851eb8eb851eb8ULL, 0xeb851eb8eb851eb8ULL, },
+ { 0x147ae148147ae148ULL, 0x147ae148147ae148ULL, },
+ { 0xf49f49f4d27d27d3ULL, 0x16c16c16f49f49f4ULL, },
+ { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x12f684be4bda12f7ULL, 0xda12f68512f684beULL, },
+ { 0xed097b42b425ed0aULL, 0x25ed097bed097b42ULL, },
+ { 0x0b60b60c2d82d82eULL, 0xe93e93e90b60b60cULL, },
+ { 0xf49f49f4d27d27d3ULL, 0x16c16c16f49f49f4ULL, },
+ { 0x06522c3f6522c3f4ULL, 0x1948b0fc06522c3fULL, },
+ { 0xf9add3c19add3c0dULL, 0xe6b74f04f9add3c1ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xed097b43b425ed09ULL, 0x25ed097ced097b43ULL, },
+ { 0x12f684bd4bda12f6ULL, 0xda12f68512f684bdULL, },
+ { 0xf49f49f5d27d27d2ULL, 0x16c16c17f49f49f5ULL, },
+ { 0x0b60b60b2d82d82dULL, 0xe93e93e90b60b60bULL, },
+ { 0xf9add3c19add3c0dULL, 0xe6b74f04f9add3c1ULL, },
+ { 0x06522c3f6522c3f2ULL, 0x1948b0fd06522c3fULL, },
+ { 0x6fb7e8890cbdc0d3ULL, 0x2c6b144600049a05ULL, }, /* 64 */
+ { 0x03fa514e1879c702ULL, 0x0b2c6ca9ffbf8ac7ULL, },
+ { 0x4e252087e9daefc0ULL, 0x1779189301015a35ULL, },
+ { 0x9713a7171db7f3a6ULL, 0xbccfb46a0107236fULL, },
+ { 0x03fa514e1879c702ULL, 0x0b2c6ca9ffbf8ac7ULL, },
+ { 0x002442012f047612ULL, 0x02cf8c140386e68fULL, },
+ { 0x02c84b88d575d121ULL, 0x05e79a8bf1eb1c52ULL, },
+ { 0xfc439edd3916c1e4ULL, 0xef19389cf19a0fdeULL, },
+ { 0x4e252087e9daefc0ULL, 0x1779189301015a35ULL, }, /* 72 */
+ { 0x02c84b88d575d121ULL, 0x05e79a8bf1eb1c52ULL, },
+ { 0x36a93aff267d11c4ULL, 0x0c6788643838c14cULL, },
+ { 0xb69baa3acc590fcdULL, 0xdc7e6df7397c58daULL, },
+ { 0x9713a7171db7f3a6ULL, 0xbccfb46a0107236fULL, },
+ { 0xfc439edd3916c1e4ULL, 0xef19389cf19a0fdeULL, },
+ { 0xb69baa3acc590fcdULL, 0xdc7e6df7397c58daULL, },
+ { 0x628a97e4455157d3ULL, 0x65a1c5e23ac736e2ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULR_Q_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULR_Q_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_d.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_d.c
new file mode 100644
index 0000000000..d9b49cea8c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMAX_A.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMAX_A.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_A_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_A_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_w.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_w.c
new file mode 100644
index 0000000000..f64276f2f1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_a_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMAX_A.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMAX_A.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaa71c71c71ULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e355555555ULL, 0x55555555e38e38e3ULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xcccccccc71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333371c71c71ULL, 0xc71c71c733333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e355555555ULL, 0x55555555e38e38e3ULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xe38e38e333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e371c71c71ULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaa71c71c71ULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0xcccccccc71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0x3333333371c71c71ULL, 0xc71c71c733333333ULL, },
+ { 0xe38e38e371c71c71ULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xfbbe00635e31e24eULL, 0x12f7bb1aa942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00635e31e24eULL, 0x12f7bb1aa942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_A_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_A_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_d.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_d.c
new file mode 100644
index 0000000000..ba548e4882
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMAX.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMAX.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_w.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_w.c
new file mode 100644
index 0000000000..f9aa24d62b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmax_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMAX.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMAX.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x38e38e3800000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0x38e38e38aaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x38e38e3833333333ULL, },
+ { 0x3333333371c71c71ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e3800000000ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0x38e38e38aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x3333333333333333ULL, 0x38e38e3833333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x000000001c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333371c71c71ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc4d93c708ULL, 0x4b670b5e153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5eab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5ea942e2a0ULL, },
+ { 0x886ae6cc4d93c708ULL, 0x4b670b5e153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaa4d93c708ULL, 0x27d8c6ff153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5eab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaa4d93c708ULL, 0x27d8c6ff153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffa942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5ea942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffa942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMAX_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_d.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_d.c
new file mode 100644
index 0000000000..555aa133ae
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMIN_A.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMIN_A.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_A_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_A_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_w.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_w.c
new file mode 100644
index 0000000000..9a81f1c6c5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_a_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMIN_A.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMIN_A.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71caaaaaaaaULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x555555558e38e38eULL, 0x38e38e3855555555ULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x1c71c71cccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333333338e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c33333333ULL, 0x333333331c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x555555558e38e38eULL, 0x38e38e3855555555ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x333333338e38e38eULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c8e38e38eULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71caaaaaaaaULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71cccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c33333333ULL, 0x333333331c71c71cULL, },
+ { 0x1c71c71c8e38e38eULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d4d93c708ULL, 0x8df188d8153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d4d93c708ULL, 0x8df188d8153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_A_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_A_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_d.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_d.c
new file mode 100644
index 0000000000..97123c8c0b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMIN.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMIN.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_w.c b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_w.c
new file mode 100644
index 0000000000..1e91136441
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/float-max-min/test_msa_fmin_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction FMIN.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Float Max Min";
+ char *instruction_name = "FMIN.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0xc71c71c700000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0xaaaaaaaae38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x33333333e38e38e3ULL, },
+ { 0x1c71c71c33333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0xaaaaaaaae38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x33333333e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c700000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c33333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe006328625540ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6fffe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8fe7bb00cULL, },
+ { 0xfbbe006328625540ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe0063b9cf8b80ULL, 0x12f7bb1aab2b2514ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6fffe7bb00cULL, }, /* 72 */
+ { 0xfbbe0063b9cf8b80ULL, 0x12f7bb1aab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8ab2b2514ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8fe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8ab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_FMIN_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c
new file mode 100644
index 0000000000..c0a07b5552
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADD_A.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADD_A.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, }, /* 0 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x5757575757575757ULL, 0x5757575757575757ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x3535353535353535ULL, 0x3535353535353535ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x1e73391e73391e73ULL, 0x391e73391e73391eULL, },
+ { 0x1d723a1d723a1d72ULL, 0x3a1d723a1d723a1dULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x5757575757575757ULL, 0x5757575757575757ULL, }, /* 16 */
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0xacacacacacacacacULL, 0xacacacacacacacacULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x8a8a8a8a8a8a8a8aULL, 0x8a8a8a8a8a8a8a8aULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x73c88e73c88e73c8ULL, 0x8e73c88e73c88e73ULL, },
+ { 0x72c78f72c78f72c7ULL, 0x8f72c78f72c78f72ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x72c78d72c78d72c7ULL, 0x8d72c78d72c78d72ULL, },
+ { 0x71c68e71c68e71c6ULL, 0x8e71c68e71c68e71ULL, },
+ { 0x3535353535353535ULL, 0x3535353535353535ULL, }, /* 32 */
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x8a8a8a8a8a8a8a8aULL, 0x8a8a8a8a8a8a8a8aULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x6868686868686868ULL, 0x6868686868686868ULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x51a66c51a66c51a6ULL, 0x6c51a66c51a66c51ULL, },
+ { 0x50a56d50a56d50a5ULL, 0x6d50a56d50a56d50ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x50a56b50a56b50a5ULL, 0x6b50a56b50a56b50ULL, },
+ { 0x4fa46c4fa46c4fa4ULL, 0x6c4fa46c4fa46c4fULL, },
+ { 0x1e73391e73391e73ULL, 0x391e73391e73391eULL, }, /* 48 */
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x73c88e73c88e73c8ULL, 0x8e73c88e73c88e73ULL, },
+ { 0x72c78d72c78d72c7ULL, 0x8d72c78d72c78d72ULL, },
+ { 0x51a66c51a66c51a6ULL, 0x6c51a66c51a66c51ULL, },
+ { 0x50a56b50a56b50a5ULL, 0x6b50a56b50a56b50ULL, },
+ { 0x3ae4703ae4703ae4ULL, 0x703ae4703ae4703aULL, },
+ { 0x39e37139e37139e3ULL, 0x7139e37139e37139ULL, },
+ { 0x1d723a1d723a1d72ULL, 0x3a1d723a1d723a1dULL, }, /* 56 */
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x72c78f72c78f72c7ULL, 0x8f72c78f72c78f72ULL, },
+ { 0x71c68e71c68e71c6ULL, 0x8e71c68e71c68e71ULL, },
+ { 0x50a56d50a56d50a5ULL, 0x6d50a56d50a56d50ULL, },
+ { 0x4fa46c4fa46c4fa4ULL, 0x6c4fa46c4fa46c4fULL, },
+ { 0x39e37139e37139e3ULL, 0x7139e37139e37139ULL, },
+ { 0x38e27238e27238e2ULL, 0x7238e27238e27238ULL, },
+ { 0xf0d4346850c4aa80ULL, 0x96ce16bc04f6a018ULL, }, /* 64 */
+ { 0x7dac1a9775cf8e48ULL, 0x5d70507817baa210ULL, },
+ { 0xccc46c8a6f93cac0ULL, 0x728f455f57a67520ULL, },
+ { 0xe8b930818693738eULL, 0xbe76838659bd6e6cULL, },
+ { 0x7dac1a9775cf8e48ULL, 0x5d70507817baa210ULL, },
+ { 0x0a8400c69ada7210ULL, 0x24128a342a7ea408ULL, },
+ { 0x599c52b9949eae88ULL, 0x39317f1b6a6a7718ULL, },
+ { 0x759116b0ab9e5756ULL, 0x8518bd426c817064ULL, },
+ { 0xccc46c8a6f93cac0ULL, 0x728f455f57a67520ULL, }, /* 72 */
+ { 0x599c52b9949eae88ULL, 0x39317f1b6a6a7718ULL, },
+ { 0xa8b4a4ac8e62ea00ULL, 0x4e507402aa564a28ULL, },
+ { 0xc4a968a3a56293ceULL, 0x9a37b229ac6d4374ULL, },
+ { 0xe8b930818693738eULL, 0xbe76838659bd6e6cULL, },
+ { 0x759116b0ab9e5756ULL, 0x8518bd426c817064ULL, },
+ { 0xc4a968a3a56293ceULL, 0x9a37b229ac6d4374ULL, },
+ { 0xe09e2c9abc623c9cULL, 0xe61ef050ae843cc0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c
new file mode 100644
index 0000000000..0771cdbdfe
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADD_A.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADD_A.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 0 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x5555555555555557ULL, 0x5555555555555557ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x3333333333333335ULL, 0x3333333333333335ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x1c71c71c71c71c73ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e5ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x5555555555555557ULL, 0x5555555555555557ULL, }, /* 16 */
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0xaaaaaaaaaaaaaaacULL, 0xaaaaaaaaaaaaaaacULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x888888888888888aULL, 0x888888888888888aULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x71c71c71c71c71c8ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x8e38e38e38e38e3aULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x3333333333333335ULL, 0x3333333333333335ULL, }, /* 32 */
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x888888888888888aULL, 0x888888888888888aULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x6666666666666668ULL, 0x6666666666666668ULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x4fa4fa4fa4fa4fa6ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c18ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x1c71c71c71c71c73ULL, 0x38e38e38e38e38e4ULL, }, /* 48 */
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x71c71c71c71c71c8ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x4fa4fa4fa4fa4fa6ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c16ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x71c71c71c71c71c6ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e5ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x8e38e38e38e38e3aULL, },
+ { 0x71c71c71c71c71c6ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c18ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x38e38e38e38e38e2ULL, 0x71c71c71c71c71c8ULL, },
+ { 0xef2a3267af3b5580ULL, 0x96ce16bdfcf76018ULL, }, /* 64 */
+ { 0x7bd718d08a09e3b8ULL, 0x5e5ec67913bb0308ULL, },
+ { 0xcb3a6a891dce1f40ULL, 0x733fd25ea9a6d520ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0xbd7582865538cd6cULL, },
+ { 0x7bd718d08a09e3b8ULL, 0x5e5ec67913bb0308ULL, },
+ { 0x0883ff3964d871f0ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0x57e750f1f89cad78ULL, 0x3ad08219c06a7810ULL, },
+ { 0x749115ea109e1b46ULL, 0x850632416bfc705cULL, },
+ { 0xcb3a6a891dce1f40ULL, 0x733fd25ea9a6d520ULL, }, /* 72 */
+ { 0x57e750f1f89cad78ULL, 0x3ad08219c06a7810ULL, },
+ { 0xa74aa2aa8c60e900ULL, 0x4fb18dff56564a28ULL, },
+ { 0xc3f467a2a46256ceULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0xbd7582865538cd6cULL, },
+ { 0x749115ea109e1b46ULL, 0x850632416bfc705cULL, },
+ { 0xc3f467a2a46256ceULL, 0x99e73e2701e84274ULL, },
+ { 0xe09e2c9abc63c49cULL, 0xe41cee4ead7a3ac0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c
new file mode 100644
index 0000000000..7956960d0f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADD_A.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADD_A.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 0 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x5557555755575557ULL, 0x5557555755575557ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x3335333533353335ULL, 0x3335333533353335ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x1c7338e471c91c73ULL, 0x38e471c91c7338e4ULL, },
+ { 0x1c7238e571c81c72ULL, 0x38e571c81c7238e5ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x5557555755575557ULL, 0x5557555755575557ULL, }, /* 16 */
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0xaaacaaacaaacaaacULL, 0xaaacaaacaaacaaacULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x888a888a888a888aULL, 0x888a888a888a888aULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x71c88e39c71e71c8ULL, 0x8e39c71e71c88e39ULL, },
+ { 0x71c78e3ac71d71c7ULL, 0x8e3ac71d71c78e3aULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x71c78e38c71d71c7ULL, 0x8e38c71d71c78e38ULL, },
+ { 0x71c68e39c71c71c6ULL, 0x8e39c71c71c68e39ULL, },
+ { 0x3335333533353335ULL, 0x3335333533353335ULL, }, /* 32 */
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x888a888a888a888aULL, 0x888a888a888a888aULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x6668666866686668ULL, 0x6668666866686668ULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x4fa66c17a4fc4fa6ULL, 0x6c17a4fc4fa66c17ULL, },
+ { 0x4fa56c18a4fb4fa5ULL, 0x6c18a4fb4fa56c18ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x4fa56c16a4fb4fa5ULL, 0x6c16a4fb4fa56c16ULL, },
+ { 0x4fa46c17a4fa4fa4ULL, 0x6c17a4fa4fa46c17ULL, },
+ { 0x1c7338e471c91c73ULL, 0x38e471c91c7338e4ULL, }, /* 48 */
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x71c88e39c71e71c8ULL, 0x8e39c71e71c88e39ULL, },
+ { 0x71c78e38c71d71c7ULL, 0x8e38c71d71c78e38ULL, },
+ { 0x4fa66c17a4fc4fa6ULL, 0x6c17a4fc4fa66c17ULL, },
+ { 0x4fa56c16a4fb4fa5ULL, 0x6c16a4fb4fa56c16ULL, },
+ { 0x38e471c6e39038e4ULL, 0x71c6e39038e471c6ULL, },
+ { 0x38e371c7e38f38e3ULL, 0x71c7e38f38e371c7ULL, },
+ { 0x1c7238e571c81c72ULL, 0x38e571c81c7238e5ULL, }, /* 56 */
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x71c78e3ac71d71c7ULL, 0x8e3ac71d71c78e3aULL, },
+ { 0x71c68e39c71c71c6ULL, 0x8e39c71c71c68e39ULL, },
+ { 0x4fa56c18a4fb4fa5ULL, 0x6c18a4fb4fa56c18ULL, },
+ { 0x4fa46c17a4fa4fa4ULL, 0x6c17a4fa4fa46c17ULL, },
+ { 0x38e371c7e38f38e3ULL, 0x71c7e38f38e371c7ULL, },
+ { 0x38e271c8e38e38e2ULL, 0x71c8e38e38e271c8ULL, },
+ { 0xef2c326850c4aa80ULL, 0x96ce16bc030a9fe8ULL, }, /* 64 */
+ { 0x7bd8199775f58e38ULL, 0x5e5e504416c4a2f0ULL, },
+ { 0xcb3c6a8a6e93c9c0ULL, 0x733f445f565a7508ULL, },
+ { 0xe7e52f81869372f2ULL, 0xbd76828658436d54ULL, },
+ { 0x7bd8199775f58e38ULL, 0x5e5e504416c4a2f0ULL, },
+ { 0x088400c69b2671f0ULL, 0x25ee89cc2a7ea5f8ULL, },
+ { 0x57e851b993c4ad78ULL, 0x3acf7de76a147810ULL, },
+ { 0x749116b0abc456aaULL, 0x8506bc0e6bfd705cULL, },
+ { 0xcb3c6a8a6e93c9c0ULL, 0x733f445f565a7508ULL, }, /* 72 */
+ { 0x57e851b993c4ad78ULL, 0x3acf7de76a147810ULL, },
+ { 0xa74ca2ac8c62e900ULL, 0x4fb07202a9aa4a28ULL, },
+ { 0xc3f567a3a4629232ULL, 0x99e7b029ab934274ULL, },
+ { 0xe7e52f81869372f2ULL, 0xbd76828658436d54ULL, },
+ { 0x749116b0abc456aaULL, 0x8506bc0e6bfd705cULL, },
+ { 0xc3f567a3a4629232ULL, 0x99e7b029ab934274ULL, },
+ { 0xe09e2c9abc623b64ULL, 0xe41eee50ad7c3ac0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c
new file mode 100644
index 0000000000..590f440406
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_add_a_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADD_A.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADD_A.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 0 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x5555555755555557ULL, 0x5555555755555557ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x3333333533333335ULL, 0x3333333533333335ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x1c71c71e71c71c73ULL, 0x38e38e391c71c71eULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e3a1c71c71dULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x5555555755555557ULL, 0x5555555755555557ULL, }, /* 16 */
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0xaaaaaaacaaaaaaacULL, 0xaaaaaaacaaaaaaacULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x8888888a8888888aULL, 0x8888888a8888888aULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x71c71c73c71c71c8ULL, 0x8e38e38e71c71c73ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x8e38e38f71c71c72ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x8e38e38d71c71c72ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x8e38e38e71c71c71ULL, },
+ { 0x3333333533333335ULL, 0x3333333533333335ULL, }, /* 32 */
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x8888888a8888888aULL, 0x8888888a8888888aULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x6666666866666668ULL, 0x6666666866666668ULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x4fa4fa51a4fa4fa6ULL, 0x6c16c16c4fa4fa51ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x6c16c16d4fa4fa50ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x6c16c16b4fa4fa50ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0x6c16c16c4fa4fa4fULL, },
+ { 0x1c71c71e71c71c73ULL, 0x38e38e391c71c71eULL, }, /* 48 */
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x71c71c73c71c71c8ULL, 0x8e38e38e71c71c73ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x8e38e38d71c71c72ULL, },
+ { 0x4fa4fa51a4fa4fa6ULL, 0x6c16c16c4fa4fa51ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x6c16c16b4fa4fa50ULL, },
+ { 0x38e38e3ae38e38e4ULL, 0x71c71c7038e38e3aULL, },
+ { 0x38e38e39e38e38e3ULL, 0x71c71c7138e38e39ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e3a1c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x71c71c72c71c71c7ULL, 0x8e38e38f71c71c72ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x8e38e38e71c71c71ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x6c16c16d4fa4fa50ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0x6c16c16c4fa4fa4fULL, },
+ { 0x38e38e39e38e38e3ULL, 0x71c71c7138e38e39ULL, },
+ { 0x38e38e38e38e38e2ULL, 0x71c71c7238e38e38ULL, },
+ { 0xef2a326850c4aa80ULL, 0x96ce16bc03089fe8ULL, }, /* 64 */
+ { 0x7bd718d175f61c48ULL, 0x5e5ec67816c3a2f0ULL, },
+ { 0xcb3a6a8a6e92c9c0ULL, 0x733fd25d56592ae0ULL, },
+ { 0xe7e42f818694378eULL, 0xbd75828658416d54ULL, },
+ { 0x7bd718d175f61c48ULL, 0x5e5ec67816c3a2f0ULL, },
+ { 0x0883ff3a9b278e10ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0x57e750f393c43b88ULL, 0x3ad082196a142de8ULL, },
+ { 0x749115eaabc5a956ULL, 0x850632426bfc705cULL, },
+ { 0xcb3a6a8a6e92c9c0ULL, 0x733fd25d56592ae0ULL, }, /* 72 */
+ { 0x57e750f393c43b88ULL, 0x3ad082196a142de8ULL, },
+ { 0xa74aa2ac8c60e900ULL, 0x4fb18dfea9a9b5d8ULL, },
+ { 0xc3f467a3a46256ceULL, 0x99e73e27ab91f84cULL, },
+ { 0xe7e42f818694378eULL, 0xbd75828658416d54ULL, },
+ { 0x749115eaabc5a956ULL, 0x850632426bfc705cULL, },
+ { 0xc3f467a3a46256ceULL, 0x99e73e27ab91f84cULL, },
+ { 0xe09e2c9abc63c49cULL, 0xe41cee50ad7a3ac0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADD_A_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c
new file mode 100644
index 0000000000..42dd260726
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_A.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_A.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, }, /* 0 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x5757575757575757ULL, 0x5757575757575757ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x3535353535353535ULL, 0x3535353535353535ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x1e73391e73391e73ULL, 0x391e73391e73391eULL, },
+ { 0x1d723a1d723a1d72ULL, 0x3a1d723a1d723a1dULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x5757575757575757ULL, 0x5757575757575757ULL, }, /* 16 */
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x737f7f737f7f737fULL, 0x7f737f7f737f7f73ULL, },
+ { 0x727f7f727f7f727fULL, 0x7f727f7f727f7f72ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x727f7f727f7f727fULL, 0x7f727f7f727f7f72ULL, },
+ { 0x717f7f717f7f717fULL, 0x7f717f7f717f7f71ULL, },
+ { 0x3535353535353535ULL, 0x3535353535353535ULL, }, /* 32 */
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x6868686868686868ULL, 0x6868686868686868ULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x517f6c517f6c517fULL, 0x6c517f6c517f6c51ULL, },
+ { 0x507f6d507f6d507fULL, 0x6d507f6d507f6d50ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x507f6b507f6b507fULL, 0x6b507f6b507f6b50ULL, },
+ { 0x4f7f6c4f7f6c4f7fULL, 0x6c4f7f6c4f7f6c4fULL, },
+ { 0x1e73391e73391e73ULL, 0x391e73391e73391eULL, }, /* 48 */
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x737f7f737f7f737fULL, 0x7f737f7f737f7f73ULL, },
+ { 0x727f7f727f7f727fULL, 0x7f727f7f727f7f72ULL, },
+ { 0x517f6c517f6c517fULL, 0x6c517f6c517f6c51ULL, },
+ { 0x507f6b507f6b507fULL, 0x6b507f6b507f6b50ULL, },
+ { 0x3a7f703a7f703a7fULL, 0x703a7f703a7f703aULL, },
+ { 0x397f71397f71397fULL, 0x71397f71397f7139ULL, },
+ { 0x1d723a1d723a1d72ULL, 0x3a1d723a1d723a1dULL, }, /* 56 */
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x727f7f727f7f727fULL, 0x7f727f7f727f7f72ULL, },
+ { 0x717f7f717f7f717fULL, 0x7f717f7f717f7f71ULL, },
+ { 0x507f6d507f6d507fULL, 0x6d507f6d507f6d50ULL, },
+ { 0x4f7f6c4f7f6c4f7fULL, 0x6c4f7f6c4f7f6c4fULL, },
+ { 0x397f71397f71397fULL, 0x71397f71397f7139ULL, },
+ { 0x387f72387f72387fULL, 0x72387f72387f7238ULL, },
+ { 0x7f7f3468507f7f7fULL, 0x7f7f167f047f7f18ULL, }, /* 64 */
+ { 0x7d7f1a7f757f7f48ULL, 0x5d705078177f7f10ULL, },
+ { 0x7f7f6c7f6f7f7f7fULL, 0x727f455f577f7520ULL, },
+ { 0x7f7f307f7f7f737fULL, 0x7f767f7f597f6e6cULL, },
+ { 0x7d7f1a7f757f7f48ULL, 0x5d705078177f7f10ULL, },
+ { 0x0a7f007f7f7f7210ULL, 0x24127f342a7e7f08ULL, },
+ { 0x597f527f7f7f7f7fULL, 0x39317f1b6a6a7718ULL, },
+ { 0x757f167f7f7f5756ULL, 0x7f187f426c7f7064ULL, },
+ { 0x7f7f6c7f6f7f7f7fULL, 0x727f455f577f7520ULL, }, /* 72 */
+ { 0x597f527f7f7f7f7fULL, 0x39317f1b6a6a7718ULL, },
+ { 0x7f7f7f7f7f627f7fULL, 0x4e5074027f564a28ULL, },
+ { 0x7f7f687f7f627f7fULL, 0x7f377f297f6d4374ULL, },
+ { 0x7f7f307f7f7f737fULL, 0x7f767f7f597f6e6cULL, },
+ { 0x757f167f7f7f5756ULL, 0x7f187f426c7f7064ULL, },
+ { 0x7f7f687f7f627f7fULL, 0x7f377f297f6d4374ULL, },
+ { 0x7f7f2c7f7f623c7fULL, 0x7f1e7f507f7f3c7fULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c
new file mode 100644
index 0000000000..3e4e6f7f99
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_A.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_A.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 0 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x5555555555555557ULL, 0x5555555555555557ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x3333333333333335ULL, 0x3333333333333335ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x1c71c71c71c71c73ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e5ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x5555555555555557ULL, 0x5555555555555557ULL, }, /* 16 */
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c8ULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c7ULL, 0x7fffffffffffffffULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c7ULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c6ULL, 0x7fffffffffffffffULL, },
+ { 0x3333333333333335ULL, 0x3333333333333335ULL, }, /* 32 */
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x6666666666666668ULL, 0x6666666666666668ULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x4fa4fa4fa4fa4fa6ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c18ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x1c71c71c71c71c73ULL, 0x38e38e38e38e38e4ULL, }, /* 48 */
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x71c71c71c71c71c8ULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c7ULL, 0x7fffffffffffffffULL, },
+ { 0x4fa4fa4fa4fa4fa6ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c16ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x71c71c71c71c71c6ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e5ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c6ULL, 0x7fffffffffffffffULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x6c16c16c16c16c18ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x38e38e38e38e38e2ULL, 0x71c71c71c71c71c8ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, /* 64 */
+ { 0x7bd718d08a09e3b8ULL, 0x5e5ec67913bb0308ULL, },
+ { 0x7fffffffffffffffULL, 0x733fd25ea9a6d520ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7bd718d08a09e3b8ULL, 0x5e5ec67913bb0308ULL, },
+ { 0x0883ff3964d871f0ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0x57e750f1f89cad78ULL, 0x3ad08219c06a7810ULL, },
+ { 0x749115ea109e1b46ULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x733fd25ea9a6d520ULL, }, /* 72 */
+ { 0x57e750f1f89cad78ULL, 0x3ad08219c06a7810ULL, },
+ { 0x7fffffffffffffffULL, 0x4fb18dff56564a28ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x749115ea109e1b46ULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c
new file mode 100644
index 0000000000..2901a8174b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_A.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_A.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 0 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x5557555755575557ULL, 0x5557555755575557ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x3335333533353335ULL, 0x3335333533353335ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x1c7338e471c91c73ULL, 0x38e471c91c7338e4ULL, },
+ { 0x1c7238e571c81c72ULL, 0x38e571c81c7238e5ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x5557555755575557ULL, 0x5557555755575557ULL, }, /* 16 */
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x71c87fff7fff71c8ULL, 0x7fff7fff71c87fffULL, },
+ { 0x71c77fff7fff71c7ULL, 0x7fff7fff71c77fffULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x71c77fff7fff71c7ULL, 0x7fff7fff71c77fffULL, },
+ { 0x71c67fff7fff71c6ULL, 0x7fff7fff71c67fffULL, },
+ { 0x3335333533353335ULL, 0x3335333533353335ULL, }, /* 32 */
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x6668666866686668ULL, 0x6668666866686668ULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x4fa66c177fff4fa6ULL, 0x6c177fff4fa66c17ULL, },
+ { 0x4fa56c187fff4fa5ULL, 0x6c187fff4fa56c18ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x4fa56c167fff4fa5ULL, 0x6c167fff4fa56c16ULL, },
+ { 0x4fa46c177fff4fa4ULL, 0x6c177fff4fa46c17ULL, },
+ { 0x1c7338e471c91c73ULL, 0x38e471c91c7338e4ULL, }, /* 48 */
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x71c87fff7fff71c8ULL, 0x7fff7fff71c87fffULL, },
+ { 0x71c77fff7fff71c7ULL, 0x7fff7fff71c77fffULL, },
+ { 0x4fa66c177fff4fa6ULL, 0x6c177fff4fa66c17ULL, },
+ { 0x4fa56c167fff4fa5ULL, 0x6c167fff4fa56c16ULL, },
+ { 0x38e471c67fff38e4ULL, 0x71c67fff38e471c6ULL, },
+ { 0x38e371c77fff38e3ULL, 0x71c77fff38e371c7ULL, },
+ { 0x1c7238e571c81c72ULL, 0x38e571c81c7238e5ULL, }, /* 56 */
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x71c77fff7fff71c7ULL, 0x7fff7fff71c77fffULL, },
+ { 0x71c67fff7fff71c6ULL, 0x7fff7fff71c67fffULL, },
+ { 0x4fa56c187fff4fa5ULL, 0x6c187fff4fa56c18ULL, },
+ { 0x4fa46c177fff4fa4ULL, 0x6c177fff4fa46c17ULL, },
+ { 0x38e371c77fff38e3ULL, 0x71c77fff38e371c7ULL, },
+ { 0x38e271c87fff38e2ULL, 0x71c87fff38e271c8ULL, },
+ { 0x7fff326850c47fffULL, 0x7fff16bc030a7fffULL, }, /* 64 */
+ { 0x7bd8199775f57fffULL, 0x5e5e504416c47fffULL, },
+ { 0x7fff6a8a6e937fffULL, 0x733f445f565a7508ULL, },
+ { 0x7fff2f817fff72f2ULL, 0x7fff7fff58436d54ULL, },
+ { 0x7bd8199775f57fffULL, 0x5e5e504416c47fffULL, },
+ { 0x088400c67fff71f0ULL, 0x25ee7fff2a7e7fffULL, },
+ { 0x57e851b97fff7fffULL, 0x3acf7de76a147810ULL, },
+ { 0x749116b07fff56aaULL, 0x7fff7fff6bfd705cULL, },
+ { 0x7fff6a8a6e937fffULL, 0x733f445f565a7508ULL, }, /* 72 */
+ { 0x57e851b97fff7fffULL, 0x3acf7de76a147810ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x4fb072027fff4a28ULL, },
+ { 0x7fff67a37fff7fffULL, 0x7fff7fff7fff4274ULL, },
+ { 0x7fff2f817fff72f2ULL, 0x7fff7fff58436d54ULL, },
+ { 0x749116b07fff56aaULL, 0x7fff7fff6bfd705cULL, },
+ { 0x7fff67a37fff7fffULL, 0x7fff7fff7fff4274ULL, },
+ { 0x7fff2c9a7fff3b64ULL, 0x7fff7fff7fff3ac0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c
new file mode 100644
index 0000000000..9e483e0754
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_a_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_A.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_A.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 0 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x5555555755555557ULL, 0x5555555755555557ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x3333333533333335ULL, 0x3333333533333335ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x1c71c71e71c71c73ULL, 0x38e38e391c71c71eULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e3a1c71c71dULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x5555555755555557ULL, 0x5555555755555557ULL, }, /* 16 */
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x71c71c737fffffffULL, 0x7fffffff71c71c73ULL, },
+ { 0x71c71c727fffffffULL, 0x7fffffff71c71c72ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x71c71c727fffffffULL, 0x7fffffff71c71c72ULL, },
+ { 0x71c71c717fffffffULL, 0x7fffffff71c71c71ULL, },
+ { 0x3333333533333335ULL, 0x3333333533333335ULL, }, /* 32 */
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x6666666866666668ULL, 0x6666666866666668ULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x4fa4fa517fffffffULL, 0x6c16c16c4fa4fa51ULL, },
+ { 0x4fa4fa507fffffffULL, 0x6c16c16d4fa4fa50ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x4fa4fa507fffffffULL, 0x6c16c16b4fa4fa50ULL, },
+ { 0x4fa4fa4f7fffffffULL, 0x6c16c16c4fa4fa4fULL, },
+ { 0x1c71c71e71c71c73ULL, 0x38e38e391c71c71eULL, }, /* 48 */
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x71c71c737fffffffULL, 0x7fffffff71c71c73ULL, },
+ { 0x71c71c727fffffffULL, 0x7fffffff71c71c72ULL, },
+ { 0x4fa4fa517fffffffULL, 0x6c16c16c4fa4fa51ULL, },
+ { 0x4fa4fa507fffffffULL, 0x6c16c16b4fa4fa50ULL, },
+ { 0x38e38e3a7fffffffULL, 0x71c71c7038e38e3aULL, },
+ { 0x38e38e397fffffffULL, 0x71c71c7138e38e39ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e3a1c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x71c71c727fffffffULL, 0x7fffffff71c71c72ULL, },
+ { 0x71c71c717fffffffULL, 0x7fffffff71c71c71ULL, },
+ { 0x4fa4fa507fffffffULL, 0x6c16c16d4fa4fa50ULL, },
+ { 0x4fa4fa4f7fffffffULL, 0x6c16c16c4fa4fa4fULL, },
+ { 0x38e38e397fffffffULL, 0x71c71c7138e38e39ULL, },
+ { 0x38e38e387fffffffULL, 0x71c71c7238e38e38ULL, },
+ { 0x7fffffff50c4aa80ULL, 0x7fffffff03089fe8ULL, }, /* 64 */
+ { 0x7bd718d175f61c48ULL, 0x5e5ec67816c3a2f0ULL, },
+ { 0x7fffffff6e92c9c0ULL, 0x733fd25d56592ae0ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff58416d54ULL, },
+ { 0x7bd718d175f61c48ULL, 0x5e5ec67816c3a2f0ULL, },
+ { 0x0883ff3a7fffffffULL, 0x25ef76342a7ea5f8ULL, },
+ { 0x57e750f37fffffffULL, 0x3ad082196a142de8ULL, },
+ { 0x749115ea7fffffffULL, 0x7fffffff6bfc705cULL, },
+ { 0x7fffffff6e92c9c0ULL, 0x733fd25d56592ae0ULL, }, /* 72 */
+ { 0x57e750f37fffffffULL, 0x3ad082196a142de8ULL, },
+ { 0x7fffffff7fffffffULL, 0x4fb18dfe7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff58416d54ULL, },
+ { 0x749115ea7fffffffULL, 0x7fffffff6bfc705cULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_A_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c
new file mode 100644
index 0000000000..955815bf45
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xa9a9a9a9a9a9a9a9ULL, 0xa9a9a9a9a9a9a9a9ULL, },
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, },
+ { 0xcbcbcbcbcbcbcbcbULL, 0xcbcbcbcbcbcbcbcbULL, },
+ { 0x3232323232323232ULL, 0x3232323232323232ULL, },
+ { 0xe28d37e28d37e28dULL, 0x37e28d37e28d37e2ULL, },
+ { 0x1b70c61b70c61b70ULL, 0xc61b70c61b70c61bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xa9a9a9a9a9a9a9a9ULL, 0xa9a9a9a9a9a9a9a9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8d80e28d80e28d80ULL, 0xe28d80e28d80e28dULL, },
+ { 0xc61b80c61b80c61bULL, 0x80c61b80c61b80c6ULL, },
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x2121212121212121ULL, 0x2121212121212121ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x38e37f38e37f38e3ULL, 0x7f38e37f38e37f38ULL, },
+ { 0x717f1c717f1c717fULL, 0x1c717f1c717f1c71ULL, },
+ { 0xcbcbcbcbcbcbcbcbULL, 0xcbcbcbcbcbcbcbcbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x2121212121212121ULL, 0x2121212121212121ULL, },
+ { 0x9898989898989898ULL, 0x9898989898989898ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaf8004af8004af80ULL, 0x04af8004af8004afULL, },
+ { 0xe83d93e83d93e83dULL, 0x93e83d93e83d93e8ULL, },
+ { 0x3232323232323232ULL, 0x3232323232323232ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16b16c16b16c1ULL, 0x6b16c16b16c16b16ULL, },
+ { 0x4f7ffa4f7ffa4f7fULL, 0xfa4f7ffa4f7ffa4fULL, },
+ { 0xe28d37e28d37e28dULL, 0x37e28d37e28d37e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8d80e28d80e28d80ULL, 0xe28d80e28d80e28dULL, },
+ { 0x38e37f38e37f38e3ULL, 0x7f38e37f38e37f38ULL, },
+ { 0xaf8004af8004af80ULL, 0x04af8004af8004afULL, },
+ { 0x16c16b16c16b16c1ULL, 0x6b16c16b16c16b16ULL, },
+ { 0xc68070c68070c680ULL, 0x70c68070c68070c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1b70c61b70c61b70ULL, 0xc61b70c61b70c61bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc61b80c61b80c61bULL, 0x80c61b80c61b80c6ULL, },
+ { 0x717f1c717f1c717fULL, 0x1c717f1c717f1c71ULL, },
+ { 0xe83d93e83d93e83dULL, 0x93e83d93e83d93e8ULL, },
+ { 0x4f7ffa4f7ffa4f7fULL, 0xfa4f7ffa4f7ffa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x387f8e387f8e387fULL, 0x8e387f8e387f8e38ULL, },
+ { 0x807fcc98507f7f7fULL, 0x7f7f167ffc7f8018ULL, }, /* 64 */
+ { 0x8328e62f75f51c48ULL, 0x5d5ec678137f0208ULL, },
+ { 0x807f9480e131e0c0ULL, 0x723fd15da97fd520ULL, },
+ { 0xf87ffc197f7f377fULL, 0xd8589336a77f92acULL, },
+ { 0x8328e62f75f51c48ULL, 0x5d5ec678137f0208ULL, },
+ { 0xf680007f7f808e10ULL, 0x24ee80342a7e7ff8ULL, },
+ { 0xa718ae0d06808088ULL, 0x39cf8119c06a7710ULL, },
+ { 0x6b0d167f7fc4a956ULL, 0x9fe880f2be7f349cULL, },
+ { 0x807f9480e131e0c0ULL, 0x723fd15da97fd520ULL, }, /* 72 */
+ { 0xa718ae0d06808088ULL, 0x39cf8119c06a7710ULL, },
+ { 0x807f8080809e8080ULL, 0x4eb08cfe80564a28ULL, },
+ { 0x1c7fc4f7170080ceULL, 0xb4c980d7806d07b4ULL, },
+ { 0xf87ffc197f7f377fULL, 0xd8589336a77f92acULL, },
+ { 0x6b0d167f7fc4a956ULL, 0x9fe880f2be7f349cULL, },
+ { 0x1c7fc4f7170080ceULL, 0xb4c980d7806d07b4ULL, },
+ { 0x7f7f2c7f7f62c47fULL, 0x80e280b0807fc480ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c
new file mode 100644
index 0000000000..0795f7e2c5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaa9ULL, 0xaaaaaaaaaaaaaaa9ULL, },
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, },
+ { 0xcccccccccccccccbULL, 0xcccccccccccccccbULL, },
+ { 0x3333333333333332ULL, 0x3333333333333332ULL, },
+ { 0xe38e38e38e38e38dULL, 0x38e38e38e38e38e2ULL, },
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaa9ULL, 0xaaaaaaaaaaaaaaa9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0xc71c71c71c71c71bULL, 0x8000000000000000ULL, },
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x2222222222222221ULL, 0x2222222222222221ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x38e38e38e38e38e3ULL, 0x7fffffffffffffffULL, },
+ { 0x71c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xcccccccccccccccbULL, 0xcccccccccccccccbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x2222222222222221ULL, 0x2222222222222221ULL, },
+ { 0x9999999999999998ULL, 0x9999999999999998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xb05b05b05b05b05aULL, 0x05b05b05b05b05afULL, },
+ { 0xe93e93e93e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x3333333333333332ULL, 0x3333333333333332ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16c16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xe38e38e38e38e38dULL, 0x38e38e38e38e38e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0x38e38e38e38e38e3ULL, 0x7fffffffffffffffULL, },
+ { 0xb05b05b05b05b05aULL, 0x05b05b05b05b05afULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16c16c16c16ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71c71bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71bULL, 0x8000000000000000ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe93e93e93e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e2ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x8000000000000000ULL, 0x7fffffffffffffffULL, }, /* 64 */
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67913bb0308ULL, },
+ { 0x8000000000000000ULL, 0x733fd25ea9a6d520ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589437a7be92acULL, },
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67913bb0308ULL, },
+ { 0xf77c00c69b278e10ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0xa818af0e07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x6c0d16b0abc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0x8000000000000000ULL, 0x733fd25ea9a6d520ULL, }, /* 72 */
+ { 0xa818af0e07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x8000000000000000ULL, 0x4fb18dff56564a28ULL, },
+ { 0x1ca9c4f818016dceULL, 0xb5ca4fd8546e07b4ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589437a7be92acULL, },
+ { 0x6c0d16b0abc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0x1ca9c4f818016dceULL, 0xb5ca4fd8546e07b4ULL, },
+ { 0x7fffffffffffffffULL, 0x8000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c
new file mode 100644
index 0000000000..793c5afb8c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaa9aaa9aaa9aaa9ULL, 0xaaa9aaa9aaa9aaa9ULL, },
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, },
+ { 0xcccbcccbcccbcccbULL, 0xcccbcccbcccbcccbULL, },
+ { 0x3332333233323332ULL, 0x3332333233323332ULL, },
+ { 0xe38d38e28e37e38dULL, 0x38e28e37e38d38e2ULL, },
+ { 0x1c70c71b71c61c70ULL, 0xc71b71c61c70c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaa9aaa9aaa9aaa9ULL, 0xaaa9aaa9aaa9aaa9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8e38e38d80008e38ULL, 0xe38d80008e38e38dULL, },
+ { 0xc71b80001c71c71bULL, 0x80001c71c71b8000ULL, },
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x38e37fffe38d38e3ULL, 0x7fffe38d38e37fffULL, },
+ { 0x71c61c717fff71c6ULL, 0x1c717fff71c61c71ULL, },
+ { 0xcccbcccbcccbcccbULL, 0xcccbcccbcccbcccbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0x9998999899989998ULL, 0x9998999899989998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xb05a05af8000b05aULL, 0x05af8000b05a05afULL, },
+ { 0xe93d93e83e93e93dULL, 0x93e83e93e93d93e8ULL, },
+ { 0x3332333233323332ULL, 0x3332333233323332ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16c16c16b16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0x4fa4fa4f7fff4fa4ULL, 0xfa4f7fff4fa4fa4fULL, },
+ { 0xe38d38e28e37e38dULL, 0x38e28e37e38d38e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8e38e38d80008e38ULL, 0xe38d80008e38e38dULL, },
+ { 0x38e37fffe38d38e3ULL, 0x7fffe38d38e37fffULL, },
+ { 0xb05a05af8000b05aULL, 0x05af8000b05a05afULL, },
+ { 0x16c16c16c16b16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0xc71c71c68000c71cULL, 0x71c68000c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c70c71b71c61c70ULL, 0xc71b71c61c70c71bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71b80001c71c71bULL, 0x80001c71c71b8000ULL, },
+ { 0x71c61c717fff71c6ULL, 0x1c717fff71c61c71ULL, },
+ { 0xe93d93e83e93e93dULL, 0x93e83e93e93d93e8ULL, },
+ { 0x4fa4fa4f7fff4fa4ULL, 0xfa4f7fff4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e28e387fff38e2ULL, 0x8e387fff38e28e38ULL, },
+ { 0x8000cd9850c47fffULL, 0x7fff16bcfcf68000ULL, }, /* 64 */
+ { 0x8428e72f75f51c48ULL, 0x5e5ec67813ba0308ULL, },
+ { 0x80009576e231e0c0ULL, 0x733fd25da9a6d520ULL, },
+ { 0xf8b9fd197fff378eULL, 0xd9589436a7bd92acULL, },
+ { 0x8428e72f75f51c48ULL, 0x5e5ec67813ba0308ULL, },
+ { 0xf77c00c67fff8e10ULL, 0x25ee80002a7e7fffULL, },
+ { 0xa818af0d07628000ULL, 0x3acf8219c06a7810ULL, },
+ { 0x6c0d16b07fffa956ULL, 0xa0e88000be81359cULL, },
+ { 0x80009576e231e0c0ULL, 0x733fd25da9a6d520ULL, }, /* 72 */
+ { 0xa818af0d07628000ULL, 0x3acf8219c06a7810ULL, },
+ { 0x8000800080008000ULL, 0x4fb08dfe80004a28ULL, },
+ { 0x1ca9c4f718008000ULL, 0xb5c98000800007b4ULL, },
+ { 0xf8b9fd197fff378eULL, 0xd9589436a7bd92acULL, },
+ { 0x6c0d16b07fffa956ULL, 0xa0e88000be81359cULL, },
+ { 0x1ca9c4f718008000ULL, 0xb5c98000800007b4ULL, },
+ { 0x7fff2c9a7fffc49cULL, 0x800080008000c540ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c
new file mode 100644
index 0000000000..1c72c84669
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaa9aaaaaaa9ULL, 0xaaaaaaa9aaaaaaa9ULL, },
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, },
+ { 0xcccccccbcccccccbULL, 0xcccccccbcccccccbULL, },
+ { 0x3333333233333332ULL, 0x3333333233333332ULL, },
+ { 0xe38e38e28e38e38dULL, 0x38e38e37e38e38e2ULL, },
+ { 0x1c71c71b71c71c70ULL, 0xc71c71c61c71c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaa9aaaaaaa9ULL, 0xaaaaaaa9aaaaaaa9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8e38e38d80000000ULL, 0xe38e38e28e38e38dULL, },
+ { 0xc71c71c61c71c71bULL, 0x80000000c71c71c6ULL, },
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x38e38e38e38e38e3ULL, 0x7fffffff38e38e38ULL, },
+ { 0x71c71c717fffffffULL, 0x1c71c71c71c71c71ULL, },
+ { 0xcccccccbcccccccbULL, 0xcccccccbcccccccbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0x9999999899999998ULL, 0x9999999899999998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xb05b05af80000000ULL, 0x05b05b04b05b05afULL, },
+ { 0xe93e93e83e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x3333333233333332ULL, 0x3333333233333332ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0x4fa4fa4f7fffffffULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xe38e38e28e38e38dULL, 0x38e38e37e38e38e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8e38e38d80000000ULL, 0xe38e38e28e38e38dULL, },
+ { 0x38e38e38e38e38e3ULL, 0x7fffffff38e38e38ULL, },
+ { 0xb05b05af80000000ULL, 0x05b05b04b05b05afULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0xc71c71c680000000ULL, 0x71c71c70c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71b71c71c70ULL, 0xc71c71c61c71c71bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c61c71c71bULL, 0x80000000c71c71c6ULL, },
+ { 0x71c71c717fffffffULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe93e93e83e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x4fa4fa4f7fffffffULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e38e387fffffffULL, 0x8e38e38e38e38e38ULL, },
+ { 0x8000000050c4aa80ULL, 0x7ffffffffcf76018ULL, }, /* 64 */
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67813bb0308ULL, },
+ { 0x80000000e231e0c0ULL, 0x733fd25da9a6d520ULL, },
+ { 0xf8b9fd197fffffffULL, 0xd9589436a7be92acULL, },
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67813bb0308ULL, },
+ { 0xf77c00c67fffffffULL, 0x25ef76342a7ea5f8ULL, },
+ { 0xa818af0d07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x6c0d16b07fffffffULL, 0xa0e943f2be82359cULL, },
+ { 0x80000000e231e0c0ULL, 0x733fd25da9a6d520ULL, }, /* 72 */
+ { 0xa818af0d07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x8000000080000000ULL, 0x4fb18dfe80000000ULL, },
+ { 0x1ca9c4f718016dceULL, 0xb5ca4fd780000000ULL, },
+ { 0xf8b9fd197fffffffULL, 0xd9589436a7be92acULL, },
+ { 0x6c0d16b07fffffffULL, 0xa0e943f2be82359cULL, },
+ { 0x1ca9c4f718016dceULL, 0xb5ca4fd780000000ULL, },
+ { 0x7fffffff7fffffffULL, 0x8000000080000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c
new file mode 100644
index 0000000000..f20340799e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xffffe2ffffe2ffffULL, 0xe2ffffe2ffffe2ffULL, },
+ { 0xc6ffffc6ffffc6ffULL, 0xffc6ffffc6ffffc6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffe38dffe38dffe3ULL, 0x8dffe38dffe38dffULL, },
+ { 0x71c6ff71c6ff71c6ULL, 0xff71c6ff71c6ff71ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe8ffffe8ffffe8ffULL, 0xffe8ffffe8ffffe8ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xffc16bffc16bffc1ULL, 0x6bffc16bffc16bffULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffe2ffffe2ffffULL, 0xe2ffffe2ffffe2ffULL, },
+ { 0xffe38dffe38dffe3ULL, 0x8dffe38dffe38dffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffc16bffc16bffc1ULL, 0x6bffc16bffc16bffULL, },
+ { 0xffff70ffff70ffffULL, 0x70ffff70ffff70ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc6ffffc6ffffc6ffULL, 0xffc6ffffc6ffffc6ULL, },
+ { 0x71c6ff71c6ff71c6ULL, 0xff71c6ff71c6ff71ULL, },
+ { 0xe8ffffe8ffffe8ffULL, 0xffe8ffffe8ffffe8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e2ff38e2ff38e2ULL, 0xff38e2ff38e2ff38ULL, },
+ { 0xffd4ffff50c4aa80ULL, 0x96ce16bcfff6ff18ULL, }, /* 64 */
+ { 0xffffe6ff75f5ff48ULL, 0x5dffc678ffbaffffULL, },
+ { 0xffc4ffffe1ffe0c0ULL, 0x72ffd1ffffa6d520ULL, },
+ { 0xf8b9fcff8693ff8eULL, 0xd8ff93ffffbdffacULL, },
+ { 0xffffe6ff75f5ff48ULL, 0x5dffc678ffbaffffULL, },
+ { 0xffff00c69affff10ULL, 0x24ffff342a7ea4ffULL, },
+ { 0xffffaeffffffff88ULL, 0x39ffffffc06a77ffULL, },
+ { 0xffff16b0abc4ff56ULL, 0x9ffffff2be81ffffULL, },
+ { 0xffc4ffffe1ffe0c0ULL, 0x72ffd1ffffa6d520ULL, }, /* 72 */
+ { 0xffffaeffffffff88ULL, 0x39ffffffc06a77ffULL, },
+ { 0xffb4ffffffffffffULL, 0x4effffffff564a28ULL, },
+ { 0xffa9c4f7ffffffceULL, 0xb4ffffffff6dffb4ULL, },
+ { 0xf8b9fcff8693ff8eULL, 0xd8ff93ffffbdffacULL, },
+ { 0xffff16b0abc4ff56ULL, 0x9ffffff2be81ffffULL, },
+ { 0xffa9c4f7ffffffceULL, 0xb4ffffffff6dffb4ULL, },
+ { 0xe09e2c9abc62ff9cULL, 0xffffffffff84ffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c
new file mode 100644
index 0000000000..30249edca0
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e38e38e38dULL, },
+ { 0xc71c71c71c71c71bULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0x8e38e38e38e38e38ULL, },
+ { 0x71c71c71c71c71c6ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe93e93e93e93e93dULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xffffffffffffffffULL, 0x6c16c16c16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e38e38e38dULL, },
+ { 0xffffffffffffffffULL, 0x8e38e38e38e38e38ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x6c16c16c16c16c16ULL, },
+ { 0xffffffffffffffffULL, 0x71c71c71c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71bULL, 0xffffffffffffffffULL, },
+ { 0x71c71c71c71c71c6ULL, 0xffffffffffffffffULL, },
+ { 0xe93e93e93e93e93dULL, 0xffffffffffffffffULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e2ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x96ce16bdfcf76018ULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x5e5ec67913bb0308ULL, },
+ { 0xffffffffffffffffULL, 0x733fd25ea9a6d520ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589437a7be92acULL, },
+ { 0xffffffffffffffffULL, 0x5e5ec67913bb0308ULL, },
+ { 0xffffffffffffffffULL, 0x25ef76342a7ea5f8ULL, },
+ { 0xffffffffffffffffULL, 0x3ad08219c06a7810ULL, },
+ { 0xffffffffffffffffULL, 0xa0e943f2be82359cULL, },
+ { 0xffffffffffffffffULL, 0x733fd25ea9a6d520ULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x3ad08219c06a7810ULL, },
+ { 0xffffffffffffffffULL, 0x4fb18dff56564a28ULL, },
+ { 0xffffffffffffffffULL, 0xb5ca4fd8546e07b4ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589437a7be92acULL, },
+ { 0xffffffffffffffffULL, 0xa0e943f2be82359cULL, },
+ { 0xffffffffffffffffULL, 0xb5ca4fd8546e07b4ULL, },
+ { 0xe09e2c9abc63c49cULL, 0xffffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c
new file mode 100644
index 0000000000..1bd8aa9d20
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xffffe38dffffffffULL, 0xe38dffffffffe38dULL, },
+ { 0xc71bffffffffc71bULL, 0xffffffffc71bffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffff8e38e38dffffULL, 0x8e38e38dffff8e38ULL, },
+ { 0x71c6ffffc71c71c6ULL, 0xffffc71c71c6ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe93dffffffffe93dULL, 0xffffffffe93dffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xffff6c16c16bffffULL, 0x6c16c16bffff6c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffe38dffffffffULL, 0xe38dffffffffe38dULL, },
+ { 0xffff8e38e38dffffULL, 0x8e38e38dffff8e38ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffff6c16c16bffffULL, 0x6c16c16bffff6c16ULL, },
+ { 0xffff71c6ffffffffULL, 0x71c6ffffffff71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71bffffffffc71bULL, 0xffffffffc71bffffULL, },
+ { 0x71c6ffffc71c71c6ULL, 0xffffc71c71c6ffffULL, },
+ { 0xe93dffffffffe93dULL, 0xffffffffe93dffffULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e2ffffe38e38e2ULL, 0xffffe38e38e2ffffULL, },
+ { 0xffffffff50c4aa80ULL, 0x96ce16bcffffffffULL, }, /* 64 */
+ { 0xffffe72f75f5ffffULL, 0x5e5ec678ffffffffULL, },
+ { 0xffffffffe231e0c0ULL, 0x733fd25dffffd520ULL, },
+ { 0xf8b9fd198693ffffULL, 0xd9589436ffffffffULL, },
+ { 0xffffe72f75f5ffffULL, 0x5e5ec678ffffffffULL, },
+ { 0xffff00c69b26ffffULL, 0x25eeffff2a7ea5f8ULL, },
+ { 0xffffaf0dffffffffULL, 0x3acfffffc06a7810ULL, },
+ { 0xffff16b0abc4ffffULL, 0xa0e8ffffbe81ffffULL, },
+ { 0xffffffffe231e0c0ULL, 0x733fd25dffffd520ULL, }, /* 72 */
+ { 0xffffaf0dffffffffULL, 0x3acfffffc06a7810ULL, },
+ { 0xffffffffffffffffULL, 0x4fb0ffffffff4a28ULL, },
+ { 0xffffc4f7ffffffffULL, 0xb5c9ffffffffffffULL, },
+ { 0xf8b9fd198693ffffULL, 0xd9589436ffffffffULL, },
+ { 0xffff16b0abc4ffffULL, 0xa0e8ffffbe81ffffULL, },
+ { 0xffffc4f7ffffffffULL, 0xb5c9ffffffffffffULL, },
+ { 0xe09e2c9abc62ffffULL, 0xffffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c
new file mode 100644
index 0000000000..a91c69f624
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_adds_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDS_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDS_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e2ffffffffULL, },
+ { 0xc71c71c6ffffffffULL, 0xffffffffc71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffe38e38e3ULL, 0x8e38e38dffffffffULL, },
+ { 0x71c71c71c71c71c6ULL, 0xffffffff71c71c71ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe93e93e8ffffffffULL, 0xffffffffe93e93e8ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xffffffffc16c16c1ULL, 0x6c16c16bffffffffULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e2ffffffffULL, },
+ { 0xffffffffe38e38e3ULL, 0x8e38e38dffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffc16c16c1ULL, 0x6c16c16bffffffffULL, },
+ { 0xffffffffffffffffULL, 0x71c71c70ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c6ffffffffULL, 0xffffffffc71c71c6ULL, },
+ { 0x71c71c71c71c71c6ULL, 0xffffffff71c71c71ULL, },
+ { 0xe93e93e8ffffffffULL, 0xffffffffe93e93e8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e2ULL, 0xffffffff38e38e38ULL, },
+ { 0xffffffff50c4aa80ULL, 0x96ce16bcffffffffULL, }, /* 64 */
+ { 0xffffffff75f61c48ULL, 0x5e5ec678ffffffffULL, },
+ { 0xffffffffe231e0c0ULL, 0x733fd25dffffffffULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589436ffffffffULL, },
+ { 0xffffffff75f61c48ULL, 0x5e5ec678ffffffffULL, },
+ { 0xffffffff9b278e10ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0xffffffffffffffffULL, 0x3ad08219c06a7810ULL, },
+ { 0xffffffffabc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0xffffffffe231e0c0ULL, 0x733fd25dffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x3ad08219c06a7810ULL, },
+ { 0xffffffffffffffffULL, 0x4fb18dfeffffffffULL, },
+ { 0xffffffffffffffffULL, 0xb5ca4fd7ffffffffULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589436ffffffffULL, },
+ { 0xffffffffabc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0xffffffffffffffffULL, 0xb5ca4fd7ffffffffULL, },
+ { 0xe09e2c9abc63c49cULL, 0xffffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDS_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c
new file mode 100644
index 0000000000..2f11c76aa3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xa9a9a9a9a9a9a9a9ULL, 0xa9a9a9a9a9a9a9a9ULL, },
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, },
+ { 0xcbcbcbcbcbcbcbcbULL, 0xcbcbcbcbcbcbcbcbULL, },
+ { 0x3232323232323232ULL, 0x3232323232323232ULL, },
+ { 0xe28d37e28d37e28dULL, 0x37e28d37e28d37e2ULL, },
+ { 0x1b70c61b70c61b70ULL, 0xc61b70c61b70c61bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xa9a9a9a9a9a9a9a9ULL, 0xa9a9a9a9a9a9a9a9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7676767676767676ULL, 0x7676767676767676ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8d38e28d38e28d38ULL, 0xe28d38e28d38e28dULL, },
+ { 0xc61b71c61b71c61bULL, 0x71c61b71c61b71c6ULL, },
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2121212121212121ULL, 0x2121212121212121ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x38e38d38e38d38e3ULL, 0x8d38e38d38e38d38ULL, },
+ { 0x71c61c71c61c71c6ULL, 0x1c71c61c71c61c71ULL, },
+ { 0xcbcbcbcbcbcbcbcbULL, 0xcbcbcbcbcbcbcbcbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7676767676767676ULL, 0x7676767676767676ULL, },
+ { 0x2121212121212121ULL, 0x2121212121212121ULL, },
+ { 0x9898989898989898ULL, 0x9898989898989898ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaf5a04af5a04af5aULL, 0x04af5a04af5a04afULL, },
+ { 0xe83d93e83d93e83dULL, 0x93e83d93e83d93e8ULL, },
+ { 0x3232323232323232ULL, 0x3232323232323232ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16b16c16b16c1ULL, 0x6b16c16b16c16b16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xe28d37e28d37e28dULL, 0x37e28d37e28d37e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8d38e28d38e28d38ULL, 0xe28d38e28d38e28dULL, },
+ { 0x38e38d38e38d38e3ULL, 0x8d38e38d38e38d38ULL, },
+ { 0xaf5a04af5a04af5aULL, 0x04af5a04af5a04afULL, },
+ { 0x16c16b16c16b16c1ULL, 0x6b16c16b16c16b16ULL, },
+ { 0xc61c70c61c70c61cULL, 0x70c61c70c61c70c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1b70c61b70c61b70ULL, 0xc61b70c61b70c61bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc61b71c61b71c61bULL, 0x71c61b71c61b71c6ULL, },
+ { 0x71c61c71c61c71c6ULL, 0x1c71c61c71c61c71ULL, },
+ { 0xe83d93e83d93e83dULL, 0x93e83d93e83d93e8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e28e38e28e38e2ULL, 0x8e38e28e38e28e38ULL, },
+ { 0x10d4cc9850c4aa80ULL, 0x96ce16bcfcf66018ULL, }, /* 64 */
+ { 0x8328e62f75f51c48ULL, 0x5d5ec67813ba0208ULL, },
+ { 0x34c49476e131e0c0ULL, 0x723fd15da9a6d520ULL, },
+ { 0xf8b9fc198693378eULL, 0xd8589336a7bd92acULL, },
+ { 0x8328e62f75f51c48ULL, 0x5d5ec67813ba0208ULL, },
+ { 0xf67c00c69a268e10ULL, 0x24ee76342a7ea4f8ULL, },
+ { 0xa718ae0d06625288ULL, 0x39cf8119c06a7710ULL, },
+ { 0x6b0d16b0abc4a956ULL, 0x9fe843f2be81349cULL, },
+ { 0x34c49476e131e0c0ULL, 0x723fd15da9a6d520ULL, }, /* 72 */
+ { 0xa718ae0d06625288ULL, 0x39cf8119c06a7710ULL, },
+ { 0x58b45c54729e1600ULL, 0x4eb08cfe56564a28ULL, },
+ { 0x1ca9c4f717006dceULL, 0xb4c94ed7546d07b4ULL, },
+ { 0xf8b9fc198693378eULL, 0xd8589336a7bd92acULL, },
+ { 0x6b0d16b0abc4a956ULL, 0x9fe843f2be81349cULL, },
+ { 0x1ca9c4f717006dceULL, 0xb4c94ed7546d07b4ULL, },
+ { 0xe09e2c9abc62c49cULL, 0x1ae210b05284c440ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c
new file mode 100644
index 0000000000..4ed0b97876
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaa9ULL, 0xaaaaaaaaaaaaaaa9ULL, },
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, },
+ { 0xcccccccccccccccbULL, 0xcccccccccccccccbULL, },
+ { 0x3333333333333332ULL, 0x3333333333333332ULL, },
+ { 0xe38e38e38e38e38dULL, 0x38e38e38e38e38e2ULL, },
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaa9ULL, 0xaaaaaaaaaaaaaaa9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7777777777777776ULL, 0x7777777777777776ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0xc71c71c71c71c71bULL, 0x71c71c71c71c71c6ULL, },
+ { 0x5555555555555554ULL, 0x5555555555555554ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2222222222222221ULL, 0x2222222222222221ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xcccccccccccccccbULL, 0xcccccccccccccccbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7777777777777776ULL, 0x7777777777777776ULL, },
+ { 0x2222222222222221ULL, 0x2222222222222221ULL, },
+ { 0x9999999999999998ULL, 0x9999999999999998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xb05b05b05b05b05aULL, 0x05b05b05b05b05afULL, },
+ { 0xe93e93e93e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x3333333333333332ULL, 0x3333333333333332ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16c16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xe38e38e38e38e38dULL, 0x38e38e38e38e38e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e38ULL, },
+ { 0xb05b05b05b05b05aULL, 0x05b05b05b05b05afULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16c16c16c16ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c70ULL, 0xc71c71c71c71c71bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71bULL, 0x71c71c71c71c71c6ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe93e93e93e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e2ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x10d5cd9850c4aa80ULL, 0x96ce16bdfcf76018ULL, }, /* 64 */
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67913bb0308ULL, },
+ { 0x34c59576e231e0c0ULL, 0x733fd25ea9a6d520ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589437a7be92acULL, },
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67913bb0308ULL, },
+ { 0xf77c00c69b278e10ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0xa818af0e07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x6c0d16b0abc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0x34c59576e231e0c0ULL, 0x733fd25ea9a6d520ULL, }, /* 72 */
+ { 0xa818af0e07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x58b55d55739f1700ULL, 0x4fb18dff56564a28ULL, },
+ { 0x1ca9c4f818016dceULL, 0xb5ca4fd8546e07b4ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589437a7be92acULL, },
+ { 0x6c0d16b0abc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0x1ca9c4f818016dceULL, 0xb5ca4fd8546e07b4ULL, },
+ { 0xe09e2c9abc63c49cULL, 0x1be311b15285c540ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c
new file mode 100644
index 0000000000..ca6ddd4b54
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaa9aaa9aaa9aaa9ULL, 0xaaa9aaa9aaa9aaa9ULL, },
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, },
+ { 0xcccbcccbcccbcccbULL, 0xcccbcccbcccbcccbULL, },
+ { 0x3332333233323332ULL, 0x3332333233323332ULL, },
+ { 0xe38d38e28e37e38dULL, 0x38e28e37e38d38e2ULL, },
+ { 0x1c70c71b71c61c70ULL, 0xc71b71c61c70c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaa9aaa9aaa9aaa9ULL, 0xaaa9aaa9aaa9aaa9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7776777677767776ULL, 0x7776777677767776ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8e38e38d38e28e38ULL, 0xe38d38e28e38e38dULL, },
+ { 0xc71b71c61c71c71bULL, 0x71c61c71c71b71c6ULL, },
+ { 0x5554555455545554ULL, 0x5554555455545554ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x38e38e38e38d38e3ULL, 0x8e38e38d38e38e38ULL, },
+ { 0x71c61c71c71c71c6ULL, 0x1c71c71c71c61c71ULL, },
+ { 0xcccbcccbcccbcccbULL, 0xcccbcccbcccbcccbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7776777677767776ULL, 0x7776777677767776ULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0x9998999899989998ULL, 0x9998999899989998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xb05a05af5b04b05aULL, 0x05af5b04b05a05afULL, },
+ { 0xe93d93e83e93e93dULL, 0x93e83e93e93d93e8ULL, },
+ { 0x3332333233323332ULL, 0x3332333233323332ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16c16c16b16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xe38d38e28e37e38dULL, 0x38e28e37e38d38e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8e38e38d38e28e38ULL, 0xe38d38e28e38e38dULL, },
+ { 0x38e38e38e38d38e3ULL, 0x8e38e38d38e38e38ULL, },
+ { 0xb05a05af5b04b05aULL, 0x05af5b04b05a05afULL, },
+ { 0x16c16c16c16b16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0xc71c71c61c70c71cULL, 0x71c61c70c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c70c71b71c61c70ULL, 0xc71b71c61c70c71bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71b71c61c71c71bULL, 0x71c61c71c71b71c6ULL, },
+ { 0x71c61c71c71c71c6ULL, 0x1c71c71c71c61c71ULL, },
+ { 0xe93d93e83e93e93dULL, 0x93e83e93e93d93e8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e28e38e38e38e2ULL, 0x8e38e38e38e28e38ULL, },
+ { 0x10d4cd9850c4aa80ULL, 0x96ce16bcfcf66018ULL, }, /* 64 */
+ { 0x8428e72f75f51c48ULL, 0x5e5ec67813ba0308ULL, },
+ { 0x34c49576e231e0c0ULL, 0x733fd25da9a6d520ULL, },
+ { 0xf8b9fd198693378eULL, 0xd9589436a7bd92acULL, },
+ { 0x8428e72f75f51c48ULL, 0x5e5ec67813ba0308ULL, },
+ { 0xf77c00c69b268e10ULL, 0x25ee76342a7ea5f8ULL, },
+ { 0xa818af0d07625288ULL, 0x3acf8219c06a7810ULL, },
+ { 0x6c0d16b0abc4a956ULL, 0xa0e843f2be81359cULL, },
+ { 0x34c49576e231e0c0ULL, 0x733fd25da9a6d520ULL, }, /* 72 */
+ { 0xa818af0d07625288ULL, 0x3acf8219c06a7810ULL, },
+ { 0x58b45d54739e1700ULL, 0x4fb08dfe56564a28ULL, },
+ { 0x1ca9c4f718006dceULL, 0xb5c94fd7546d07b4ULL, },
+ { 0xf8b9fd198693378eULL, 0xd9589436a7bd92acULL, },
+ { 0x6c0d16b0abc4a956ULL, 0xa0e843f2be81359cULL, },
+ { 0x1ca9c4f718006dceULL, 0xb5c94fd7546d07b4ULL, },
+ { 0xe09e2c9abc62c49cULL, 0x1be211b05284c540ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c
new file mode 100644
index 0000000000..dff0f70a07
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_addv_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ADDV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "ADDV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaa9aaaaaaa9ULL, 0xaaaaaaa9aaaaaaa9ULL, },
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, },
+ { 0xcccccccbcccccccbULL, 0xcccccccbcccccccbULL, },
+ { 0x3333333233333332ULL, 0x3333333233333332ULL, },
+ { 0xe38e38e28e38e38dULL, 0x38e38e37e38e38e2ULL, },
+ { 0x1c71c71b71c71c70ULL, 0xc71c71c61c71c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaa9aaaaaaa9ULL, 0xaaaaaaa9aaaaaaa9ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7777777677777776ULL, 0x7777777677777776ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8e38e38d38e38e38ULL, 0xe38e38e28e38e38dULL, },
+ { 0xc71c71c61c71c71bULL, 0x71c71c71c71c71c6ULL, },
+ { 0x5555555455555554ULL, 0x5555555455555554ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38d38e38e38ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xcccccccbcccccccbULL, 0xcccccccbcccccccbULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7777777677777776ULL, 0x7777777677777776ULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0x9999999899999998ULL, 0x9999999899999998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xb05b05af5b05b05aULL, 0x05b05b04b05b05afULL, },
+ { 0xe93e93e83e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x3333333233333332ULL, 0x3333333233333332ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xe38e38e28e38e38dULL, 0x38e38e37e38e38e2ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8e38e38d38e38e38ULL, 0xe38e38e28e38e38dULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38d38e38e38ULL, },
+ { 0xb05b05af5b05b05aULL, 0x05b05b04b05b05afULL, },
+ { 0x16c16c16c16c16c1ULL, 0x6c16c16b16c16c16ULL, },
+ { 0xc71c71c61c71c71cULL, 0x71c71c70c71c71c6ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71b71c71c70ULL, 0xc71c71c61c71c71bULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c61c71c71bULL, 0x71c71c71c71c71c6ULL, },
+ { 0x71c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe93e93e83e93e93dULL, 0x93e93e93e93e93e8ULL, },
+ { 0x4fa4fa4fa4fa4fa4ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e2ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x10d5cd9850c4aa80ULL, 0x96ce16bcfcf76018ULL, }, /* 64 */
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67813bb0308ULL, },
+ { 0x34c59576e231e0c0ULL, 0x733fd25da9a6d520ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589436a7be92acULL, },
+ { 0x8428e72f75f61c48ULL, 0x5e5ec67813bb0308ULL, },
+ { 0xf77c00c69b278e10ULL, 0x25ef76342a7ea5f8ULL, },
+ { 0xa818af0d07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x6c0d16b0abc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0x34c59576e231e0c0ULL, 0x733fd25da9a6d520ULL, }, /* 72 */
+ { 0xa818af0d07635288ULL, 0x3ad08219c06a7810ULL, },
+ { 0x58b55d54739f1700ULL, 0x4fb18dfe56564a28ULL, },
+ { 0x1ca9c4f718016dceULL, 0xb5ca4fd7546e07b4ULL, },
+ { 0xf8b9fd198694378eULL, 0xd9589436a7be92acULL, },
+ { 0x6c0d16b0abc5a956ULL, 0xa0e943f2be82359cULL, },
+ { 0x1ca9c4f718016dceULL, 0xb5ca4fd7546e07b4ULL, },
+ { 0xe09e2c9abc63c49cULL, 0x1be311b05285c540ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ADDV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c
new file mode 100644
index 0000000000..c50a9dde87
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HADD_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "HADD_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffaaaaaaa9ULL, 0xffffffffaaaaaaa9ULL, },
+ { 0x0000000055555554ULL, 0x0000000055555554ULL, },
+ { 0xffffffffcccccccbULL, 0xffffffffcccccccbULL, },
+ { 0x0000000033333332ULL, 0x0000000033333332ULL, },
+ { 0xffffffff8e38e38dULL, 0xffffffffe38e38e2ULL, },
+ { 0x0000000071c71c70ULL, 0x000000001c71c71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0xffffffff8e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xffffffffaaaaaaa9ULL, 0xffffffffaaaaaaa9ULL, }, /* 16 */
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0xffffffff55555554ULL, 0xffffffff55555554ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff77777776ULL, 0xffffffff77777776ULL, },
+ { 0xffffffffddddddddULL, 0xffffffffddddddddULL, },
+ { 0xffffffff38e38e38ULL, 0xffffffff8e38e38dULL, },
+ { 0x000000001c71c71bULL, 0xffffffffc71c71c6ULL, },
+ { 0x0000000055555554ULL, 0x0000000055555554ULL, }, /* 24 */
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000022222221ULL, 0x0000000022222221ULL, },
+ { 0x0000000088888888ULL, 0x0000000088888888ULL, },
+ { 0xffffffffe38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0x00000000c71c71c6ULL, 0x0000000071c71c71ULL, },
+ { 0xffffffffcccccccbULL, 0xffffffffcccccccbULL, }, /* 32 */
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0xffffffff77777776ULL, 0xffffffff77777776ULL, },
+ { 0x0000000022222221ULL, 0x0000000022222221ULL, },
+ { 0xffffffff99999998ULL, 0xffffffff99999998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff5b05b05aULL, 0xffffffffb05b05afULL, },
+ { 0x000000003e93e93dULL, 0xffffffffe93e93e8ULL, },
+ { 0x0000000033333332ULL, 0x0000000033333332ULL, }, /* 40 */
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0xffffffffddddddddULL, 0xffffffffddddddddULL, },
+ { 0x0000000088888888ULL, 0x0000000088888888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000066666666ULL, 0x0000000066666666ULL, },
+ { 0xffffffffc16c16c1ULL, 0x0000000016c16c16ULL, },
+ { 0x00000000a4fa4fa4ULL, 0x000000004fa4fa4fULL, },
+ { 0xffffffffe38e38e2ULL, 0x0000000038e38e37ULL, }, /* 48 */
+ { 0xffffffffe38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0xffffffff8e38e38dULL, 0xffffffffe38e38e2ULL, },
+ { 0x0000000038e38e38ULL, 0x000000008e38e38dULL, },
+ { 0xffffffffb05b05afULL, 0x0000000005b05b04ULL, },
+ { 0x0000000016c16c16ULL, 0x000000006c16c16bULL, },
+ { 0xffffffff71c71c71ULL, 0x000000001c71c71bULL, },
+ { 0x0000000055555554ULL, 0x0000000055555554ULL, },
+ { 0x000000001c71c71bULL, 0xffffffffc71c71c6ULL, }, /* 56 */
+ { 0x000000001c71c71cULL, 0xffffffffc71c71c7ULL, },
+ { 0xffffffffc71c71c6ULL, 0xffffffff71c71c71ULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xffffffffe93e93e8ULL, 0xffffffff93e93e93ULL, },
+ { 0x000000004fa4fa4fULL, 0xfffffffffa4fa4faULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0x000000008e38e38dULL, 0xffffffffe38e38e3ULL, },
+ { 0xffffffffb0cd3c0cULL, 0x0000000049e2bb6aULL, }, /* 64 */
+ { 0xffffffffd5feadd4ULL, 0x0000000060a65e5aULL, },
+ { 0xffffffff423a724cULL, 0xfffffffff6923072ULL, },
+ { 0xffffffffe69cc91aULL, 0xfffffffff4a9edfeULL, },
+ { 0x00000000242055a3ULL, 0x0000000011736b26ULL, },
+ { 0x000000004951c76bULL, 0x0000000028370e16ULL, },
+ { 0xffffffffb58d8be3ULL, 0xffffffffbe22e02eULL, },
+ { 0x0000000059efe2b1ULL, 0xffffffffbc3a9dbaULL, },
+ { 0xffffffffd4bd03eaULL, 0x000000002654770bULL, }, /* 72 */
+ { 0xfffffffff9ee75b2ULL, 0x000000003d1819fbULL, },
+ { 0xffffffff662a3a2aULL, 0xffffffffd303ec13ULL, },
+ { 0x000000000a8c90f8ULL, 0xffffffffd11ba99fULL, },
+ { 0x0000000098b16b8dULL, 0xffffffff8c6d38e4ULL, },
+ { 0x00000000bde2dd55ULL, 0xffffffffa330dbd4ULL, },
+ { 0x000000002a1ea1cdULL, 0xffffffff391cadecULL, },
+ { 0x00000000ce80f89bULL, 0xffffffff37346b78ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c
new file mode 100644
index 0000000000..586ef923cc
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HADD_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "HADD_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffa9ffa9ffa9ffa9ULL, 0xffa9ffa9ffa9ffa9ULL, },
+ { 0x0054005400540054ULL, 0x0054005400540054ULL, },
+ { 0xffcbffcbffcbffcbULL, 0xffcbffcbffcbffcbULL, },
+ { 0x0032003200320032ULL, 0x0032003200320032ULL, },
+ { 0xff8dffe20037ff8dULL, 0xffe20037ff8dffe2ULL, },
+ { 0x0070001bffc60070ULL, 0x001bffc60070001bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0xff8effe30038ff8eULL, 0xffe30038ff8effe3ULL, },
+ { 0x0071001cffc70071ULL, 0x001cffc70071001cULL, },
+ { 0xffa9ffa9ffa9ffa9ULL, 0xffa9ffa9ffa9ffa9ULL, }, /* 16 */
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0xff54ff54ff54ff54ULL, 0xff54ff54ff54ff54ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff76ff76ff76ff76ULL, 0xff76ff76ff76ff76ULL, },
+ { 0xffddffddffddffddULL, 0xffddffddffddffddULL, },
+ { 0xff38ff8dffe2ff38ULL, 0xff8dffe2ff38ff8dULL, },
+ { 0x001bffc6ff71001bULL, 0xffc6ff71001bffc6ULL, },
+ { 0x0054005400540054ULL, 0x0054005400540054ULL, }, /* 24 */
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0021002100210021ULL, 0x0021002100210021ULL, },
+ { 0x0088008800880088ULL, 0x0088008800880088ULL, },
+ { 0xffe30038008dffe3ULL, 0x0038008dffe30038ULL, },
+ { 0x00c60071001c00c6ULL, 0x0071001c00c60071ULL, },
+ { 0xffcbffcbffcbffcbULL, 0xffcbffcbffcbffcbULL, }, /* 32 */
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0xff76ff76ff76ff76ULL, 0xff76ff76ff76ff76ULL, },
+ { 0x0021002100210021ULL, 0x0021002100210021ULL, },
+ { 0xff98ff98ff98ff98ULL, 0xff98ff98ff98ff98ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff5affaf0004ff5aULL, 0xffaf0004ff5affafULL, },
+ { 0x003dffe8ff93003dULL, 0xffe8ff93003dffe8ULL, },
+ { 0x0032003200320032ULL, 0x0032003200320032ULL, }, /* 40 */
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0xffddffddffddffddULL, 0xffddffddffddffddULL, },
+ { 0x0088008800880088ULL, 0x0088008800880088ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0066006600660066ULL, 0x0066006600660066ULL, },
+ { 0xffc10016006bffc1ULL, 0x0016006bffc10016ULL, },
+ { 0x00a4004ffffa00a4ULL, 0x004ffffa00a4004fULL, },
+ { 0xffe20037ff8dffe2ULL, 0x0037ff8dffe20037ULL, }, /* 48 */
+ { 0xffe30038ff8effe3ULL, 0x0038ff8effe30038ULL, },
+ { 0xff8dffe2ff38ff8dULL, 0xffe2ff38ff8dffe2ULL, },
+ { 0x0038008dffe30038ULL, 0x008dffe30038008dULL, },
+ { 0xffaf0004ff5affafULL, 0x0004ff5affaf0004ULL, },
+ { 0x0016006bffc10016ULL, 0x006bffc10016006bULL, },
+ { 0xff71001bffc6ff71ULL, 0x001bffc6ff71001bULL, },
+ { 0x00540054ff550054ULL, 0x0054ff5500540054ULL, },
+ { 0x001bffc60070001bULL, 0xffc60070001bffc6ULL, }, /* 56 */
+ { 0x001cffc70071001cULL, 0xffc70071001cffc7ULL, },
+ { 0xffc6ff71001bffc6ULL, 0xff71001bffc6ff71ULL, },
+ { 0x0071001c00c60071ULL, 0x001c00c60071001cULL, },
+ { 0xffe8ff93003dffe8ULL, 0xff93003dffe8ff93ULL, },
+ { 0x004ffffa00a4004fULL, 0xfffa00a4004ffffaULL, },
+ { 0xffaaffaa00a9ffaaULL, 0xffaa00a9ffaaffaaULL, },
+ { 0x008dffe30038008dULL, 0xffe30038008dffe3ULL, },
+ { 0xfff2ffb2008a0095ULL, 0x00b200690079ffbcULL, }, /* 64 */
+ { 0xff460049ffbb005dULL, 0x00420025003dffacULL, },
+ { 0xffe2ff90fff7ffd5ULL, 0x0023000a0029ffc4ULL, },
+ { 0xffd70033005900a3ULL, 0x003cffe30040ff50ULL, },
+ { 0x0065ffcc00af0007ULL, 0x007900190090005eULL, },
+ { 0xffb90063ffe0ffcfULL, 0x0009ffd50054004eULL, },
+ { 0x0055ffaa001cff47ULL, 0xffeaffba00400066ULL, },
+ { 0x004a004d007e0015ULL, 0x0003ff930057fff2ULL, },
+ { 0x0016ff7a001bffcbULL, 0x008e002400260031ULL, }, /* 72 */
+ { 0xff6a0011ff4cff93ULL, 0x001effe0ffea0021ULL, },
+ { 0x0006ff58ff88ff0bULL, 0xffffffc5ffd60039ULL, },
+ { 0xfffbfffbffeaffd9ULL, 0x0018ff9effedffc5ULL, },
+ { 0x00daffe200c00022ULL, 0xfff4ffe60024ffeeULL, },
+ { 0x002e0079fff1ffeaULL, 0xff84ffa2ffe8ffdeULL, },
+ { 0x00caffc0002dff62ULL, 0xff65ff87ffd4fff6ULL, },
+ { 0x00bf0063008f0030ULL, 0xff7eff60ffebff82ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c
new file mode 100644
index 0000000000..3589c33940
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HADD_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "HADD_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffaaa9ffffaaa9ULL, 0xffffaaa9ffffaaa9ULL, },
+ { 0x0000555400005554ULL, 0x0000555400005554ULL, },
+ { 0xffffcccbffffcccbULL, 0xffffcccbffffcccbULL, },
+ { 0x0000333200003332ULL, 0x0000333200003332ULL, },
+ { 0x000038e2ffffe38dULL, 0xffff8e37000038e2ULL, },
+ { 0xffffc71b00001c70ULL, 0x000071c6ffffc71bULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x000038e3ffffe38eULL, 0xffff8e38000038e3ULL, },
+ { 0xffffc71c00001c71ULL, 0x000071c7ffffc71cULL, },
+ { 0xffffaaa9ffffaaa9ULL, 0xffffaaa9ffffaaa9ULL, }, /* 16 */
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0xffff5554ffff5554ULL, 0xffff5554ffff5554ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffff7776ffff7776ULL, 0xffff7776ffff7776ULL, },
+ { 0xffffddddffffddddULL, 0xffffddddffffddddULL, },
+ { 0xffffe38dffff8e38ULL, 0xffff38e2ffffe38dULL, },
+ { 0xffff71c6ffffc71bULL, 0x00001c71ffff71c6ULL, },
+ { 0x0000555400005554ULL, 0x0000555400005554ULL, }, /* 24 */
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000222100002221ULL, 0x0000222100002221ULL, },
+ { 0x0000888800008888ULL, 0x0000888800008888ULL, },
+ { 0x00008e38000038e3ULL, 0xffffe38d00008e38ULL, },
+ { 0x00001c71000071c6ULL, 0x0000c71c00001c71ULL, },
+ { 0xffffcccbffffcccbULL, 0xffffcccbffffcccbULL, }, /* 32 */
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0xffff7776ffff7776ULL, 0xffff7776ffff7776ULL, },
+ { 0x0000222100002221ULL, 0x0000222100002221ULL, },
+ { 0xffff9998ffff9998ULL, 0xffff9998ffff9998ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x000005afffffb05aULL, 0xffff5b04000005afULL, },
+ { 0xffff93e8ffffe93dULL, 0x00003e93ffff93e8ULL, },
+ { 0x0000333200003332ULL, 0x0000333200003332ULL, }, /* 40 */
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0xffffddddffffddddULL, 0xffffddddffffddddULL, },
+ { 0x0000888800008888ULL, 0x0000888800008888ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000666600006666ULL, 0x0000666600006666ULL, },
+ { 0x00006c16000016c1ULL, 0xffffc16b00006c16ULL, },
+ { 0xfffffa4f00004fa4ULL, 0x0000a4fafffffa4fULL, },
+ { 0xffffe38dffff8e37ULL, 0x000038e2ffffe38dULL, }, /* 48 */
+ { 0xffffe38effff8e38ULL, 0x000038e3ffffe38eULL, },
+ { 0xffff8e38ffff38e2ULL, 0xffffe38dffff8e38ULL, },
+ { 0x000038e3ffffe38dULL, 0x00008e38000038e3ULL, },
+ { 0xffffb05affff5b04ULL, 0x000005afffffb05aULL, },
+ { 0x000016c1ffffc16bULL, 0x00006c16000016c1ULL, },
+ { 0x00001c71ffff71c6ULL, 0xffffc71b00001c71ULL, },
+ { 0xffffaaaaffffaaa9ULL, 0x0000aaaaffffaaaaULL, },
+ { 0x00001c70000071c6ULL, 0xffffc71b00001c70ULL, }, /* 56 */
+ { 0x00001c71000071c7ULL, 0xffffc71c00001c71ULL, },
+ { 0xffffc71b00001c71ULL, 0xffff71c6ffffc71bULL, },
+ { 0x000071c60000c71cULL, 0x00001c71000071c6ULL, },
+ { 0xffffe93d00003e93ULL, 0xffff93e8ffffe93dULL, },
+ { 0x00004fa40000a4faULL, 0xfffffa4f00004fa4ULL, },
+ { 0x0000555400005555ULL, 0xffff555400005554ULL, },
+ { 0xffffe38d00008e38ULL, 0x000038e3ffffe38dULL, },
+ { 0xffff6f3600007da2ULL, 0x000056c5ffffae87ULL, }, /* 64 */
+ { 0xffff88cdffffef6aULL, 0x0000068100005177ULL, },
+ { 0xffff3714ffffb3e2ULL, 0x000012660000238fULL, },
+ { 0xffff9eb700000ab0ULL, 0xffffd43fffffe11bULL, },
+ { 0xffffe28a0000a2d3ULL, 0x00001e55ffffc54bULL, },
+ { 0xfffffc210000149bULL, 0xffffce110000683bULL, },
+ { 0xffffaa68ffffd913ULL, 0xffffd9f600003a53ULL, },
+ { 0x0000120b00002fe1ULL, 0xffff9bcffffff7dfULL, },
+ { 0xffff932600000f0fULL, 0x00003336ffff5b37ULL, }, /* 72 */
+ { 0xffffacbdffff80d7ULL, 0xffffe2f2fffffe27ULL, },
+ { 0xffff5b04ffff454fULL, 0xffffeed7ffffd03fULL, },
+ { 0xffffc2a7ffff9c1dULL, 0xffffb0b0ffff8dcbULL, },
+ { 0x0000571b0000b371ULL, 0xffff994fffff594eULL, },
+ { 0x000070b200002539ULL, 0xffff490bfffffc3eULL, },
+ { 0x00001ef9ffffe9b1ULL, 0xffff54f0ffffce56ULL, },
+ { 0x0000869c0000407fULL, 0xffff16c9ffff8be2ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c
new file mode 100644
index 0000000000..35b2021347
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HADD_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "HADD_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x00000001fffffffeULL, 0x00000001fffffffeULL, }, /* 0 */
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, },
+ { 0x00000001aaaaaaa9ULL, 0x00000001aaaaaaa9ULL, },
+ { 0x0000000155555554ULL, 0x0000000155555554ULL, },
+ { 0x00000001cccccccbULL, 0x00000001cccccccbULL, },
+ { 0x0000000133333332ULL, 0x0000000133333332ULL, },
+ { 0x000000018e38e38dULL, 0x00000001e38e38e2ULL, },
+ { 0x0000000171c71c70ULL, 0x000000011c71c71bULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x000000008e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0x00000001aaaaaaa9ULL, 0x00000001aaaaaaa9ULL, }, /* 16 */
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000155555554ULL, 0x0000000155555554ULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000177777776ULL, 0x0000000177777776ULL, },
+ { 0x00000000ddddddddULL, 0x00000000ddddddddULL, },
+ { 0x0000000138e38e38ULL, 0x000000018e38e38dULL, },
+ { 0x000000011c71c71bULL, 0x00000000c71c71c6ULL, },
+ { 0x0000000155555554ULL, 0x0000000155555554ULL, }, /* 24 */
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000122222221ULL, 0x0000000122222221ULL, },
+ { 0x0000000088888888ULL, 0x0000000088888888ULL, },
+ { 0x00000000e38e38e3ULL, 0x0000000138e38e38ULL, },
+ { 0x00000000c71c71c6ULL, 0x0000000071c71c71ULL, },
+ { 0x00000001cccccccbULL, 0x00000001cccccccbULL, }, /* 32 */
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000177777776ULL, 0x0000000177777776ULL, },
+ { 0x0000000122222221ULL, 0x0000000122222221ULL, },
+ { 0x0000000199999998ULL, 0x0000000199999998ULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, },
+ { 0x000000015b05b05aULL, 0x00000001b05b05afULL, },
+ { 0x000000013e93e93dULL, 0x00000000e93e93e8ULL, },
+ { 0x0000000133333332ULL, 0x0000000133333332ULL, }, /* 40 */
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x00000000ddddddddULL, 0x00000000ddddddddULL, },
+ { 0x0000000088888888ULL, 0x0000000088888888ULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000066666666ULL, 0x0000000066666666ULL, },
+ { 0x00000000c16c16c1ULL, 0x0000000116c16c16ULL, },
+ { 0x00000000a4fa4fa4ULL, 0x000000004fa4fa4fULL, },
+ { 0x00000001e38e38e2ULL, 0x0000000138e38e37ULL, }, /* 48 */
+ { 0x00000000e38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0x000000018e38e38dULL, 0x00000000e38e38e2ULL, },
+ { 0x0000000138e38e38ULL, 0x000000008e38e38dULL, },
+ { 0x00000001b05b05afULL, 0x0000000105b05b04ULL, },
+ { 0x0000000116c16c16ULL, 0x000000006c16c16bULL, },
+ { 0x0000000171c71c71ULL, 0x000000011c71c71bULL, },
+ { 0x0000000155555554ULL, 0x0000000055555554ULL, },
+ { 0x000000011c71c71bULL, 0x00000001c71c71c6ULL, }, /* 56 */
+ { 0x000000001c71c71cULL, 0x00000000c71c71c7ULL, },
+ { 0x00000000c71c71c6ULL, 0x0000000171c71c71ULL, },
+ { 0x0000000071c71c71ULL, 0x000000011c71c71cULL, },
+ { 0x00000000e93e93e8ULL, 0x0000000193e93e93ULL, },
+ { 0x000000004fa4fa4fULL, 0x00000000fa4fa4faULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000001aaaaaaaaULL, },
+ { 0x000000008e38e38dULL, 0x00000000e38e38e3ULL, },
+ { 0x00000000b0cd3c0cULL, 0x0000000149e2bb6aULL, }, /* 64 */
+ { 0x00000000d5feadd4ULL, 0x0000000060a65e5aULL, },
+ { 0x00000001423a724cULL, 0x00000000f6923072ULL, },
+ { 0x00000000e69cc91aULL, 0x00000000f4a9edfeULL, },
+ { 0x00000001242055a3ULL, 0x0000000111736b26ULL, },
+ { 0x000000014951c76bULL, 0x0000000028370e16ULL, },
+ { 0x00000001b58d8be3ULL, 0x00000000be22e02eULL, },
+ { 0x0000000159efe2b1ULL, 0x00000000bc3a9dbaULL, },
+ { 0x00000000d4bd03eaULL, 0x000000012654770bULL, }, /* 72 */
+ { 0x00000000f9ee75b2ULL, 0x000000003d1819fbULL, },
+ { 0x00000001662a3a2aULL, 0x00000000d303ec13ULL, },
+ { 0x000000010a8c90f8ULL, 0x00000000d11ba99fULL, },
+ { 0x0000000098b16b8dULL, 0x000000018c6d38e4ULL, },
+ { 0x00000000bde2dd55ULL, 0x00000000a330dbd4ULL, },
+ { 0x000000012a1ea1cdULL, 0x00000001391cadecULL, },
+ { 0x00000000ce80f89bULL, 0x0000000137346b78ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c
new file mode 100644
index 0000000000..3b38f9bb33
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HADD_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "HADD_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x01fe01fe01fe01feULL, 0x01fe01fe01fe01feULL, }, /* 0 */
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0x01a901a901a901a9ULL, 0x01a901a901a901a9ULL, },
+ { 0x0154015401540154ULL, 0x0154015401540154ULL, },
+ { 0x01cb01cb01cb01cbULL, 0x01cb01cb01cb01cbULL, },
+ { 0x0132013201320132ULL, 0x0132013201320132ULL, },
+ { 0x018d01e20137018dULL, 0x01e20137018d01e2ULL, },
+ { 0x0170011b01c60170ULL, 0x011b01c60170011bULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x008e00e30038008eULL, 0x00e30038008e00e3ULL, },
+ { 0x0071001c00c70071ULL, 0x001c00c70071001cULL, },
+ { 0x01a901a901a901a9ULL, 0x01a901a901a901a9ULL, }, /* 16 */
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0154015401540154ULL, 0x0154015401540154ULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0x0176017601760176ULL, 0x0176017601760176ULL, },
+ { 0x00dd00dd00dd00ddULL, 0x00dd00dd00dd00ddULL, },
+ { 0x0138018d00e20138ULL, 0x018d00e20138018dULL, },
+ { 0x011b00c60171011bULL, 0x00c60171011b00c6ULL, },
+ { 0x0154015401540154ULL, 0x0154015401540154ULL, }, /* 24 */
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0121012101210121ULL, 0x0121012101210121ULL, },
+ { 0x0088008800880088ULL, 0x0088008800880088ULL, },
+ { 0x00e30138008d00e3ULL, 0x0138008d00e30138ULL, },
+ { 0x00c60071011c00c6ULL, 0x0071011c00c60071ULL, },
+ { 0x01cb01cb01cb01cbULL, 0x01cb01cb01cb01cbULL, }, /* 32 */
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0176017601760176ULL, 0x0176017601760176ULL, },
+ { 0x0121012101210121ULL, 0x0121012101210121ULL, },
+ { 0x0198019801980198ULL, 0x0198019801980198ULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0x015a01af0104015aULL, 0x01af0104015a01afULL, },
+ { 0x013d00e80193013dULL, 0x00e80193013d00e8ULL, },
+ { 0x0132013201320132ULL, 0x0132013201320132ULL, }, /* 40 */
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x00dd00dd00dd00ddULL, 0x00dd00dd00dd00ddULL, },
+ { 0x0088008800880088ULL, 0x0088008800880088ULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0x0066006600660066ULL, 0x0066006600660066ULL, },
+ { 0x00c10116006b00c1ULL, 0x0116006b00c10116ULL, },
+ { 0x00a4004f00fa00a4ULL, 0x004f00fa00a4004fULL, },
+ { 0x01e20137018d01e2ULL, 0x0137018d01e20137ULL, }, /* 48 */
+ { 0x00e30038008e00e3ULL, 0x0038008e00e30038ULL, },
+ { 0x018d00e20138018dULL, 0x00e20138018d00e2ULL, },
+ { 0x0138008d00e30138ULL, 0x008d00e30138008dULL, },
+ { 0x01af0104015a01afULL, 0x0104015a01af0104ULL, },
+ { 0x0116006b00c10116ULL, 0x006b00c10116006bULL, },
+ { 0x0171011b00c60171ULL, 0x011b00c60171011bULL, },
+ { 0x0154005401550154ULL, 0x0054015501540054ULL, },
+ { 0x011b01c60170011bULL, 0x01c60170011b01c6ULL, }, /* 56 */
+ { 0x001c00c70071001cULL, 0x00c70071001c00c7ULL, },
+ { 0x00c60171011b00c6ULL, 0x0171011b00c60171ULL, },
+ { 0x0071011c00c60071ULL, 0x011c00c60071011cULL, },
+ { 0x00e80193013d00e8ULL, 0x0193013d00e80193ULL, },
+ { 0x004f00fa00a4004fULL, 0x00fa00a4004f00faULL, },
+ { 0x00aa01aa00a900aaULL, 0x01aa00a900aa01aaULL, },
+ { 0x008d00e30138008dULL, 0x00e30138008d00e3ULL, },
+ { 0x00f201b2008a0095ULL, 0x00b20069017900bcULL, }, /* 64 */
+ { 0x0146014900bb005dULL, 0x01420025013d01acULL, },
+ { 0x00e2019000f700d5ULL, 0x0123010a012900c4ULL, },
+ { 0x00d70133005900a3ULL, 0x013c00e301400150ULL, },
+ { 0x016500cc00af0107ULL, 0x007901190090005eULL, },
+ { 0x01b9006300e000cfULL, 0x010900d50054014eULL, },
+ { 0x015500aa011c0147ULL, 0x00ea01ba00400066ULL, },
+ { 0x014a004d007e0115ULL, 0x01030193005700f2ULL, },
+ { 0x0116017a011b00cbULL, 0x008e012401260031ULL, }, /* 72 */
+ { 0x016a0111014c0093ULL, 0x011e00e000ea0121ULL, },
+ { 0x010601580188010bULL, 0x00ff01c500d60039ULL, },
+ { 0x00fb00fb00ea00d9ULL, 0x0118019e00ed00c5ULL, },
+ { 0x00da00e200c00122ULL, 0x00f400e6012400eeULL, },
+ { 0x012e007900f100eaULL, 0x018400a200e801deULL, },
+ { 0x00ca00c0012d0162ULL, 0x0165018700d400f6ULL, },
+ { 0x00bf0063008f0130ULL, 0x017e016000eb0182ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c
new file mode 100644
index 0000000000..fd420cb8de
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-add/test_msa_hadd_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HADD_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Add";
+ char *instruction_name = "HADD_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0001fffe0001fffeULL, 0x0001fffe0001fffeULL, }, /* 0 */
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0x0001aaa90001aaa9ULL, 0x0001aaa90001aaa9ULL, },
+ { 0x0001555400015554ULL, 0x0001555400015554ULL, },
+ { 0x0001cccb0001cccbULL, 0x0001cccb0001cccbULL, },
+ { 0x0001333200013332ULL, 0x0001333200013332ULL, },
+ { 0x000138e20001e38dULL, 0x00018e37000138e2ULL, },
+ { 0x0001c71b00011c70ULL, 0x000171c60001c71bULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x000038e30000e38eULL, 0x00008e38000038e3ULL, },
+ { 0x0000c71c00001c71ULL, 0x000071c70000c71cULL, },
+ { 0x0001aaa90001aaa9ULL, 0x0001aaa90001aaa9ULL, }, /* 16 */
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0001555400015554ULL, 0x0001555400015554ULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0x0001777600017776ULL, 0x0001777600017776ULL, },
+ { 0x0000dddd0000ddddULL, 0x0000dddd0000ddddULL, },
+ { 0x0000e38d00018e38ULL, 0x000138e20000e38dULL, },
+ { 0x000171c60000c71bULL, 0x00011c71000171c6ULL, },
+ { 0x0001555400015554ULL, 0x0001555400015554ULL, }, /* 24 */
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0001222100012221ULL, 0x0001222100012221ULL, },
+ { 0x0000888800008888ULL, 0x0000888800008888ULL, },
+ { 0x00008e38000138e3ULL, 0x0000e38d00008e38ULL, },
+ { 0x00011c71000071c6ULL, 0x0000c71c00011c71ULL, },
+ { 0x0001cccb0001cccbULL, 0x0001cccb0001cccbULL, }, /* 32 */
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0001777600017776ULL, 0x0001777600017776ULL, },
+ { 0x0001222100012221ULL, 0x0001222100012221ULL, },
+ { 0x0001999800019998ULL, 0x0001999800019998ULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0x000105af0001b05aULL, 0x00015b04000105afULL, },
+ { 0x000193e80000e93dULL, 0x00013e93000193e8ULL, },
+ { 0x0001333200013332ULL, 0x0001333200013332ULL, }, /* 40 */
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x0000dddd0000ddddULL, 0x0000dddd0000ddddULL, },
+ { 0x0000888800008888ULL, 0x0000888800008888ULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0x0000666600006666ULL, 0x0000666600006666ULL, },
+ { 0x00006c16000116c1ULL, 0x0000c16b00006c16ULL, },
+ { 0x0000fa4f00004fa4ULL, 0x0000a4fa0000fa4fULL, },
+ { 0x0001e38d00018e37ULL, 0x000138e20001e38dULL, }, /* 48 */
+ { 0x0000e38e00008e38ULL, 0x000038e30000e38eULL, },
+ { 0x00018e38000138e2ULL, 0x0000e38d00018e38ULL, },
+ { 0x000138e30000e38dULL, 0x00008e38000138e3ULL, },
+ { 0x0001b05a00015b04ULL, 0x000105af0001b05aULL, },
+ { 0x000116c10000c16bULL, 0x00006c16000116c1ULL, },
+ { 0x00011c71000171c6ULL, 0x0000c71b00011c71ULL, },
+ { 0x0001aaaa0000aaa9ULL, 0x0000aaaa0001aaaaULL, },
+ { 0x00011c70000171c6ULL, 0x0001c71b00011c70ULL, }, /* 56 */
+ { 0x00001c71000071c7ULL, 0x0000c71c00001c71ULL, },
+ { 0x0000c71b00011c71ULL, 0x000171c60000c71bULL, },
+ { 0x000071c60000c71cULL, 0x00011c71000071c6ULL, },
+ { 0x0000e93d00013e93ULL, 0x000193e80000e93dULL, },
+ { 0x00004fa40000a4faULL, 0x0000fa4f00004fa4ULL, },
+ { 0x0000555400015555ULL, 0x0001555400005554ULL, },
+ { 0x0000e38d00008e38ULL, 0x000138e30000e38dULL, },
+ { 0x00016f3600007da2ULL, 0x000056c50001ae87ULL, }, /* 64 */
+ { 0x000088cd0000ef6aULL, 0x0001068100015177ULL, },
+ { 0x000137140000b3e2ULL, 0x000112660001238fULL, },
+ { 0x00009eb700010ab0ULL, 0x0000d43f0001e11bULL, },
+ { 0x0001e28a0000a2d3ULL, 0x00001e550000c54bULL, },
+ { 0x0000fc210001149bULL, 0x0000ce110000683bULL, },
+ { 0x0001aa680000d913ULL, 0x0000d9f600003a53ULL, },
+ { 0x0001120b00012fe1ULL, 0x00009bcf0000f7dfULL, },
+ { 0x0001932600010f0fULL, 0x0000333600015b37ULL, }, /* 72 */
+ { 0x0000acbd000180d7ULL, 0x0000e2f20000fe27ULL, },
+ { 0x00015b040001454fULL, 0x0000eed70000d03fULL, },
+ { 0x0000c2a700019c1dULL, 0x0000b0b000018dcbULL, },
+ { 0x0001571b0000b371ULL, 0x0000994f0001594eULL, },
+ { 0x000070b200012539ULL, 0x0001490b0000fc3eULL, },
+ { 0x00011ef90000e9b1ULL, 0x000154f00000ce56ULL, },
+ { 0x0000869c0001407fULL, 0x000116c900018be2ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HADD_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
new file mode 100644
index 0000000000..14ee4ab4db
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0xf1c61bf1c61bf1c6ULL, 0x1bf1c61bf1c61bf1ULL, },
+ { 0x0d38e30d38e30d38ULL, 0xe30d38e30d38e30dULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, },
+ { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, },
+ { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, }, /* 16 */
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0xc69cf1c69cf1c69cULL, 0xf1c69cf1c69cf1c6ULL, },
+ { 0xe30db8e30db8e30dULL, 0xb8e30db8e30db8e3ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, /* 24 */
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1010101010101010ULL, 0x1010101010101010ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1cf1461cf1461cf1ULL, 0x461cf1461cf1461cULL, },
+ { 0x38630e38630e3863ULL, 0x0e38630e38630e38ULL, },
+ { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, }, /* 32 */
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1010101010101010ULL, 0x1010101010101010ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd7ad02d7ad02d7adULL, 0x02d7ad02d7ad02d7ULL, },
+ { 0xf41ec9f41ec9f41eULL, 0xc9f41ec9f41ec9f4ULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, }, /* 40 */
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0be0350be0350be0ULL, 0x350be0350be0350bULL, },
+ { 0x2752fd2752fd2752ULL, 0xfd2752fd2752fd27ULL, },
+ { 0xf1c61bf1c61bf1c6ULL, 0x1bf1c61bf1c61bf1ULL, }, /* 48 */
+ { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, },
+ { 0xc69cf1c69cf1c69cULL, 0xf1c69cf1c69cf1c6ULL, },
+ { 0x1cf1461cf1461cf1ULL, 0x461cf1461cf1461cULL, },
+ { 0xd7ad02d7ad02d7adULL, 0x02d7ad02d7ad02d7ULL, },
+ { 0x0be0350be0350be0ULL, 0x350be0350be0350bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0d38e30d38e30d38ULL, 0xe30d38e30d38e30dULL, }, /* 56 */
+ { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, },
+ { 0xe30db8e30db8e30dULL, 0xb8e30db8e30db8e3ULL, },
+ { 0x38630e38630e3863ULL, 0x0e38630e38630e38ULL, },
+ { 0xf41ec9f41ec9f41eULL, 0xc9f41ec9f41ec9f4ULL, },
+ { 0x2752fd2752fd2752ULL, 0xfd2752fd2752fd27ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc114f3173afa0e24ULL, 0x2e2fe33c095d0104ULL, },
+ { 0x9a62cabbf018f0e0ULL, 0x391fe82ed453ea10ULL, },
+ { 0xfc5cfe0c43491b47ULL, 0xec2cc91bd35ec9d6ULL, },
+ { 0xc114f3173afa0e24ULL, 0x2e2fe33c095d0104ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd30cd70603b1a9c4ULL, 0x1ce7c00ce0353b08ULL, },
+ { 0x35060b5855e2d42bULL, 0xcff4a1f9df401aceULL, },
+ { 0x9a62cabbf018f0e0ULL, 0x391fe82ed453ea10ULL, }, /* 72 */
+ { 0xd30cd70603b1a9c4ULL, 0x1ce7c00ce0353b08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e54e2fb0b00b6e7ULL, 0xdae4a7ebaa3603daULL, },
+ { 0xfc5cfe0c43491b47ULL, 0xec2cc91bd35ec9d6ULL, },
+ { 0x35060b5855e2d42bULL, 0xcff4a1f9df401aceULL, },
+ { 0x0e54e2fb0b00b6e7ULL, 0xdae4a7ebaa3603daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c
new file mode 100644
index 0000000000..ae7b3c8b89
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd555555555555554ULL, 0xd555555555555554ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, },
+ { 0xe666666666666665ULL, 0xe666666666666665ULL, },
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, },
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, },
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, },
+ { 0xd555555555555554ULL, 0xd555555555555554ULL, }, /* 16 */
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c6ULL, },
+ { 0xe38e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1111111111111110ULL, 0x1111111111111110ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e38ULL, },
+ { 0xe666666666666665ULL, 0xe666666666666665ULL, }, /* 32 */
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1111111111111110ULL, 0x1111111111111110ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d7ULL, },
+ { 0xf49f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, }, /* 40 */
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, },
+ { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d27ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x1c71c71c71c71c71ULL, }, /* 48 */
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c6ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, },
+ { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d7ULL, },
+ { 0x0b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, }, /* 56 */
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, },
+ { 0xe38e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e38ULL, },
+ { 0xf49f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d27ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, },
+ { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e54e27c0c00b6e7ULL, 0xdae527ec2a3703daULL, },
+ { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, },
+ { 0x0e54e27c0c00b6e7ULL, 0xdae527ec2a3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c
new file mode 100644
index 0000000000..d0d327e80f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, },
+ { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0xf1c61c71c71bf1c6ULL, 0x1c71c71bf1c61c71ULL, },
+ { 0x0e38e38d38e30e38ULL, 0xe38d38e30e38e38dULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, },
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, },
+ { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, },
+ { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, }, /* 16 */
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0xc71cf1c69c71c71cULL, 0xf1c69c71c71cf1c6ULL, },
+ { 0xe38db8e30e38e38dULL, 0xb8e30e38e38db8e3ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, /* 24 */
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1110111011101110ULL, 0x1110111011101110ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1c71471cf1c61c71ULL, 0x471cf1c61c71471cULL, },
+ { 0x38e30e38638e38e3ULL, 0x0e38638e38e30e38ULL, },
+ { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, }, /* 32 */
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1110111011101110ULL, 0x1110111011101110ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd82d02d7ad82d82dULL, 0x02d7ad82d82d02d7ULL, },
+ { 0xf49ec9f41f49f49eULL, 0xc9f41f49f49ec9f4ULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, }, /* 40 */
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0b60360be0b50b60ULL, 0x360be0b50b60360bULL, },
+ { 0x27d2fd27527d27d2ULL, 0xfd27527d27d2fd27ULL, },
+ { 0xf1c61c71c71bf1c6ULL, 0x1c71c71bf1c61c71ULL, }, /* 48 */
+ { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, },
+ { 0xc71cf1c69c71c71cULL, 0xf1c69c71c71cf1c6ULL, },
+ { 0x1c71471cf1c61c71ULL, 0x471cf1c61c71471cULL, },
+ { 0xd82d02d7ad82d82dULL, 0x02d7ad82d82d02d7ULL, },
+ { 0x0b60360be0b50b60ULL, 0x360be0b50b60360bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0e38e38d38e30e38ULL, 0xe38d38e30e38e38dULL, }, /* 56 */
+ { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, },
+ { 0xe38db8e30e38e38dULL, 0xb8e30e38e38db8e3ULL, },
+ { 0x38e30e38638e38e3ULL, 0x0e38638e38e30e38ULL, },
+ { 0xf49ec9f41f49f49eULL, 0xc9f41f49f49ec9f4ULL, },
+ { 0x27d2fd27527d27d2ULL, 0xfd27527d27d2fd27ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc214f3973afa0e24ULL, 0x2f2fe33c09dd0184ULL, },
+ { 0x9a62cabbf118f060ULL, 0x399fe92ed4d3ea90ULL, },
+ { 0xfc5cfe8c43491bc7ULL, 0xecacca1bd3dec956ULL, },
+ { 0xc214f3973afa0e24ULL, 0x2f2fe33c09dd0184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40cd78603b1a944ULL, 0x1d67c10ce0353c08ULL, },
+ { 0x36060b5855e2d4abULL, 0xd074a1f9df401aceULL, },
+ { 0x9a62cabbf118f060ULL, 0x399fe92ed4d3ea90ULL, }, /* 72 */
+ { 0xd40cd78603b1a944ULL, 0x1d67c10ce0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e54e27b0c00b6e7ULL, 0xdae4a7ebaa3603daULL, },
+ { 0xfc5cfe8c43491bc7ULL, 0xecacca1bd3dec956ULL, },
+ { 0x36060b5855e2d4abULL, 0xd074a1f9df401aceULL, },
+ { 0x0e54e27b0c00b6e7ULL, 0xdae4a7ebaa3603daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c
new file mode 100644
index 0000000000..77010209fb
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, },
+ { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, },
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x1c71c71bf1c71c71ULL, },
+ { 0x0e38e38d38e38e38ULL, 0xe38e38e30e38e38dULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, },
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, },
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, },
+ { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, }, /* 16 */
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0xc71c71c69c71c71cULL, 0xf1c71c71c71c71c6ULL, },
+ { 0xe38e38e30e38e38dULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1111111011111110ULL, 0x1111111011111110ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1c71c71cf1c71c71ULL, 0x471c71c61c71c71cULL, },
+ { 0x38e38e38638e38e3ULL, 0x0e38e38e38e38e38ULL, },
+ { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, }, /* 32 */
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1111111011111110ULL, 0x1111111011111110ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xd82d82d7ad82d82dULL, 0x02d82d82d82d82d7ULL, },
+ { 0xf49f49f41f49f49eULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, }, /* 40 */
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0b60b60be0b60b60ULL, 0x360b60b50b60b60bULL, },
+ { 0x27d27d27527d27d2ULL, 0xfd27d27d27d27d27ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x1c71c71bf1c71c71ULL, }, /* 48 */
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, },
+ { 0xc71c71c69c71c71cULL, 0xf1c71c71c71c71c6ULL, },
+ { 0x1c71c71cf1c71c71ULL, 0x471c71c61c71c71cULL, },
+ { 0xd82d82d7ad82d82dULL, 0x02d82d82d82d82d7ULL, },
+ { 0x0b60b60be0b60b60ULL, 0x360b60b50b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0e38e38d38e38e38ULL, 0xe38e38e30e38e38dULL, }, /* 56 */
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, },
+ { 0xe38e38e30e38e38dULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x38e38e38638e38e3ULL, 0x0e38e38e38e38e38ULL, },
+ { 0xf49f49f41f49f49eULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x27d27d27527d27d2ULL, 0xfd27d27d27d27d27ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc21473973afb0e24ULL, 0x2f2f633c09dd8184ULL, },
+ { 0x9a62cabbf118f060ULL, 0x399fe92ed4d36a90ULL, },
+ { 0xfc5cfe8c434a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0xc21473973afb0e24ULL, 0x2f2f633c09dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578603b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, },
+ { 0x9a62cabbf118f060ULL, 0x399fe92ed4d36a90ULL, }, /* 72 */
+ { 0xd40c578603b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e54e27b0c00b6e7ULL, 0xdae527ebaa3703daULL, },
+ { 0xfc5cfe8c434a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, },
+ { 0x0e54e27b0c00b6e7ULL, 0xdae527ebaa3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c
new file mode 100644
index 0000000000..c9e834e74d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c69bf1c69bf1c6ULL, 0x9bf1c69bf1c69bf1ULL, },
+ { 0x8db8e38db8e38db8ULL, 0xe38db8e38db8e38dULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0x71471c71471c7147ULL, 0x1c71471c71471c71ULL, },
+ { 0x0e38630e38630e38ULL, 0x630e38630e38630eULL, },
+ { 0xd4d4d4d4d4d4d4d4ULL, 0xd4d4d4d4d4d4d4d4ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6e6e6e6e6e6e6e6eULL, 0x6e6e6e6e6e6e6e6eULL, },
+ { 0xc69c71c69c71c69cULL, 0x71c69c71c69c71c6ULL, },
+ { 0x638db8638db8638dULL, 0xb8638db8638db863ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9090909090909090ULL, 0x9090909090909090ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c71469c71469c71ULL, 0x469c71469c71469cULL, },
+ { 0x38638e38638e3863ULL, 0x8e38638e38638e38ULL, },
+ { 0xe5e5e5e5e5e5e5e5ULL, 0xe5e5e5e5e5e5e5e5ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9090909090909090ULL, 0x9090909090909090ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0xd7ad82d7ad82d7adULL, 0x82d7ad82d7ad82d7ULL, },
+ { 0x749ec9749ec9749eULL, 0xc9749ec9749ec974ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0x6e6e6e6e6e6e6e6eULL, 0x6e6e6e6e6e6e6e6eULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b60358b60358b60ULL, 0x358b60358b60358bULL, },
+ { 0x27527d27527d2752ULL, 0x7d27527d27527d27ULL, },
+ { 0xf1c69bf1c69bf1c6ULL, 0x9bf1c69bf1c69bf1ULL, }, /* 48 */
+ { 0x71471c71471c7147ULL, 0x1c71471c71471c71ULL, },
+ { 0xc69c71c69c71c69cULL, 0x71c69c71c69c71c6ULL, },
+ { 0x9c71469c71469c71ULL, 0x469c71469c71469cULL, },
+ { 0xd7ad82d7ad82d7adULL, 0x82d7ad82d7ad82d7ULL, },
+ { 0x8b60358b60358b60ULL, 0x358b60358b60358bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x8db8e38db8e38db8ULL, 0xe38db8e38db8e38dULL, }, /* 56 */
+ { 0x0e38630e38630e38ULL, 0x630e38630e38630eULL, },
+ { 0x638db8638db8638dULL, 0xb8638db8638db863ULL, },
+ { 0x38638e38638e3863ULL, 0x8e38638e38638e38ULL, },
+ { 0x749ec9749ec9749eULL, 0xc9749ec9749ec974ULL, },
+ { 0x27527d27527d2752ULL, 0x7d27527d27527d27ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc19473973a7a8e24ULL, 0x2eaf633c895d8184ULL, },
+ { 0x9a62cabb70987060ULL, 0x399f68aed4536a10ULL, },
+ { 0x7c5c7e8c43499b47ULL, 0x6cac499bd35ec956ULL, },
+ { 0xc19473973a7a8e24ULL, 0x2eaf633c895d8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd38c578683b1a944ULL, 0x1ce7c08c60353b88ULL, },
+ { 0xb5860b585562d42bULL, 0x4ff4a1795f409aceULL, },
+ { 0x9a62cabb70987060ULL, 0x399f68aed4536a10ULL, }, /* 72 */
+ { 0xd38c578683b1a944ULL, 0x1ce7c08c60353b88ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e54627b8b80b667ULL, 0x5ae4a7ebaa36835aULL, },
+ { 0x7c5c7e8c43499b47ULL, 0x6cac499bd35ec956ULL, },
+ { 0xb5860b585562d42bULL, 0x4ff4a1795f409aceULL, },
+ { 0x8e54627b8b80b667ULL, 0x5ae4a7ebaa36835aULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c
new file mode 100644
index 0000000000..5462ffac0f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0xd555555555555554ULL, 0xd555555555555554ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe666666666666665ULL, 0xe666666666666665ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x9c71c71c71c71c71ULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0x638e38e38e38e38eULL, },
+ { 0xd555555555555554ULL, 0xd555555555555554ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6eeeeeeeeeeeeeeeULL, 0x6eeeeeeeeeeeeeeeULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c6ULL, },
+ { 0x638e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9111111111111110ULL, 0x9111111111111110ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e38ULL, },
+ { 0xe666666666666665ULL, 0xe666666666666665ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9111111111111110ULL, 0x9111111111111110ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d7ULL, },
+ { 0x749f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, },
+ { 0x6eeeeeeeeeeeeeeeULL, 0x6eeeeeeeeeeeeeeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, },
+ { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d27ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x9c71c71c71c71c71ULL, }, /* 48 */
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c6ULL, },
+ { 0x9c71c71c71c71c71ULL, 0x471c71c71c71c71cULL, },
+ { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d7ULL, },
+ { 0x8b60b60b60b60b60ULL, 0x360b60b60b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38dULL, }, /* 56 */
+ { 0x0e38e38e38e38e38ULL, 0x638e38e38e38e38eULL, },
+ { 0x638e38e38e38e38dULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x749f49f49f49f49eULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d27ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, },
+ { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e54e27c0c00b6e7ULL, 0x5ae527ec2a3703daULL, },
+ { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x8e54e27c0c00b6e7ULL, 0x5ae527ec2a3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c
new file mode 100644
index 0000000000..10d57e5741
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c69c71c71bf1c6ULL, 0x9c71c71bf1c69c71ULL, },
+ { 0x8e38e38db8e38e38ULL, 0xe38db8e38e38e38dULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0x71c71c71471c71c7ULL, 0x1c71471c71c71c71ULL, },
+ { 0x0e38638e38e30e38ULL, 0x638e38e30e38638eULL, },
+ { 0xd554d554d554d554ULL, 0xd554d554d554d554ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6eee6eee6eee6eeeULL, 0x6eee6eee6eee6eeeULL, },
+ { 0xc71c71c69c71c71cULL, 0x71c69c71c71c71c6ULL, },
+ { 0x638db8e38e38638dULL, 0xb8e38e38638db8e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9110911091109110ULL, 0x9110911091109110ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c71471c71c69c71ULL, 0x471c71c69c71471cULL, },
+ { 0x38e38e38638e38e3ULL, 0x8e38638e38e38e38ULL, },
+ { 0xe665e665e665e665ULL, 0xe665e665e665e665ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9110911091109110ULL, 0x9110911091109110ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0xd82d82d7ad82d82dULL, 0x82d7ad82d82d82d7ULL, },
+ { 0x749ec9f49f49749eULL, 0xc9f49f49749ec9f4ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0x6eee6eee6eee6eeeULL, 0x6eee6eee6eee6eeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b60360b60b58b60ULL, 0x360b60b58b60360bULL, },
+ { 0x27d27d27527d27d2ULL, 0x7d27527d27d27d27ULL, },
+ { 0xf1c69c71c71bf1c6ULL, 0x9c71c71bf1c69c71ULL, }, /* 48 */
+ { 0x71c71c71471c71c7ULL, 0x1c71471c71c71c71ULL, },
+ { 0xc71c71c69c71c71cULL, 0x71c69c71c71c71c6ULL, },
+ { 0x9c71471c71c69c71ULL, 0x471c71c69c71471cULL, },
+ { 0xd82d82d7ad82d82dULL, 0x82d7ad82d82d82d7ULL, },
+ { 0x8b60360b60b58b60ULL, 0x360b60b58b60360bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x8e38e38db8e38e38ULL, 0xe38db8e38e38e38dULL, }, /* 56 */
+ { 0x0e38638e38e30e38ULL, 0x638e38e30e38638eULL, },
+ { 0x638db8e38e38638dULL, 0xb8e38e38638db8e3ULL, },
+ { 0x38e38e38638e38e3ULL, 0x8e38638e38e38e38ULL, },
+ { 0x749ec9f49f49749eULL, 0xc9f49f49749ec9f4ULL, },
+ { 0x27d27d27527d27d2ULL, 0x7d27527d27d27d27ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc21473973afa8e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb71187060ULL, 0x399f692ed4d36a90ULL, },
+ { 0x7c5c7e8c43499bc7ULL, 0x6cac4a1bd3dec956ULL, },
+ { 0xc21473973afa8e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578683b1a944ULL, 0x1d67c10c60353c08ULL, },
+ { 0xb6060b5855e2d4abULL, 0x5074a1f95f409aceULL, },
+ { 0x9a62cabb71187060ULL, 0x399f692ed4d36a90ULL, }, /* 72 */
+ { 0xd40c578683b1a944ULL, 0x1d67c10c60353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e54627b8c00b6e7ULL, 0x5ae4a7ebaa3683daULL, },
+ { 0x7c5c7e8c43499bc7ULL, 0x6cac4a1bd3dec956ULL, },
+ { 0xb6060b5855e2d4abULL, 0x5074a1f95f409aceULL, },
+ { 0x8e54627b8c00b6e7ULL, 0x5ae4a7ebaa3683daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c
new file mode 100644
index 0000000000..53106dee74
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_ave_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVE_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVE_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x9c71c71bf1c71c71ULL, },
+ { 0x8e38e38db8e38e38ULL, 0xe38e38e38e38e38dULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, },
+ { 0x71c71c71471c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0x638e38e30e38e38eULL, },
+ { 0xd5555554d5555554ULL, 0xd5555554d5555554ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6eeeeeee6eeeeeeeULL, 0x6eeeeeee6eeeeeeeULL, },
+ { 0xc71c71c69c71c71cULL, 0x71c71c71c71c71c6ULL, },
+ { 0x638e38e38e38e38dULL, 0xb8e38e38638e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9111111091111110ULL, 0x9111111091111110ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c71c71c71c71c71ULL, 0x471c71c69c71c71cULL, },
+ { 0x38e38e38638e38e3ULL, 0x8e38e38e38e38e38ULL, },
+ { 0xe6666665e6666665ULL, 0xe6666665e6666665ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9111111091111110ULL, 0x9111111091111110ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0xd82d82d7ad82d82dULL, 0x82d82d82d82d82d7ULL, },
+ { 0x749f49f49f49f49eULL, 0xc9f49f49749f49f4ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, },
+ { 0x6eeeeeee6eeeeeeeULL, 0x6eeeeeee6eeeeeeeULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b60b60b60b60b60ULL, 0x360b60b58b60b60bULL, },
+ { 0x27d27d27527d27d2ULL, 0x7d27d27d27d27d27ULL, },
+ { 0xf1c71c71c71c71c6ULL, 0x9c71c71bf1c71c71ULL, }, /* 48 */
+ { 0x71c71c71471c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xc71c71c69c71c71cULL, 0x71c71c71c71c71c6ULL, },
+ { 0x9c71c71c71c71c71ULL, 0x471c71c69c71c71cULL, },
+ { 0xd82d82d7ad82d82dULL, 0x82d82d82d82d82d7ULL, },
+ { 0x8b60b60b60b60b60ULL, 0x360b60b58b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x8e38e38db8e38e38ULL, 0xe38e38e38e38e38dULL, }, /* 56 */
+ { 0x0e38e38e38e38e38ULL, 0x638e38e30e38e38eULL, },
+ { 0x638e38e38e38e38dULL, 0xb8e38e38638e38e3ULL, },
+ { 0x38e38e38638e38e3ULL, 0x8e38e38e38e38e38ULL, },
+ { 0x749f49f49f49f49eULL, 0xc9f49f49749f49f4ULL, },
+ { 0x27d27d27527d27d2ULL, 0x7d27d27d27d27d27ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc21473973afb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92ed4d36a90ULL, },
+ { 0x7c5cfe8c434a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xc21473973afb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578683b1a944ULL, 0x1d68410c60353c08ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92ed4d36a90ULL, }, /* 72 */
+ { 0xd40c578683b1a944ULL, 0x1d68410c60353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e54e27b8c00b6e7ULL, 0x5ae527ebaa3703daULL, },
+ { 0x7c5cfe8c434a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x8e54e27b8c00b6e7ULL, 0x5ae527ebaa3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVE_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c
new file mode 100644
index 0000000000..465f54fc13
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, },
+ { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, },
+ { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, },
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, },
+ { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, },
+ { 0xf2c71cf2c71cf2c7ULL, 0x1cf2c71cf2c71cf2ULL, },
+ { 0x0e39e40e39e40e39ULL, 0xe40e39e40e39e40eULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, /* 16 */
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xefefefefefefefefULL, 0xefefefefefefefefULL, },
+ { 0xc79cf1c79cf1c79cULL, 0xf1c79cf1c79cf1c7ULL, },
+ { 0xe30eb9e30eb9e30eULL, 0xb9e30eb9e30eb9e3ULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, }, /* 24 */
+ { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1cf2471cf2471cf2ULL, 0x471cf2471cf2471cULL, },
+ { 0x39630e39630e3963ULL, 0x0e39630e39630e39ULL, },
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, /* 32 */
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd8ad02d8ad02d8adULL, 0x02d8ad02d8ad02d8ULL, },
+ { 0xf41fcaf41fcaf41fULL, 0xcaf41fcaf41fcaf4ULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, }, /* 40 */
+ { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, },
+ { 0xefefefefefefefefULL, 0xefefefefefefefefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0be1360be1360be1ULL, 0x360be1360be1360bULL, },
+ { 0x2852fd2852fd2852ULL, 0xfd2852fd2852fd28ULL, },
+ { 0xf1c71cf1c71cf1c7ULL, 0x1cf1c71cf1c71cf1ULL, }, /* 48 */
+ { 0xf2c71cf2c71cf2c7ULL, 0x1cf2c71cf2c71cf2ULL, },
+ { 0xc79cf1c79cf1c79cULL, 0xf1c79cf1c79cf1c7ULL, },
+ { 0x1cf2471cf2471cf2ULL, 0x471cf2471cf2471cULL, },
+ { 0xd8ad02d8ad02d8adULL, 0x02d8ad02d8ad02d8ULL, },
+ { 0x0be1360be1360be1ULL, 0x360be1360be1360bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0e38e30e38e30e38ULL, 0xe30e38e30e38e30eULL, }, /* 56 */
+ { 0x0e39e40e39e40e39ULL, 0xe40e39e40e39e40eULL, },
+ { 0xe30eb9e30eb9e30eULL, 0xb9e30eb9e30eb9e3ULL, },
+ { 0x39630e39630e3963ULL, 0x0e39630e39630e39ULL, },
+ { 0xf41fcaf41fcaf41fULL, 0xcaf41fcaf41fcaf4ULL, },
+ { 0x2852fd2852fd2852ULL, 0xfd2852fd2852fd28ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc214f3183bfb0e24ULL, 0x2f2fe33c0a5d0104ULL, },
+ { 0x9a62cabbf119f0e0ULL, 0x3920e92fd553eb10ULL, },
+ { 0xfc5dfe0d434a1c47ULL, 0xec2cca1bd45fc9d6ULL, },
+ { 0xc214f3183bfb0e24ULL, 0x2f2fe33c0a5d0104ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40cd70703b1a9c4ULL, 0x1de8c10de0353c08ULL, },
+ { 0x36070b5856e2d52bULL, 0xd0f4a2f9df411aceULL, },
+ { 0x9a62cabbf119f0e0ULL, 0x3920e92fd553eb10ULL, }, /* 72 */
+ { 0xd40cd70703b1a9c4ULL, 0x1de8c10de0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e55e2fc0c00b7e7ULL, 0xdae5a7ecaa3704daULL, },
+ { 0xfc5dfe0d434a1c47ULL, 0xec2cca1bd45fc9d6ULL, },
+ { 0x36070b5856e2d52bULL, 0xd0f4a2f9df411aceULL, },
+ { 0x0e55e2fc0c00b7e7ULL, 0xdae5a7ecaa3704daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c
new file mode 100644
index 0000000000..391cb85ff0
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, },
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, },
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, },
+ { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, },
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, },
+ { 0x199999999999999aULL, 0x199999999999999aULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x0e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, }, /* 16 */
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, },
+ { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c7ULL, },
+ { 0xe38e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x2aaaaaaaaaaaaaaaULL, 0x2aaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e39ULL, },
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, }, /* 32 */
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d8ULL, },
+ { 0xf49f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x1999999999999999ULL, 0x1999999999999999ULL, }, /* 40 */
+ { 0x199999999999999aULL, 0x199999999999999aULL, },
+ { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, },
+ { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d28ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c71ULL, }, /* 48 */
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0xf1c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, },
+ { 0xd82d82d82d82d82dULL, 0x02d82d82d82d82d8ULL, },
+ { 0x0b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, /* 56 */
+ { 0x0e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0xe38e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0e38e38e38e38e39ULL, },
+ { 0xf49f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x27d27d27d27d27d2ULL, 0xfd27d27d27d27d28ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, },
+ { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e54e27c0c00b6e7ULL, 0xdae527ec2a3703daULL, },
+ { 0xfc5cfe8cc34a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f95f411aceULL, },
+ { 0x0e54e27c0c00b6e7ULL, 0xdae527ec2a3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c
new file mode 100644
index 0000000000..352b57d786
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, },
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, },
+ { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, },
+ { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, },
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, },
+ { 0x199a199a199a199aULL, 0x199a199a199a199aULL, },
+ { 0xf1c71c72c71cf1c7ULL, 0x1c72c71cf1c71c72ULL, },
+ { 0x0e39e38e38e40e39ULL, 0xe38e38e40e39e38eULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, /* 16 */
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, },
+ { 0xc71cf1c79c71c71cULL, 0xf1c79c71c71cf1c7ULL, },
+ { 0xe38eb8e30e39e38eULL, 0xb8e30e39e38eb8e3ULL, },
+ { 0x2aaa2aaa2aaa2aaaULL, 0x2aaa2aaa2aaa2aaaULL, }, /* 24 */
+ { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1c72471cf1c71c72ULL, 0x471cf1c71c72471cULL, },
+ { 0x38e30e39638e38e3ULL, 0x0e39638e38e30e39ULL, },
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, /* 32 */
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd82d02d8ad82d82dULL, 0x02d8ad82d82d02d8ULL, },
+ { 0xf49fc9f41f4af49fULL, 0xc9f41f4af49fc9f4ULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, }, /* 40 */
+ { 0x199a199a199a199aULL, 0x199a199a199a199aULL, },
+ { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0b61360be0b60b61ULL, 0x360be0b60b61360bULL, },
+ { 0x27d2fd28527d27d2ULL, 0xfd28527d27d2fd28ULL, },
+ { 0xf1c71c71c71cf1c7ULL, 0x1c71c71cf1c71c71ULL, }, /* 48 */
+ { 0xf1c71c72c71cf1c7ULL, 0x1c72c71cf1c71c72ULL, },
+ { 0xc71cf1c79c71c71cULL, 0xf1c79c71c71cf1c7ULL, },
+ { 0x1c72471cf1c71c72ULL, 0x471cf1c71c72471cULL, },
+ { 0xd82d02d8ad82d82dULL, 0x02d8ad82d82d02d8ULL, },
+ { 0x0b61360be0b60b61ULL, 0x360be0b60b61360bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0e38e38e38e30e38ULL, 0xe38e38e30e38e38eULL, }, /* 56 */
+ { 0x0e39e38e38e40e39ULL, 0xe38e38e40e39e38eULL, },
+ { 0xe38eb8e30e39e38eULL, 0xb8e30e39e38eb8e3ULL, },
+ { 0x38e30e39638e38e3ULL, 0x0e39638e38e30e39ULL, },
+ { 0xf49fc9f41f4af49fULL, 0xc9f41f4af49fc9f4ULL, },
+ { 0x27d2fd28527d27d2ULL, 0xfd28527d27d2fd28ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc214f3983afb0e24ULL, 0x2f2fe33c09dd0184ULL, },
+ { 0x9a62cabbf119f060ULL, 0x39a0e92fd4d3ea90ULL, },
+ { 0xfc5dfe8d434a1bc7ULL, 0xecacca1bd3dfc956ULL, },
+ { 0xc214f3983afb0e24ULL, 0x2f2fe33c09dd0184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40cd78703b1a944ULL, 0x1d68c10de0353c08ULL, },
+ { 0x36070b5855e2d4abULL, 0xd074a1f9df411aceULL, },
+ { 0x9a62cabbf119f060ULL, 0x39a0e92fd4d3ea90ULL, }, /* 72 */
+ { 0xd40cd78703b1a944ULL, 0x1d68c10de0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e55e27c0c00b6e7ULL, 0xdae5a7ecaa3703daULL, },
+ { 0xfc5dfe8d434a1bc7ULL, 0xecacca1bd3dfc956ULL, },
+ { 0x36070b5855e2d4abULL, 0xd074a1f9df411aceULL, },
+ { 0x0e55e27c0c00b6e7ULL, 0xdae5a7ecaa3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c
new file mode 100644
index 0000000000..cfba37b0ae
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, },
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, },
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, },
+ { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, },
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, },
+ { 0x1999999a1999999aULL, 0x1999999a1999999aULL, },
+ { 0xf1c71c72c71c71c7ULL, 0x1c71c71cf1c71c72ULL, },
+ { 0x0e38e38e38e38e39ULL, 0xe38e38e40e38e38eULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, /* 16 */
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, },
+ { 0xc71c71c79c71c71cULL, 0xf1c71c71c71c71c7ULL, },
+ { 0xe38e38e30e38e38eULL, 0xb8e38e39e38e38e3ULL, },
+ { 0x2aaaaaaa2aaaaaaaULL, 0x2aaaaaaa2aaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1c71c71cf1c71c72ULL, 0x471c71c71c71c71cULL, },
+ { 0x38e38e39638e38e3ULL, 0x0e38e38e38e38e39ULL, },
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, /* 32 */
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd82d82d8ad82d82dULL, 0x02d82d82d82d82d8ULL, },
+ { 0xf49f49f41f49f49fULL, 0xc9f49f4af49f49f4ULL, },
+ { 0x1999999919999999ULL, 0x1999999919999999ULL, }, /* 40 */
+ { 0x1999999a1999999aULL, 0x1999999a1999999aULL, },
+ { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0b60b60be0b60b61ULL, 0x360b60b60b60b60bULL, },
+ { 0x27d27d28527d27d2ULL, 0xfd27d27d27d27d28ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x1c71c71cf1c71c71ULL, }, /* 48 */
+ { 0xf1c71c72c71c71c7ULL, 0x1c71c71cf1c71c72ULL, },
+ { 0xc71c71c79c71c71cULL, 0xf1c71c71c71c71c7ULL, },
+ { 0x1c71c71cf1c71c72ULL, 0x471c71c71c71c71cULL, },
+ { 0xd82d82d8ad82d82dULL, 0x02d82d82d82d82d8ULL, },
+ { 0x0b60b60be0b60b61ULL, 0x360b60b60b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0e38e38e38e38e38ULL, 0xe38e38e30e38e38eULL, }, /* 56 */
+ { 0x0e38e38e38e38e39ULL, 0xe38e38e40e38e38eULL, },
+ { 0xe38e38e30e38e38eULL, 0xb8e38e39e38e38e3ULL, },
+ { 0x38e38e39638e38e3ULL, 0x0e38e38e38e38e39ULL, },
+ { 0xf49f49f41f49f49fULL, 0xc9f49f4af49f49f4ULL, },
+ { 0x27d27d28527d27d2ULL, 0xfd27d27d27d27d28ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc21473983afb0e24ULL, 0x2f2f633c09dd8184ULL, },
+ { 0x9a62cabbf118f060ULL, 0x399fe92fd4d36a90ULL, },
+ { 0xfc5cfe8d434a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0xc21473983afb0e24ULL, 0x2f2f633c09dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578703b1a944ULL, 0x1d68410de0353c08ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, },
+ { 0x9a62cabbf118f060ULL, 0x399fe92fd4d36a90ULL, }, /* 72 */
+ { 0xd40c578703b1a944ULL, 0x1d68410de0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x0e54e27c0c00b6e7ULL, 0xdae527ecaa3703daULL, },
+ { 0xfc5cfe8d434a1bc7ULL, 0xecac4a1bd3df4956ULL, },
+ { 0x36068b5855e2d4abULL, 0xd074a1f9df411aceULL, },
+ { 0x0e54e27c0c00b6e7ULL, 0xdae527ecaa3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c
new file mode 100644
index 0000000000..91f227b830
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c79cf1c79cf1c7ULL, 0x9cf1c79cf1c79cf1ULL, },
+ { 0x8eb8e38eb8e38eb8ULL, 0xe38eb8e38eb8e38eULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, },
+ { 0x72471c72471c7247ULL, 0x1c72471c72471c72ULL, },
+ { 0x0e39640e39640e39ULL, 0x640e39640e39640eULL, },
+ { 0xd5d5d5d5d5d5d5d5ULL, 0xd5d5d5d5d5d5d5d5ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6f6f6f6f6f6f6f6fULL, 0x6f6f6f6f6f6f6f6fULL, },
+ { 0xc79c71c79c71c79cULL, 0x71c79c71c79c71c7ULL, },
+ { 0x638eb9638eb9638eULL, 0xb9638eb9638eb963ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9191919191919191ULL, 0x9191919191919191ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c72479c72479c72ULL, 0x479c72479c72479cULL, },
+ { 0x39638e39638e3963ULL, 0x8e39638e39638e39ULL, },
+ { 0xe6e6e6e6e6e6e6e6ULL, 0xe6e6e6e6e6e6e6e6ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9191919191919191ULL, 0x9191919191919191ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xd8ad82d8ad82d8adULL, 0x82d8ad82d8ad82d8ULL, },
+ { 0x749fca749fca749fULL, 0xca749fca749fca74ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, },
+ { 0x6f6f6f6f6f6f6f6fULL, 0x6f6f6f6f6f6f6f6fULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b61368b61368b61ULL, 0x368b61368b61368bULL, },
+ { 0x28527d28527d2852ULL, 0x7d28527d28527d28ULL, },
+ { 0xf1c79cf1c79cf1c7ULL, 0x9cf1c79cf1c79cf1ULL, }, /* 48 */
+ { 0x72471c72471c7247ULL, 0x1c72471c72471c72ULL, },
+ { 0xc79c71c79c71c79cULL, 0x71c79c71c79c71c7ULL, },
+ { 0x9c72479c72479c72ULL, 0x479c72479c72479cULL, },
+ { 0xd8ad82d8ad82d8adULL, 0x82d8ad82d8ad82d8ULL, },
+ { 0x8b61368b61368b61ULL, 0x368b61368b61368bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x8eb8e38eb8e38eb8ULL, 0xe38eb8e38eb8e38eULL, }, /* 56 */
+ { 0x0e39640e39640e39ULL, 0x640e39640e39640eULL, },
+ { 0x638eb9638eb9638eULL, 0xb9638eb9638eb963ULL, },
+ { 0x39638e39638e3963ULL, 0x8e39638e39638e39ULL, },
+ { 0x749fca749fca749fULL, 0xca749fca749fca74ULL, },
+ { 0x28527d28527d2852ULL, 0x7d28527d28527d28ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc29473983b7b8e24ULL, 0x2faf633c8a5d8184ULL, },
+ { 0x9a62cabb71997060ULL, 0x39a069afd5536b10ULL, },
+ { 0x7c5d7e8d434a9c47ULL, 0x6cac4a9bd45fc956ULL, },
+ { 0xc29473983b7b8e24ULL, 0x2faf633c8a5d8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd48c578783b1a944ULL, 0x1de8c18d60353c88ULL, },
+ { 0xb6870b585662d52bULL, 0x50f4a2795f419aceULL, },
+ { 0x9a62cabb71997060ULL, 0x39a069afd5536b10ULL, }, /* 72 */
+ { 0xd48c578783b1a944ULL, 0x1de8c18d60353c88ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e55627c8c80b767ULL, 0x5ae5a7ecaa37845aULL, },
+ { 0x7c5d7e8d434a9c47ULL, 0x6cac4a9bd45fc956ULL, },
+ { 0xb6870b585662d52bULL, 0x50f4a2795f419aceULL, },
+ { 0x8e55627c8c80b767ULL, 0x5ae5a7ecaa37845aULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c
new file mode 100644
index 0000000000..fde57a2a5c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x9c71c71c71c71c71ULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x199999999999999aULL, 0x199999999999999aULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x0e38e38e38e38e39ULL, 0x638e38e38e38e38eULL, },
+ { 0xd555555555555555ULL, 0xd555555555555555ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6eeeeeeeeeeeeeefULL, 0x6eeeeeeeeeeeeeefULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x638e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaaaaaaaaaabULL, 0x2aaaaaaaaaaaaaabULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9111111111111111ULL, 0x9111111111111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xe666666666666666ULL, 0xe666666666666666ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9111111111111111ULL, 0x9111111111111111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d8ULL, },
+ { 0x749f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x199999999999999aULL, 0x199999999999999aULL, },
+ { 0x6eeeeeeeeeeeeeefULL, 0x6eeeeeeeeeeeeeefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, },
+ { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d28ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x9c71c71c71c71c71ULL, }, /* 48 */
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x9c71c71c71c71c72ULL, 0x471c71c71c71c71cULL, },
+ { 0xd82d82d82d82d82dULL, 0x82d82d82d82d82d8ULL, },
+ { 0x8b60b60b60b60b61ULL, 0x360b60b60b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x8e38e38e38e38e38ULL, 0xe38e38e38e38e38eULL, }, /* 56 */
+ { 0x0e38e38e38e38e39ULL, 0x638e38e38e38e38eULL, },
+ { 0x638e38e38e38e38eULL, 0xb8e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x749f49f49f49f49fULL, 0xc9f49f49f49f49f4ULL, },
+ { 0x27d27d27d27d27d2ULL, 0x7d27d27d27d27d28ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, },
+ { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xc2147397bafb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92f54d36a90ULL, }, /* 72 */
+ { 0xd40c578703b1a944ULL, 0x1d68410ce0353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e54e27c0c00b6e7ULL, 0x5ae527ec2a3703daULL, },
+ { 0x7c5cfe8cc34a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x8e54e27c0c00b6e7ULL, 0x5ae527ec2a3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c
new file mode 100644
index 0000000000..b9ec39a3de
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c79c71c71cf1c7ULL, 0x9c71c71cf1c79c71ULL, },
+ { 0x8e38e38eb8e38e38ULL, 0xe38eb8e38e38e38eULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x199a199a199a199aULL, 0x199a199a199a199aULL, },
+ { 0x71c71c72471c71c7ULL, 0x1c72471c71c71c72ULL, },
+ { 0x0e39638e38e40e39ULL, 0x638e38e40e39638eULL, },
+ { 0xd555d555d555d555ULL, 0xd555d555d555d555ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6eef6eef6eef6eefULL, 0x6eef6eef6eef6eefULL, },
+ { 0xc71c71c79c71c71cULL, 0x71c79c71c71c71c7ULL, },
+ { 0x638eb8e38e39638eULL, 0xb8e38e39638eb8e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aab2aab2aab2aabULL, 0x2aab2aab2aab2aabULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9111911191119111ULL, 0x9111911191119111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c72471c71c79c72ULL, 0x471c71c79c72471cULL, },
+ { 0x38e38e39638e38e3ULL, 0x8e39638e38e38e39ULL, },
+ { 0xe666e666e666e666ULL, 0xe666e666e666e666ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9111911191119111ULL, 0x9111911191119111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xd82d82d8ad82d82dULL, 0x82d8ad82d82d82d8ULL, },
+ { 0x749fc9f49f4a749fULL, 0xc9f49f4a749fc9f4ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x199a199a199a199aULL, 0x199a199a199a199aULL, },
+ { 0x6eef6eef6eef6eefULL, 0x6eef6eef6eef6eefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b61360b60b68b61ULL, 0x360b60b68b61360bULL, },
+ { 0x27d27d28527d27d2ULL, 0x7d28527d27d27d28ULL, },
+ { 0xf1c79c71c71cf1c7ULL, 0x9c71c71cf1c79c71ULL, }, /* 48 */
+ { 0x71c71c72471c71c7ULL, 0x1c72471c71c71c72ULL, },
+ { 0xc71c71c79c71c71cULL, 0x71c79c71c71c71c7ULL, },
+ { 0x9c72471c71c79c72ULL, 0x471c71c79c72471cULL, },
+ { 0xd82d82d8ad82d82dULL, 0x82d8ad82d82d82d8ULL, },
+ { 0x8b61360b60b68b61ULL, 0x360b60b68b61360bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x8e38e38eb8e38e38ULL, 0xe38eb8e38e38e38eULL, }, /* 56 */
+ { 0x0e39638e38e40e39ULL, 0x638e38e40e39638eULL, },
+ { 0x638eb8e38e39638eULL, 0xb8e38e39638eb8e3ULL, },
+ { 0x38e38e39638e38e3ULL, 0x8e39638e38e38e39ULL, },
+ { 0x749fc9f49f4a749fULL, 0xc9f49f4a749fc9f4ULL, },
+ { 0x27d27d28527d27d2ULL, 0x7d28527d27d27d28ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc21473983afb8e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb71197060ULL, 0x39a0692fd4d36a90ULL, },
+ { 0x7c5d7e8d434a9bc7ULL, 0x6cac4a1bd3dfc956ULL, },
+ { 0xc21473983afb8e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578783b1a944ULL, 0x1d68c10d60353c08ULL, },
+ { 0xb6070b5855e2d4abULL, 0x5074a1f95f419aceULL, },
+ { 0x9a62cabb71197060ULL, 0x39a0692fd4d36a90ULL, }, /* 72 */
+ { 0xd40c578783b1a944ULL, 0x1d68c10d60353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e55627c8c00b6e7ULL, 0x5ae5a7ecaa3783daULL, },
+ { 0x7c5d7e8d434a9bc7ULL, 0x6cac4a1bd3dfc956ULL, },
+ { 0xb6070b5855e2d4abULL, 0x5074a1f95f419aceULL, },
+ { 0x8e55627c8c00b6e7ULL, 0x5ae5a7ecaa3783daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c
new file mode 100644
index 0000000000..dc3c2e432e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-average/test_msa_aver_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction AVER_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Average";
+ char *instruction_name = "AVER_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x9c71c71cf1c71c71ULL, },
+ { 0x8e38e38eb8e38e38ULL, 0xe38e38e38e38e38eULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x1999999a1999999aULL, 0x1999999a1999999aULL, },
+ { 0x71c71c72471c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x0e38e38e38e38e39ULL, 0x638e38e40e38e38eULL, },
+ { 0xd5555555d5555555ULL, 0xd5555555d5555555ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x6eeeeeef6eeeeeefULL, 0x6eeeeeef6eeeeeefULL, },
+ { 0xc71c71c79c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x638e38e38e38e38eULL, 0xb8e38e39638e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x2aaaaaab2aaaaaabULL, 0x2aaaaaab2aaaaaabULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x9111111191111111ULL, 0x9111111191111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x9c71c71c71c71c72ULL, 0x471c71c79c71c71cULL, },
+ { 0x38e38e39638e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xe6666666e6666666ULL, 0xe6666666e6666666ULL, }, /* 32 */
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x9111111191111111ULL, 0x9111111191111111ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xd82d82d8ad82d82dULL, 0x82d82d82d82d82d8ULL, },
+ { 0x749f49f49f49f49fULL, 0xc9f49f4a749f49f4ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, }, /* 40 */
+ { 0x1999999a1999999aULL, 0x1999999a1999999aULL, },
+ { 0x6eeeeeef6eeeeeefULL, 0x6eeeeeef6eeeeeefULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8b60b60b60b60b61ULL, 0x360b60b68b60b60bULL, },
+ { 0x27d27d28527d27d2ULL, 0x7d27d27d27d27d28ULL, },
+ { 0xf1c71c71c71c71c7ULL, 0x9c71c71cf1c71c71ULL, }, /* 48 */
+ { 0x71c71c72471c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xc71c71c79c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x9c71c71c71c71c72ULL, 0x471c71c79c71c71cULL, },
+ { 0xd82d82d8ad82d82dULL, 0x82d82d82d82d82d8ULL, },
+ { 0x8b60b60b60b60b61ULL, 0x360b60b68b60b60bULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x8e38e38eb8e38e38ULL, 0xe38e38e38e38e38eULL, }, /* 56 */
+ { 0x0e38e38e38e38e39ULL, 0x638e38e40e38e38eULL, },
+ { 0x638e38e38e38e38eULL, 0xb8e38e39638e38e3ULL, },
+ { 0x38e38e39638e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x749f49f49f49f49fULL, 0xc9f49f4a749f49f4ULL, },
+ { 0x27d27d28527d27d2ULL, 0x7d27d27d27d27d28ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xc21473983afb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92fd4d36a90ULL, },
+ { 0x7c5cfe8d434a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xc21473983afb0e24ULL, 0x2f2f633c89dd8184ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xd40c578783b1a944ULL, 0x1d68410d60353c08ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x9a62cabb7118f060ULL, 0x399fe92fd4d36a90ULL, }, /* 72 */
+ { 0xd40c578783b1a944ULL, 0x1d68410d60353c08ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8e54e27c8c00b6e7ULL, 0x5ae527ecaa3703daULL, },
+ { 0x7c5cfe8d434a1bc7ULL, 0x6cac4a1bd3df4956ULL, },
+ { 0xb6068b5855e2d4abULL, 0x5074a1f95f411aceULL, },
+ { 0x8e54e27c8c00b6e7ULL, 0x5ae527ecaa3703daULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AVER_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c
new file mode 100644
index 0000000000..c9a9ee227d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CEQ.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CEQ.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c
new file mode 100644
index 0000000000..542c460f2f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CEQ.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CEQ.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c
new file mode 100644
index 0000000000..3ebe59550c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CEQ.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CEQ.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c
new file mode 100644
index 0000000000..003acf1544
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_ceq_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CEQ.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CEQ.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CEQ_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c
new file mode 100644
index 0000000000..ff20f0ea0e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, }, /* 48 */
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, }, /* 56 */
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xff00ffffff000000ULL, 0x00000000ff00ff00ULL, },
+ { 0xff00000000000000ULL, 0x000000000000ffffULL, },
+ { 0xff00ffffff0000ffULL, 0x000000000000ff00ULL, },
+ { 0x00ff000000ffffffULL, 0xffffffff00ff00ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00ff000000ff0000ULL, 0xff00ff00000000ffULL, },
+ { 0xffffff00ffffffffULL, 0x0000000000ff0000ULL, },
+ { 0x00ffffffffffffffULL, 0xffffffffffff0000ULL, }, /* 72 */
+ { 0xff00ffffff00ffffULL, 0x00ff00ffffffff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff00ffffffffffffULL, 0x00ff000000ff0000ULL, },
+ { 0x00ff000000ffff00ULL, 0xffffffffffff00ffULL, },
+ { 0x000000ff00000000ULL, 0xffffffffff00ffffULL, },
+ { 0x00ff000000000000ULL, 0xff00ffffff00ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c
new file mode 100644
index 0000000000..3dc18bd661
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c
new file mode 100644
index 0000000000..00c48d657b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, /* 48 */
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, /* 56 */
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffffffffffff0000ULL, 0x00000000ffffffffULL, },
+ { 0xffff000000000000ULL, 0x000000000000ffffULL, },
+ { 0xffffffffffff0000ULL, 0x000000000000ffffULL, },
+ { 0x000000000000ffffULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000ffffffffffffULL, 0xffffffffffff0000ULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x000000000000ffffULL, 0xffffffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c
new file mode 100644
index 0000000000..16f84a13e7
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c
new file mode 100644
index 0000000000..24574dc30d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffff0000ffffff00ULL, 0x00ffff00000000ffULL, },
+ { 0xff000000ffffffffULL, 0x00ffffff000000ffULL, },
+ { 0x00000000ff00ffffULL, 0xffffffff0000ffffULL, },
+ { 0x0000ffff000000ffULL, 0xff0000ffffffff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffffffff00ffULL, 0xff00ffffff000000ULL, },
+ { 0x0000ff00ff00ffffULL, 0xff0000ffffffff00ULL, },
+ { 0x00ffffff00000000ULL, 0xff000000ffffff00ULL, }, /* 72 */
+ { 0xffff00000000ff00ULL, 0x00ff000000ffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x000000000000ff00ULL, 0xffff000000ffffffULL, },
+ { 0xffffffff00ff0000ULL, 0x00000000ffff0000ULL, },
+ { 0xffff00ff00ff0000ULL, 0x00ffff00000000ffULL, },
+ { 0xffffffffffff00ffULL, 0x0000ffffff000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c
new file mode 100644
index 0000000000..e3f571545d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c
new file mode 100644
index 0000000000..8938d31c59
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffff0000ffffffffULL, 0x0000ffff00000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffff00000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff0000ffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff0000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffffffff0000ULL, },
+ { 0x0000ffffffffffffULL, 0xffff0000ffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff0000ffffffffULL, }, /* 72 */
+ { 0xffff00000000ffffULL, 0x000000000000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x000000000000ffffULL, 0xffff00000000ffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffff0000ULL, },
+ { 0xffff000000000000ULL, 0x0000ffff00000000ULL, },
+ { 0xffffffffffff0000ULL, 0x0000ffffffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c
new file mode 100644
index 0000000000..078a0c1815
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_cle_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLE_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLE_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLE_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c
new file mode 100644
index 0000000000..02c3dfa09e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, }, /* 48 */
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, }, /* 56 */
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xff00ffff00ffff00ULL, 0xffff00ffff00ffffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xff00ffffff000000ULL, 0x00000000ff00ff00ULL, },
+ { 0xff00000000000000ULL, 0x000000000000ffffULL, },
+ { 0xff00ffffff0000ffULL, 0x000000000000ff00ULL, },
+ { 0x00ff000000ffffffULL, 0xffffffff00ff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ff000000ff0000ULL, 0xff00ff00000000ffULL, },
+ { 0xffffff00ffffffffULL, 0x0000000000ff0000ULL, },
+ { 0x00ffffffffffffffULL, 0xffffffffffff0000ULL, }, /* 72 */
+ { 0xff00ffffff00ffffULL, 0x00ff00ffffffff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff00ffffffffffffULL, 0x00ff000000ff0000ULL, },
+ { 0x00ff000000ffff00ULL, 0xffffffffffff00ffULL, },
+ { 0x000000ff00000000ULL, 0xffffffffff00ffffULL, },
+ { 0x00ff000000000000ULL, 0xff00ffffff00ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c
new file mode 100644
index 0000000000..40637e2761
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c
new file mode 100644
index 0000000000..ee3cd628fc
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, /* 48 */
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, /* 56 */
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffff0000ffffULL, 0xffff0000ffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffffffffffff0000ULL, 0x00000000ffffffffULL, },
+ { 0xffff000000000000ULL, 0x000000000000ffffULL, },
+ { 0xffffffffffff0000ULL, 0x000000000000ffffULL, },
+ { 0x000000000000ffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000ffffffffffffULL, 0xffffffffffff0000ULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x000000000000ffffULL, 0xffffffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c
new file mode 100644
index 0000000000..bde4d95350
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffff00000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c
new file mode 100644
index 0000000000..147bf484b7
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x00ffff00ffff00ffULL, 0xff00ffff00ffff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffff0000ffffff00ULL, 0x00ffff00000000ffULL, },
+ { 0xff000000ffffffffULL, 0x00ffffff000000ffULL, },
+ { 0x00000000ff00ffffULL, 0xffffffff0000ffffULL, },
+ { 0x0000ffff000000ffULL, 0xff0000ffffffff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ffffffff00ffULL, 0xff00ffffff000000ULL, },
+ { 0x0000ff00ff00ffffULL, 0xff0000ffffffff00ULL, },
+ { 0x00ffffff00000000ULL, 0xff000000ffffff00ULL, }, /* 72 */
+ { 0xffff00000000ff00ULL, 0x00ff000000ffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000ff00ULL, 0xffff000000ffffffULL, },
+ { 0xffffffff00ff0000ULL, 0x00000000ffff0000ULL, },
+ { 0xffff00ff00ff0000ULL, 0x00ffff00000000ffULL, },
+ { 0xffffffffffff00ffULL, 0x0000ffffff000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c
new file mode 100644
index 0000000000..5daf716726
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c
new file mode 100644
index 0000000000..8d51c2cc3c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffff0000ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffff0000ffffffffULL, 0x0000ffff00000000ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffff00000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff0000ffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff0000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ffffffff0000ULL, 0xffffffffffff0000ULL, },
+ { 0x0000ffffffffffffULL, 0xffff0000ffffffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff0000ffffffffULL, }, /* 72 */
+ { 0xffff00000000ffffULL, 0x000000000000ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000000000ffffULL, 0xffff00000000ffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffff0000ULL, },
+ { 0xffff000000000000ULL, 0x0000ffff00000000ULL, },
+ { 0xffffffffffff0000ULL, 0x0000ffffffff0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c
new file mode 100644
index 0000000000..5403af8688
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-compare/test_msa_clt_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction CLT_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Compare";
+ char *instruction_name = "CLT_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000ffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_CLT_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
new file mode 100644
index 0000000000..f263201e72
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 16 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0200ff0200ff0200ULL, 0xff0200ff0200ff02ULL, },
+ { 0xfd0001fd0001fd00ULL, 0x01fd0001fd0001fdULL, },
+ { 0xababababababababULL, 0xababababababababULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xfe0001fe0001fe00ULL, 0x01fe0001fe0001feULL, },
+ { 0x0300ff0300ff0300ULL, 0xff0300ff0300ff03ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 32 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0100000100000100ULL, 0x0001000001000001ULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xff0000ff0000ff00ULL, 0x00ff0000ff0000ffULL, },
+ { 0x0100000100000100ULL, 0x0001000001000001ULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 48 */
+ { 0x0101ff0101ff0101ULL, 0xff0101ff0101ff01ULL, },
+ { 0x0001000001000001ULL, 0x0000010000010000ULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0x0002ff0002ff0002ULL, 0xff0002ff0002ff00ULL, },
+ { 0x00fe0100fe0100feULL, 0x0100fe0100fe0100ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 56 */
+ { 0xffff01ffff01ffffULL, 0x01ffff01ffff01ffULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, },
+ { 0x0001000001000001ULL, 0x0000010000010000ULL, },
+ { 0x00fe0100fe0100feULL, 0x0100fe0100fe0100ULL, },
+ { 0x0002ff0002ff0002ULL, 0xff0002ff0002ff00ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 64 */
+ { 0x18ff01000000ff08ULL, 0x04f50003000100fdULL, },
+ { 0x0101000000fe0000ULL, 0x01fe00a20002fe00ULL, },
+ { 0xff01ff000002fe00ULL, 0x00fa00fe00010200ULL, },
+ { 0x000000ff01ff0000ULL, 0x0000fa00f600ff00ULL, },
+ { 0x0101ff0101010101ULL, 0x0101010101010101ULL, },
+ { 0x000000ffff020000ULL, 0x000001e600010200ULL, },
+ { 0x0000000100fe0100ULL, 0x000000000000fe00ULL, },
+ { 0x00000301ff00fffeULL, 0x0000fb002a000001ULL, }, /* 72 */
+ { 0x10ff0100000002f0ULL, 0x02040000fc0000fbULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0001fdff00ff03ffULL, 0x000200000000ff00ULL, },
+ { 0x000000ff02000001ULL, 0xff00f6002b0000f8ULL, },
+ { 0xeaffff0001000009ULL, 0xfa0101fffc010018ULL, },
+ { 0xff000000ffff0000ULL, 0xfe000228010100fcULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c
new file mode 100644
index 0000000000..0458f933f6
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 16 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000003ULL, 0xffffffffffffffffULL, },
+ { 0xfffffffffffffffdULL, 0x0000000000000001ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xfffffffffffffffeULL, 0x0000000000000001ULL, },
+ { 0x0000000000000003ULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 32 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 48 */
+ { 0x0000000000000001ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 56 */
+ { 0xffffffffffffffffULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 64 */
+ { 0x000000000000001cULL, 0x0000000000000003ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000013ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffe6ULL, 0xfffffffffffffffaULL, },
+ { 0xffffffffffffffffULL, 0xfffffffffffffffeULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c
new file mode 100644
index 0000000000..fffe7be072
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 16 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0003ffff00000003ULL, 0xffff00000003ffffULL, },
+ { 0xfffd00010000fffdULL, 0x00010000fffd0001ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xfffe00010000fffeULL, 0x00010000fffe0001ULL, },
+ { 0x0003ffff00000003ULL, 0xffff00000003ffffULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 32 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000000000001ULL, 0x0000000000010000ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffff00000000ffffULL, 0x00000000ffff0000ULL, },
+ { 0x0001000000000001ULL, 0x0000000000010000ULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 48 */
+ { 0x0001ffff00010001ULL, 0xffff00010001ffffULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0x0000ffff00020000ULL, 0xffff00020000ffffULL, },
+ { 0x00000001fffe0000ULL, 0x0001fffe00000001ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 56 */
+ { 0xffff0001ffffffffULL, 0x0001ffffffff0001ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, },
+ { 0x00000001fffe0000ULL, 0x0001fffe00000001ULL, },
+ { 0x0000ffff00020000ULL, 0xffff00020000ffffULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 64 */
+ { 0x001cffbf0000ffffULL, 0x0003000000000000ULL, },
+ { 0x0001000000000000ULL, 0x000100000000fffeULL, },
+ { 0xffffffff0000fffeULL, 0x0000000000000002ULL, },
+ { 0x0000000000010000ULL, 0x0000fffafff3ffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x00000000ffff0000ULL, 0x0000000100000002ULL, },
+ { 0x0000000000000001ULL, 0x000000000000fffeULL, },
+ { 0x00000003ffffffffULL, 0x0000fffb00370000ULL, }, /* 72 */
+ { 0x0013ff2e00000002ULL, 0x00020000fffd0000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000fffd00000003ULL, 0x000000000000ffffULL, },
+ { 0x0000000000020000ULL, 0xfffffff600390000ULL, },
+ { 0xffe6003900010000ULL, 0xfffa0001fffc0000ULL, },
+ { 0xffff0000ffff0000ULL, 0xfffe000200010000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c
new file mode 100644
index 0000000000..22fa184d80
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 16 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000200000000ULL, 0xffffffff00000002ULL, },
+ { 0xfffffffd00000000ULL, 0x00000001fffffffdULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xfffffffe00000000ULL, 0x00000001fffffffeULL, },
+ { 0x0000000300000000ULL, 0xffffffff00000003ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 32 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000000ULL, 0x0000000000000001ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, },
+ { 0x0000000100000000ULL, 0x0000000000000001ULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 48 */
+ { 0x0000000100000001ULL, 0xffffffff00000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0xffffffff00000000ULL, },
+ { 0x00000000fffffffeULL, 0x0000000100000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 56 */
+ { 0xffffffffffffffffULL, 0x00000001ffffffffULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x00000000fffffffeULL, 0x0000000100000000ULL, },
+ { 0x0000000000000002ULL, 0xffffffff00000000ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 64 */
+ { 0x0000001c00000000ULL, 0x0000000300000000ULL, },
+ { 0x0000000100000000ULL, 0x0000000100000000ULL, },
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x00000000fffffff2ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000037ULL, }, /* 72 */
+ { 0x0000001300000000ULL, 0x00000002fffffffdULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0xffffffff00000039ULL, },
+ { 0xffffffe600000001ULL, 0xfffffffafffffffcULL, },
+ { 0xffffffffffffffffULL, 0xfffffffe00000001ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c
new file mode 100644
index 0000000000..8097d6c864
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0101040101040101ULL, 0x0401010401010401ULL, },
+ { 0x0902010902010902ULL, 0x0109020109020109ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0001030001030001ULL, 0x0300010300010300ULL, },
+ { 0x0601000601000601ULL, 0x0006010006010006ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000010000010000ULL, 0x0100000100000100ULL, },
+ { 0x0300000300000300ULL, 0x0003000003000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0001030001030001ULL, 0x0300010300010300ULL, },
+ { 0x0701010701010701ULL, 0x0107010107010107ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0100000100000100ULL, 0x0001000001000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0100000100000100ULL, 0x0001000001000001ULL, },
+ { 0x0201000201000201ULL, 0x0002010002010002ULL, },
+ { 0x0100000100000100ULL, 0x0001000001000001ULL, },
+ { 0x0402010402010402ULL, 0x0104020104020104ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0801000801000801ULL, 0x0008010008010008ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000010000010000ULL, 0x0100000100000100ULL, },
+ { 0x0001020001020001ULL, 0x0200010200010200ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0002030002030002ULL, 0x0300020300020300ULL, },
+ { 0x0000030000030000ULL, 0x0300000300000300ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 64 */
+ { 0x0000ff0200000008ULL, 0x040000030c010200ULL, },
+ { 0x0001010100000000ULL, 0x0100000001020400ULL, },
+ { 0x01010a0200020000ULL, 0x0000000001010000ULL, },
+ { 0x0101000001010200ULL, 0x0002110000000015ULL, },
+ { 0x0101ff0101010101ULL, 0x0101010101010101ULL, },
+ { 0x0102000000000100ULL, 0x000100000001020cULL, },
+ { 0x0202000100030000ULL, 0x0001010000000001ULL, },
+ { 0x0100000004020102ULL, 0x0002120200000001ULL, }, /* 72 */
+ { 0x0000ff0102010010ULL, 0x0200010908000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0101070201040001ULL, 0x0000010101000000ULL, },
+ { 0x0000000002000201ULL, 0x01020c020000010dULL, },
+ { 0x0000ff0001000109ULL, 0x0700000808010200ULL, },
+ { 0x0000000000000100ULL, 0x0301000000010608ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c
new file mode 100644
index 0000000000..54d6fda1f2
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000005ULL, 0x0000000000000005ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000009ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000006ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000007ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000007ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c
new file mode 100644
index 0000000000..5a729906ac
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0005000500050005ULL, 0x0005000500050005ULL, },
+ { 0x0001000400010001ULL, 0x0004000100010004ULL, },
+ { 0x0009000100020009ULL, 0x0001000200090001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x0000000300010000ULL, 0x0003000100000003ULL, },
+ { 0x0006000000010006ULL, 0x0000000100060000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0x0003000000000003ULL, 0x0000000000030000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0000000300010000ULL, 0x0003000100000003ULL, },
+ { 0x0007000100010007ULL, 0x0001000100070001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000000000001ULL, 0x0000000000010000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0001000000000001ULL, 0x0000000000010000ULL, },
+ { 0x0002000000010002ULL, 0x0000000100020000ULL, },
+ { 0x0001000000000001ULL, 0x0000000000010000ULL, },
+ { 0x0004000100020004ULL, 0x0001000200040001ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0008000000010008ULL, 0x0000000100080000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, },
+ { 0x0000000200010000ULL, 0x0002000100000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000300020000ULL, 0x0003000200000003ULL, },
+ { 0x0000000300000000ULL, 0x0003000000000003ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 64 */
+ { 0x0000025400000000ULL, 0x00030000000b0002ULL, },
+ { 0x0000000100000000ULL, 0x0001000000010004ULL, },
+ { 0x0001000a00000000ULL, 0x0000000000010000ULL, },
+ { 0x0001000000010002ULL, 0x0000001000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0001000000000001ULL, 0x0000000000000002ULL, },
+ { 0x0002000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0001000000040001ULL, 0x0000001100000000ULL, }, /* 72 */
+ { 0x000001c300020000ULL, 0x0002000100080000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x0001000700010000ULL, 0x0000000100010000ULL, },
+ { 0x0000000000020002ULL, 0x0001000c00000001ULL, },
+ { 0x0000003900010001ULL, 0x0007000000070002ULL, },
+ { 0x0000000000000001ULL, 0x0003000000000006ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c
new file mode 100644
index 0000000000..e9e2da4718
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-divide/test_msa_div_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DIV_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Divide";
+ char *instruction_name = "DIV_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000300000003ULL, 0x0000000300000003ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000500000005ULL, 0x0000000500000005ULL, },
+ { 0x0000000100000001ULL, 0x0000000400000001ULL, },
+ { 0x0000000900000002ULL, 0x0000000100000009ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000300000003ULL, 0x0000000300000003ULL, },
+ { 0x0000000000000001ULL, 0x0000000300000000ULL, },
+ { 0x0000000600000001ULL, 0x0000000000000006ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0000000300000000ULL, 0x0000000000000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000000000001ULL, 0x0000000300000000ULL, },
+ { 0x0000000700000001ULL, 0x0000000100000007ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000100000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000200000001ULL, 0x0000000000000002ULL, },
+ { 0x0000000100000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000400000002ULL, 0x0000000100000004ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000800000001ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000200000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000002ULL, 0x0000000300000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000300000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x000000030000000bULL, },
+ { 0x0000000000000000ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000000ULL, 0x0000000000000001ULL, },
+ { 0x0000000100000001ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000200000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000004ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000002ULL, 0x0000000200000008ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x0000000100000001ULL, 0x0000000000000001ULL, },
+ { 0x0000000000000002ULL, 0x0000000100000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000700000007ULL, },
+ { 0x0000000000000000ULL, 0x0000000300000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DIV_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
new file mode 100644
index 0000000000..cb13ff3e75
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DOTP_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DOTP_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaacULL, 0x00000000aaaaaaacULL, },
+ { 0xffffffff55555556ULL, 0xffffffff55555556ULL, },
+ { 0x0000000066666668ULL, 0x0000000066666668ULL, },
+ { 0xffffffff9999999aULL, 0xffffffff9999999aULL, },
+ { 0x000000008e38e38fULL, 0xffffffffe38e38e5ULL, },
+ { 0xffffffff71c71c73ULL, 0x000000001c71c71dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaacULL, 0x00000000aaaaaaacULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e38e39c71c71c8ULL, 0x38e38e39c71c71c8ULL, },
+ { 0xc71c71c6e38e38e4ULL, 0xc71c71c6e38e38e4ULL, },
+ { 0x22222222eeeeeef0ULL, 0x22222222eeeeeef0ULL, },
+ { 0xddddddddbbbbbbbcULL, 0xddddddddbbbbbbbcULL, },
+ { 0x2f684bdab425ed0aULL, 0xf684bda197b425eeULL, },
+ { 0xd097b425f684bda2ULL, 0x097b425f12f684beULL, },
+ { 0xffffffff55555556ULL, 0xffffffff55555556ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c6e38e38e4ULL, 0xc71c71c6e38e38e4ULL, },
+ { 0x38e38e3871c71c72ULL, 0x38e38e3871c71c72ULL, },
+ { 0xdddddddd77777778ULL, 0xdddddddd77777778ULL, },
+ { 0x22222221dddddddeULL, 0x22222221dddddddeULL, },
+ { 0xd097b425da12f685ULL, 0x097b425e4bda12f7ULL, },
+ { 0x2f684bd97b425ed1ULL, 0xf684bda1097b425fULL, },
+ { 0x0000000066666668ULL, 0x0000000066666668ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x22222222eeeeeef0ULL, 0x22222222eeeeeef0ULL, },
+ { 0xdddddddd77777778ULL, 0xdddddddd77777778ULL, },
+ { 0x147ae14851eb8520ULL, 0x147ae14851eb8520ULL, },
+ { 0xeb851eb8147ae148ULL, 0xeb851eb8147ae148ULL, },
+ { 0x1c71c71d0b60b60cULL, 0xfa4fa4fa82d82d84ULL, },
+ { 0xe38e38e35b05b05cULL, 0x05b05b05e38e38e4ULL, },
+ { 0xffffffff9999999aULL, 0xffffffff9999999aULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xddddddddbbbbbbbcULL, 0xddddddddbbbbbbbcULL, },
+ { 0x22222221dddddddeULL, 0x22222221dddddddeULL, },
+ { 0xeb851eb8147ae148ULL, 0xeb851eb8147ae148ULL, },
+ { 0x147ae147851eb852ULL, 0x147ae147851eb852ULL, },
+ { 0xe38e38e382d82d83ULL, 0x05b05b0560b60b61ULL, },
+ { 0x1c71c71c16c16c17ULL, 0xfa4fa4fa38e38e39ULL, },
+ { 0x000000008e38e38fULL, 0xffffffffe38e38e5ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2f684bdab425ed0aULL, 0xf684bda197b425eeULL, },
+ { 0xd097b425da12f685ULL, 0x097b425e4bda12f7ULL, },
+ { 0x1c71c71d0b60b60cULL, 0xfa4fa4fa82d82d84ULL, },
+ { 0xe38e38e382d82d83ULL, 0x05b05b0560b60b61ULL, },
+ { 0x35ba78199add3c0dULL, 0x0fcd6e9dc0ca4589ULL, },
+ { 0xca4587e6f35ba782ULL, 0xf032916222c3f35cULL, },
+ { 0xffffffff71c71c73ULL, 0x000000001c71c71dULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd097b425f684bda2ULL, 0x097b425f12f684beULL, },
+ { 0x2f684bd97b425ed1ULL, 0xf684bda1097b425fULL, },
+ { 0xe38e38e35b05b05cULL, 0x05b05b05e38e38e4ULL, },
+ { 0x1c71c71c16c16c17ULL, 0xfa4fa4fa38e38e39ULL, },
+ { 0xca4587e6f35ba782ULL, 0xf032916222c3f35cULL, },
+ { 0x35ba78187e6b74f1ULL, 0x0fcd6e9df9add3c1ULL, },
+ { 0x3e3ad4ae1266c290ULL, 0x1637d725aebdb714ULL, }, /* 64 */
+ { 0x0e3a0c27f7d6aae4ULL, 0x0575fbb7f08ff55cULL, },
+ { 0x1c00082337c84b78ULL, 0x0c3d39640fde8392ULL, },
+ { 0xda65cd5e9f696cdcULL, 0xdeeb6bec644a26d0ULL, },
+ { 0x0e3a0c27f7d6aae4ULL, 0x0575fbb7f08ff55cULL, },
+ { 0x17945c09b2e19689ULL, 0x032b395187d966b4ULL, },
+ { 0xec1f0e54b5aa67beULL, 0xfbe95b6e67ae6296ULL, },
+ { 0x1aad30609bff5437ULL, 0xf059a43d01b40370ULL, },
+ { 0x1c00082337c84b78ULL, 0x0c3d39640fde8392ULL, }, /* 72 */
+ { 0xec1f0e54b5aa67beULL, 0xfbe95b6e67ae6296ULL, },
+ { 0x2e9326619bb7c8e4ULL, 0x225024d84d163b91ULL, },
+ { 0xc17a5d0372a2a622ULL, 0x0afd6368668933a8ULL, },
+ { 0xda65cd5e9f696cdcULL, 0xdeeb6bec644a26d0ULL, },
+ { 0x1aad30609bff5437ULL, 0xf059a43d01b40370ULL, },
+ { 0xc17a5d0372a2a622ULL, 0x0afd6368668933a8ULL, },
+ { 0x53edf7dbd76122edULL, 0x50347e61c2f51a40ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c
new file mode 100644
index 0000000000..19451ee57d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DOTP_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DOTP_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ac00ac00ac00acULL, 0x00ac00ac00ac00acULL, },
+ { 0xff56ff56ff56ff56ULL, 0xff56ff56ff56ff56ULL, },
+ { 0x0068006800680068ULL, 0x0068006800680068ULL, },
+ { 0xff9aff9aff9aff9aULL, 0xff9aff9aff9aff9aULL, },
+ { 0x008fffe5003a008fULL, 0xffe5003a008fffe5ULL, },
+ { 0xff73001dffc8ff73ULL, 0x001dffc8ff73001dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00ac00ac00ac00acULL, 0x00ac00ac00ac00acULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x39c839c839c839c8ULL, 0x39c839c839c839c8ULL, },
+ { 0xc6e4c6e4c6e4c6e4ULL, 0xc6e4c6e4c6e4c6e4ULL, },
+ { 0x22f022f022f022f0ULL, 0x22f022f022f022f0ULL, },
+ { 0xddbcddbcddbcddbcULL, 0xddbcddbcddbcddbcULL, },
+ { 0x300af6ee137c300aULL, 0xf6ee137c300af6eeULL, },
+ { 0xd0a209beed30d0a2ULL, 0x09beed30d0a209beULL, },
+ { 0xff56ff56ff56ff56ULL, 0xff56ff56ff56ff56ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc6e4c6e4c6e4c6e4ULL, 0xc6e4c6e4c6e4c6e4ULL, },
+ { 0x3872387238723872ULL, 0x3872387238723872ULL, },
+ { 0xdd78dd78dd78dd78ULL, 0xdd78dd78dd78dd78ULL, },
+ { 0x21de21de21de21deULL, 0x21de21de21de21deULL, },
+ { 0xd08508f7ecbed085ULL, 0x08f7ecbed08508f7ULL, },
+ { 0x2ed1f65f12982ed1ULL, 0xf65f12982ed1f65fULL, },
+ { 0x0068006800680068ULL, 0x0068006800680068ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x22f022f022f022f0ULL, 0x22f022f022f022f0ULL, },
+ { 0xdd78dd78dd78dd78ULL, 0xdd78dd78dd78dd78ULL, },
+ { 0x1520152015201520ULL, 0x1520152015201520ULL, },
+ { 0xeb48eb48eb48eb48ULL, 0xeb48eb48eb48eb48ULL, },
+ { 0x1d0cfa840bc81d0cULL, 0xfa840bc81d0cfa84ULL, },
+ { 0xe35c05e4f4a0e35cULL, 0x05e4f4a0e35c05e4ULL, },
+ { 0xff9aff9aff9aff9aULL, 0xff9aff9aff9aff9aULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xddbcddbcddbcddbcULL, 0xddbcddbcddbcddbcULL, },
+ { 0x21de21de21de21deULL, 0x21de21de21de21deULL, },
+ { 0xeb48eb48eb48eb48ULL, 0xeb48eb48eb48eb48ULL, },
+ { 0x1452145214521452ULL, 0x1452145214521452ULL, },
+ { 0xe3830561f472e383ULL, 0x0561f472e3830561ULL, },
+ { 0x1c17fa390b281c17ULL, 0xfa390b281c17fa39ULL, },
+ { 0x008fffe5003a008fULL, 0xffe5003a008fffe5ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x300af6ee137c300aULL, 0xf6ee137c300af6eeULL, },
+ { 0xd08508f7ecbed085ULL, 0x08f7ecbed08508f7ULL, },
+ { 0x1d0cfa840bc81d0cULL, 0xfa840bc81d0cfa84ULL, },
+ { 0xe3830561f472e383ULL, 0x0561f472e3830561ULL, },
+ { 0x360d0f893f04360dULL, 0x0f893f04360d0f89ULL, },
+ { 0xca82f05cc136ca82ULL, 0xf05cc136ca82f05cULL, },
+ { 0xff73001dffc8ff73ULL, 0x001dffc8ff73001dULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd0a209beed30d0a2ULL, 0x09beed30d0a209beULL, },
+ { 0x2ed1f65f12982ed1ULL, 0xf65f12982ed1f65fULL, },
+ { 0xe35c05e4f4a0e35cULL, 0x05e4f4a0e35c05e4ULL, },
+ { 0x1c17fa390b281c17ULL, 0xfa390b281c17fa39ULL, },
+ { 0xca82f05cc136ca82ULL, 0xf05cc136ca82f05cULL, },
+ { 0x34f10fc13e9234f1ULL, 0x0fc13e9234f10fc1ULL, },
+ { 0x64240d342bc42c39ULL, 0x3f6a22fd3b1d1990ULL, }, /* 64 */
+ { 0xe704ebe4e24eef13ULL, 0x01a706951e1be630ULL, },
+ { 0x4ca419cce226b927ULL, 0xfb55fd241553f560ULL, },
+ { 0xec36ee202172098aULL, 0xd846ec28206404e0ULL, },
+ { 0xe704ebe4e24eef13ULL, 0x01a706951e1be630ULL, },
+ { 0x111d264945920cf1ULL, 0x0195153d113a1a54ULL, },
+ { 0xea70debeff82160dULL, 0x04260f88039c0b8aULL, },
+ { 0xe9721dc70769091eULL, 0xf8711c48091bf7e4ULL, },
+ { 0x4ca419cce226b927ULL, 0xfb55fd241553f560ULL, }, /* 72 */
+ { 0xea70debeff82160dULL, 0x04260f88039c0b8aULL, },
+ { 0x3b3437281d127579ULL, 0x0c310d25237206e9ULL, },
+ { 0xf706df16dc8de6b6ULL, 0xf0d31b5827f9f42aULL, },
+ { 0xec36ee202172098aULL, 0xd846ec28206404e0ULL, },
+ { 0xe9721dc70769091eULL, 0xf8711c48091bf7e4ULL, },
+ { 0xf706df16dc8de6b6ULL, 0xf0d31b5827f9f42aULL, },
+ { 0x4961190d2be51b48ULL, 0x348a3e802e952784ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c
new file mode 100644
index 0000000000..e635888e6c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DOTP_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DOTP_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaac0000aaacULL, 0x0000aaac0000aaacULL, },
+ { 0xffff5556ffff5556ULL, 0xffff5556ffff5556ULL, },
+ { 0x0000666800006668ULL, 0x0000666800006668ULL, },
+ { 0xffff999affff999aULL, 0xffff999affff999aULL, },
+ { 0xffffe38f00008e3aULL, 0x000038e5ffffe38fULL, },
+ { 0x00001c73ffff71c8ULL, 0xffffc71d00001c73ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaac0000aaacULL, 0x0000aaac0000aaacULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e471c838e471c8ULL, 0x38e471c838e471c8ULL, },
+ { 0xc71c38e4c71c38e4ULL, 0xc71c38e4c71c38e4ULL, },
+ { 0x2222eef02222eef0ULL, 0x2222eef02222eef0ULL, },
+ { 0xddddbbbcddddbbbcULL, 0xddddbbbcddddbbbcULL, },
+ { 0xf684ed0a2f69097cULL, 0x12f725eef684ed0aULL, },
+ { 0x097bbda2d097a130ULL, 0xed0984be097bbda2ULL, },
+ { 0xffff5556ffff5556ULL, 0xffff5556ffff5556ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c38e4c71c38e4ULL, 0xc71c38e4c71c38e4ULL, },
+ { 0x38e31c7238e31c72ULL, 0x38e31c7238e31c72ULL, },
+ { 0xdddd7778dddd7778ULL, 0xdddd7778dddd7778ULL, },
+ { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, },
+ { 0x097af685d09784beULL, 0xed0912f7097af685ULL, },
+ { 0xf6845ed12f67d098ULL, 0x12f6425ff6845ed1ULL, },
+ { 0x0000666800006668ULL, 0x0000666800006668ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222eef02222eef0ULL, 0x2222eef02222eef0ULL, },
+ { 0xdddd7778dddd7778ULL, 0xdddd7778dddd7778ULL, },
+ { 0x147b8520147b8520ULL, 0x147b8520147b8520ULL, },
+ { 0xeb84e148eb84e148ULL, 0xeb84e148eb84e148ULL, },
+ { 0xfa4fb60c1c7271c8ULL, 0x0b612d84fa4fb60cULL, },
+ { 0x05b0b05ce38df4a0ULL, 0xf49f38e405b0b05cULL, },
+ { 0xffff999affff999aULL, 0xffff999affff999aULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xddddbbbcddddbbbcULL, 0xddddbbbcddddbbbcULL, },
+ { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, },
+ { 0xeb84e148eb84e148ULL, 0xeb84e148eb84e148ULL, },
+ { 0x147ab852147ab852ULL, 0x147ab852147ab852ULL, },
+ { 0x05b02d83e38e1c72ULL, 0xf49f0b6105b02d83ULL, },
+ { 0xfa4f6c171c717d28ULL, 0x0b608e39fa4f6c17ULL, },
+ { 0xffffe38f00008e3aULL, 0x000038e5ffffe38fULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xf684ed0a2f69097cULL, 0x12f725eef684ed0aULL, },
+ { 0x097af685d09784beULL, 0xed0912f7097af685ULL, },
+ { 0xfa4fb60c1c7271c8ULL, 0x0b612d84fa4fb60cULL, },
+ { 0x05b02d83e38e1c72ULL, 0xf49f0b6105b02d83ULL, },
+ { 0x0fcd3c0d35bb4f04ULL, 0x3f3645890fcd3c0dULL, },
+ { 0xf032a782ca453f36ULL, 0xc0c9f35cf032a782ULL, },
+ { 0x00001c73ffff71c8ULL, 0xffffc71d00001c73ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x097bbda2d097a130ULL, 0xed0984be097bbda2ULL, },
+ { 0xf6845ed12f67d098ULL, 0x12f6425ff6845ed1ULL, },
+ { 0x05b0b05ce38df4a0ULL, 0xf49f38e405b0b05cULL, },
+ { 0xfa4f6c171c717d28ULL, 0x0b608e39fa4f6c17ULL, },
+ { 0xf032a782ca453f36ULL, 0xc0c9f35cf032a782ULL, },
+ { 0x0fcd74f135ba3292ULL, 0x3f35d3c10fcd74f1ULL, },
+ { 0x3a57fe7422c25584ULL, 0x16b6b9f518facfa9ULL, }, /* 64 */
+ { 0x01f36d90f9441446ULL, 0x0286cfede5f4db15ULL, },
+ { 0x2f1518bcce21d93eULL, 0x0934568af4ec6499ULL, },
+ { 0xc9576c1204f83042ULL, 0xd91d3e4709b06e36ULL, },
+ { 0x01f36d90f9441446ULL, 0x0286cfede5f4db15ULL, },
+ { 0x0012474d242f32a9ULL, 0x13f2a8f51ca9cd91ULL, },
+ { 0x0144b48a04a7d0ddULL, 0x124b1c4e04fa8e45ULL, },
+ { 0xfe2a6f6923268793ULL, 0x179e9377ef4766beULL, },
+ { 0x2f1518bcce21d93eULL, 0x0934568af4ec6499ULL, }, /* 72 */
+ { 0x0144b48a04a7d0ddULL, 0x124b1c4e04fa8e45ULL, },
+ { 0x352c988848431561ULL, 0x12e4f841217b42c9ULL, },
+ { 0xd437b4e8f3b0139fULL, 0x08c7d980187d5896ULL, },
+ { 0xc9576c1204f83042ULL, 0xd91d3e4709b06e36ULL, },
+ { 0xfe2a6f6923268793ULL, 0x179e9377ef4766beULL, },
+ { 0xd437b4e8f3b0139fULL, 0x08c7d980187d5896ULL, },
+ { 0x33368b8a2619d525ULL, 0x6a47932120c31904ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c
new file mode 100644
index 0000000000..af4337d02c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DOTP_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DOTP_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffc00000002ULL, 0xfffffffc00000002ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x55555552aaaaaaacULL, 0x55555552aaaaaaacULL, },
+ { 0xaaaaaaa955555556ULL, 0xaaaaaaa955555556ULL, },
+ { 0x9999999666666668ULL, 0x9999999666666668ULL, },
+ { 0x666666659999999aULL, 0x666666659999999aULL, },
+ { 0x71c71c6f8e38e38fULL, 0x1c71c719e38e38e5ULL, },
+ { 0x8e38e38c71c71c73ULL, 0xe38e38e21c71c71dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x55555552aaaaaaacULL, 0x55555552aaaaaaacULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e1c71c71c8ULL, 0xe38e38e1c71c71c8ULL, },
+ { 0x71c71c70e38e38e4ULL, 0x71c71c70e38e38e4ULL, },
+ { 0x1111110eeeeeeef0ULL, 0x1111110eeeeeeef0ULL, },
+ { 0x44444443bbbbbbbcULL, 0x44444443bbbbbbbcULL, },
+ { 0xf684bd9fb425ed0aULL, 0xbda12f6697b425eeULL, },
+ { 0x5ed097b2f684bda2ULL, 0x97b425ec12f684beULL, },
+ { 0xaaaaaaa955555556ULL, 0xaaaaaaa955555556ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x71c71c70e38e38e4ULL, 0x71c71c70e38e38e4ULL, },
+ { 0x38e38e3871c71c72ULL, 0x38e38e3871c71c72ULL, },
+ { 0x8888888777777778ULL, 0x8888888777777778ULL, },
+ { 0x22222221dddddddeULL, 0x22222221dddddddeULL, },
+ { 0x7b425ecfda12f685ULL, 0x5ed097b34bda12f7ULL, },
+ { 0x2f684bd97b425ed1ULL, 0x4bda12f6097b425fULL, },
+ { 0x9999999666666668ULL, 0x9999999666666668ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1111110eeeeeeef0ULL, 0x1111110eeeeeeef0ULL, },
+ { 0x8888888777777778ULL, 0x8888888777777778ULL, },
+ { 0x47ae147851eb8520ULL, 0x47ae147851eb8520ULL, },
+ { 0x51eb851e147ae148ULL, 0x51eb851e147ae148ULL, },
+ { 0x27d27d260b60b60cULL, 0xe38e38e182d82d84ULL, },
+ { 0x71c71c705b05b05cULL, 0xb60b60b4e38e38e4ULL, },
+ { 0x666666659999999aULL, 0x666666659999999aULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x44444443bbbbbbbcULL, 0x44444443bbbbbbbcULL, },
+ { 0x22222221dddddddeULL, 0x22222221dddddddeULL, },
+ { 0x51eb851e147ae148ULL, 0x51eb851e147ae148ULL, },
+ { 0x147ae147851eb852ULL, 0x147ae147851eb852ULL, },
+ { 0x49f49f4982d82d83ULL, 0x38e38e3860b60b61ULL, },
+ { 0x1c71c71c16c16c17ULL, 0x2d82d82d38e38e39ULL, },
+ { 0x71c71c6f8e38e38fULL, 0x1c71c719e38e38e5ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xf684bd9fb425ed0aULL, 0xbda12f6697b425eeULL, },
+ { 0x7b425ecfda12f685ULL, 0x5ed097b34bda12f7ULL, },
+ { 0x27d27d260b60b60cULL, 0xe38e38e182d82d84ULL, },
+ { 0x49f49f4982d82d83ULL, 0x38e38e3860b60b61ULL, },
+ { 0x1948b0fb9add3c0dULL, 0xd6e9e063c0ca4589ULL, },
+ { 0x587e6b73f35ba782ULL, 0x4587e6b622c3f35cULL, },
+ { 0x8e38e38c71c71c73ULL, 0xe38e38e21c71c71dULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5ed097b2f684bda2ULL, 0x97b425ec12f684beULL, },
+ { 0x2f684bd97b425ed1ULL, 0x4bda12f6097b425fULL, },
+ { 0x71c71c705b05b05cULL, 0xb60b60b4e38e38e4ULL, },
+ { 0x1c71c71c16c16c17ULL, 0x2d82d82d38e38e39ULL, },
+ { 0x587e6b73f35ba782ULL, 0x4587e6b622c3f35cULL, },
+ { 0x35ba78187e6b74f1ULL, 0x9e06522bf9add3c1ULL, },
+ { 0x4f10a2461266c290ULL, 0x132f373daebdb714ULL, }, /* 64 */
+ { 0x9262f356f7d6aae4ULL, 0x1ab54eb3f08ff55cULL, },
+ { 0x7927f2d937c84b78ULL, 0xb5e40e840fde8392ULL, },
+ { 0x4ab4e3ab9f696cdcULL, 0xd21109f6644a26d0ULL, },
+ { 0x9262f356f7d6aae4ULL, 0x1ab54eb3f08ff55cULL, },
+ { 0x0f105ccfb2e19689ULL, 0x032b395187d966b4ULL, },
+ { 0xe1cb8469b5aa67beULL, 0x1128ae6a67ae6296ULL, },
+ { 0x8afc46ad9bff5437ULL, 0x1890b25301b40370ULL, },
+ { 0x7927f2d937c84b78ULL, 0xb5e40e840fde8392ULL, }, /* 72 */
+ { 0xe1cb8469b5aa67beULL, 0x1128ae6a67ae6296ULL, },
+ { 0xfae79ab59bb7c8e4ULL, 0x78a66f004d163b91ULL, },
+ { 0x8ffb559e72a2a622ULL, 0x8744321b668933a8ULL, },
+ { 0x4ab4e3ab9f696cdcULL, 0xd21109f6644a26d0ULL, },
+ { 0x8afc46ad9bff5437ULL, 0x1890b25301b40370ULL, },
+ { 0x8ffb559e72a2a622ULL, 0x8744321b668933a8ULL, },
+ { 0x53edf7dbd76122edULL, 0xbe9d5551c2f51a40ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c
new file mode 100644
index 0000000000..a87b72b121
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DOTP_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DOTP_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfc02fc02fc02fc02ULL, 0xfc02fc02fc02fc02ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x52ac52ac52ac52acULL, 0x52ac52ac52ac52acULL, },
+ { 0xa956a956a956a956ULL, 0xa956a956a956a956ULL, },
+ { 0x9668966896689668ULL, 0x9668966896689668ULL, },
+ { 0x659a659a659a659aULL, 0x659a659a659a659aULL, },
+ { 0x6f8f19e5c53a6f8fULL, 0x19e5c53a6f8f19e5ULL, },
+ { 0x8c73e21d36c88c73ULL, 0xe21d36c88c73e21dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x52ac52ac52ac52acULL, 0x52ac52ac52ac52acULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe1c8e1c8e1c8e1c8ULL, 0xe1c8e1c8e1c8e1c8ULL, },
+ { 0x70e470e470e470e4ULL, 0x70e470e470e470e4ULL, },
+ { 0x0ef00ef00ef00ef0ULL, 0x0ef00ef00ef00ef0ULL, },
+ { 0x43bc43bc43bc43bcULL, 0x43bc43bc43bc43bcULL, },
+ { 0xf50abbee837cf50aULL, 0xbbee837cf50abbeeULL, },
+ { 0x5da296becf305da2ULL, 0x96becf305da296beULL, },
+ { 0xa956a956a956a956ULL, 0xa956a956a956a956ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x70e470e470e470e4ULL, 0x70e470e470e470e4ULL, },
+ { 0x3872387238723872ULL, 0x3872387238723872ULL, },
+ { 0x8778877887788778ULL, 0x8778877887788778ULL, },
+ { 0x21de21de21de21deULL, 0x21de21de21de21deULL, },
+ { 0x7a855df741be7a85ULL, 0x5df741be7a855df7ULL, },
+ { 0x2ed14b5f67982ed1ULL, 0x4b5f67982ed14b5fULL, },
+ { 0x9668966896689668ULL, 0x9668966896689668ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0ef00ef00ef00ef0ULL, 0x0ef00ef00ef00ef0ULL, },
+ { 0x8778877887788778ULL, 0x8778877887788778ULL, },
+ { 0x4520452045204520ULL, 0x4520452045204520ULL, },
+ { 0x5148514851485148ULL, 0x5148514851485148ULL, },
+ { 0x260ce1849dc8260cULL, 0xe1849dc8260ce184ULL, },
+ { 0x705cb4e4f8a0705cULL, 0xb4e4f8a0705cb4e4ULL, },
+ { 0x659a659a659a659aULL, 0x659a659a659a659aULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x43bc43bc43bc43bcULL, 0x43bc43bc43bc43bcULL, },
+ { 0x21de21de21de21deULL, 0x21de21de21de21deULL, },
+ { 0x5148514851485148ULL, 0x5148514851485148ULL, },
+ { 0x1452145214521452ULL, 0x1452145214521452ULL, },
+ { 0x4983386127724983ULL, 0x3861277249833861ULL, },
+ { 0x1c172d393e281c17ULL, 0x2d393e281c172d39ULL, },
+ { 0x6f8f19e5c53a6f8fULL, 0x19e5c53a6f8f19e5ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xf50abbee837cf50aULL, 0xbbee837cf50abbeeULL, },
+ { 0x7a855df741be7a85ULL, 0x5df741be7a855df7ULL, },
+ { 0x260ce1849dc8260cULL, 0xe1849dc8260ce184ULL, },
+ { 0x4983386127724983ULL, 0x3861277249833861ULL, },
+ { 0x180dd5895b04180dULL, 0xd5895b04180dd589ULL, },
+ { 0x5782445c6a365782ULL, 0x445c6a365782445cULL, },
+ { 0x8c73e21d36c88c73ULL, 0xe21d36c88c73e21dULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5da296becf305da2ULL, 0x96becf305da296beULL, },
+ { 0x2ed14b5f67982ed1ULL, 0x4b5f67982ed14b5fULL, },
+ { 0x705cb4e4f8a0705cULL, 0xb4e4f8a0705cb4e4ULL, },
+ { 0x1c172d393e281c17ULL, 0x2d393e281c172d39ULL, },
+ { 0x5782445c6a365782ULL, 0x445c6a365782445cULL, },
+ { 0x34f19dc1cc9234f1ULL, 0x9dc1cc9234f19dc1ULL, },
+ { 0x742471342bc42c39ULL, 0x3f6a22fd371d7990ULL, }, /* 64 */
+ { 0xd4044ee4444e4413ULL, 0x68a71195331b4430ULL, },
+ { 0x80a423cc6c264e27ULL, 0x62556624be531a60ULL, },
+ { 0x5c36512021725e8aULL, 0x8a465528c764a2e0ULL, },
+ { 0xd4044ee4444e4413ULL, 0x68a71195331b4430ULL, },
+ { 0x831d26496b929af1ULL, 0xef958b3d113a1254ULL, },
+ { 0xeb7041beae82700dULL, 0xd326aa88189c1f8aULL, },
+ { 0xa8721dc73869b21eULL, 0xf27179481e1be5e4ULL, },
+ { 0x80a423cc6c264e27ULL, 0x62556624be531a60ULL, }, /* 72 */
+ { 0xeb7041beae82700dULL, 0xd326aa88189c1f8aULL, },
+ { 0x9334e7282d128b79ULL, 0xbc319725797206e9ULL, },
+ { 0x670642166b8da1b6ULL, 0xe0d340587bf92d2aULL, },
+ { 0x5c36512021725e8aULL, 0x8a465528c764a2e0ULL, },
+ { 0xa8721dc73869b21eULL, 0xf27179481e1be5e4ULL, },
+ { 0x670642166b8da1b6ULL, 0xe0d340587bf92d2aULL, },
+ { 0x4961190d2be5df48ULL, 0x308afe8080952b84ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c
new file mode 100644
index 0000000000..05df4cb583
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction DOTP_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DOTP_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffc0002fffc0002ULL, 0xfffc0002fffc0002ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5552aaac5552aaacULL, 0x5552aaac5552aaacULL, },
+ { 0xaaa95556aaa95556ULL, 0xaaa95556aaa95556ULL, },
+ { 0x9996666899966668ULL, 0x9996666899966668ULL, },
+ { 0x6665999a6665999aULL, 0x6665999a6665999aULL, },
+ { 0x1c6fe38f71c48e3aULL, 0xc71a38e51c6fe38fULL, },
+ { 0xe38c1c738e3771c8ULL, 0x38e1c71de38c1c73ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5552aaac5552aaacULL, 0x5552aaac5552aaacULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38c71c8e38c71c8ULL, 0xe38c71c8e38c71c8ULL, },
+ { 0x71c638e471c638e4ULL, 0x71c638e471c638e4ULL, },
+ { 0x110eeef0110eeef0ULL, 0x110eeef0110eeef0ULL, },
+ { 0x4443bbbc4443bbbcULL, 0x4443bbbc4443bbbcULL, },
+ { 0xbd9fed0af683097cULL, 0x84bc25eebd9fed0aULL, },
+ { 0x97b2bda25ecfa130ULL, 0xd09684be97b2bda2ULL, },
+ { 0xaaa95556aaa95556ULL, 0xaaa95556aaa95556ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x71c638e471c638e4ULL, 0x71c638e471c638e4ULL, },
+ { 0x38e31c7238e31c72ULL, 0x38e31c7238e31c72ULL, },
+ { 0x8887777888877778ULL, 0x8887777888877778ULL, },
+ { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, },
+ { 0x5ecff6857b4184beULL, 0x425e12f75ecff685ULL, },
+ { 0x4bd95ed12f67d098ULL, 0x684b425f4bd95ed1ULL, },
+ { 0x9996666899966668ULL, 0x9996666899966668ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x110eeef0110eeef0ULL, 0x110eeef0110eeef0ULL, },
+ { 0x8887777888877778ULL, 0x8887777888877778ULL, },
+ { 0x47ab852047ab8520ULL, 0x47ab852047ab8520ULL, },
+ { 0x51eae14851eae148ULL, 0x51eae14851eae148ULL, },
+ { 0xe38cb60c27d071c8ULL, 0x9f482d84e38cb60cULL, },
+ { 0xb609b05c71c5f4a0ULL, 0xfa4e38e4b609b05cULL, },
+ { 0x6665999a6665999aULL, 0x6665999a6665999aULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4443bbbc4443bbbcULL, 0x4443bbbc4443bbbcULL, },
+ { 0x2221ddde2221dddeULL, 0x2221ddde2221dddeULL, },
+ { 0x51eae14851eae148ULL, 0x51eae14851eae148ULL, },
+ { 0x147ab852147ab852ULL, 0x147ab852147ab852ULL, },
+ { 0x38e32d8349f41c72ULL, 0x27d20b6138e32d83ULL, },
+ { 0x2d826c171c717d28ULL, 0x3e938e392d826c17ULL, },
+ { 0x1c6fe38f71c48e3aULL, 0xc71a38e51c6fe38fULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xbd9fed0af683097cULL, 0x84bc25eebd9fed0aULL, },
+ { 0x5ecff6857b4184beULL, 0x425e12f75ecff685ULL, },
+ { 0xe38cb60c27d071c8ULL, 0x9f482d84e38cb60cULL, },
+ { 0x38e32d8349f41c72ULL, 0x27d20b6138e32d83ULL, },
+ { 0xd6e93c0d19474f04ULL, 0x5ba64589d6e93c0dULL, },
+ { 0x4586a782587d3f36ULL, 0x6b73f35c4586a782ULL, },
+ { 0xe38c1c738e3771c8ULL, 0x38e1c71de38c1c73ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x97b2bda25ecfa130ULL, 0xd09684be97b2bda2ULL, },
+ { 0x4bd95ed12f67d098ULL, 0x684b425f4bd95ed1ULL, },
+ { 0xb609b05c71c5f4a0ULL, 0xfa4e38e4b609b05cULL, },
+ { 0x2d826c171c717d28ULL, 0x3e938e392d826c17ULL, },
+ { 0x4586a782587d3f36ULL, 0x6b73f35c4586a782ULL, },
+ { 0x9e0574f135ba3292ULL, 0xcd6dd3c19e0574f1ULL, },
+ { 0x18c3fe7422c25584ULL, 0x16b6b9f57608cfa9ULL, }, /* 64 */
+ { 0x867e6d904e841446ULL, 0x0de4cfed4e2fdb15ULL, },
+ { 0xf94f18bc4bc3d93eULL, 0x1492568ac3a66499ULL, },
+ { 0x4ff36c125a383042ULL, 0x2fe23e4744196e36ULL, },
+ { 0x867e6d904e841446ULL, 0x0de4cfed4e2fdb15ULL, },
+ { 0xf78e474db23f32a9ULL, 0x8a26a8f51ca9cd91ULL, },
+ { 0xa9bfb48aa4c2d0ddULL, 0x94641c4e1a398e45ULL, },
+ { 0x6e796f69cc7c8793ULL, 0x6e879377578266beULL, },
+ { 0xf94f18bc4bc3d93eULL, 0x1492568ac3a66499ULL, }, /* 72 */
+ { 0xa9bfb48aa4c2d0ddULL, 0x94641c4e1a398e45ULL, },
+ { 0xeb349888d2e11561ULL, 0xa0e2f84177d142c9ULL, },
+ { 0x5ad3b4e8bfaf139fULL, 0x8076d98091fe5896ULL, },
+ { 0x4ff36c125a383042ULL, 0x2fe23e4744196e36ULL, },
+ { 0x6e796f69cc7c8793ULL, 0x6e879377578266beULL, },
+ { 0x5ad3b4e8bfaf139fULL, 0x8076d98091fe5896ULL, },
+ { 0x33368b8aeab5d525ULL, 0x97d9932138871904ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DOTP_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_d.c
new file mode 100644
index 0000000000..d039e1a785
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPADD_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPADD_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 0 */
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, },
+ { 0x00000000aaaaaaaeULL, 0x00000000aaaaaaaeULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x000000006666666cULL, 0x000000006666666cULL, },
+ { 0x0000000000000006ULL, 0x0000000000000006ULL, },
+ { 0x000000008e38e395ULL, 0xffffffffe38e38ebULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, }, /* 8 */
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x00000000aaaaaab4ULL, 0x00000000aaaaaab4ULL, }, /* 16 */
+ { 0x00000000aaaaaab4ULL, 0x00000000aaaaaab4ULL, },
+ { 0x38e38e3a71c71c7cULL, 0x38e38e3a71c71c7cULL, },
+ { 0x0000000155555560ULL, 0x0000000155555560ULL, },
+ { 0x2222222444444450ULL, 0x2222222444444450ULL, },
+ { 0x000000020000000cULL, 0x000000020000000cULL, },
+ { 0x2f684bdcb425ed16ULL, 0xf684bda397b425faULL, },
+ { 0x00000002aaaaaab8ULL, 0x00000002aaaaaab8ULL, },
+ { 0x000000020000000eULL, 0x000000020000000eULL, }, /* 24 */
+ { 0x000000020000000eULL, 0x000000020000000eULL, },
+ { 0xc71c71c8e38e38f2ULL, 0xc71c71c8e38e38f2ULL, },
+ { 0x0000000155555564ULL, 0x0000000155555564ULL, },
+ { 0xdddddddeccccccdcULL, 0xdddddddeccccccdcULL, },
+ { 0x00000000aaaaaabaULL, 0x00000000aaaaaabaULL, },
+ { 0xd097b42684bda13fULL, 0x097b425ef684bdb1ULL, },
+ { 0x0000000000000010ULL, 0x0000000000000010ULL, },
+ { 0x0000000066666678ULL, 0x0000000066666678ULL, }, /* 32 */
+ { 0x0000000066666678ULL, 0x0000000066666678ULL, },
+ { 0x2222222355555568ULL, 0x2222222355555568ULL, },
+ { 0x00000000cccccce0ULL, 0x00000000cccccce0ULL, },
+ { 0x147ae1491eb85200ULL, 0x147ae1491eb85200ULL, },
+ { 0x0000000133333348ULL, 0x0000000133333348ULL, },
+ { 0x1c71c71e3e93e954ULL, 0xfa4fa4fbb60b60ccULL, },
+ { 0x00000001999999b0ULL, 0x00000001999999b0ULL, },
+ { 0x000000013333334aULL, 0x000000013333334aULL, }, /* 40 */
+ { 0x000000013333334aULL, 0x000000013333334aULL, },
+ { 0xdddddddeeeeeef06ULL, 0xdddddddeeeeeef06ULL, },
+ { 0x00000000cccccce4ULL, 0x00000000cccccce4ULL, },
+ { 0xeb851eb8e147ae2cULL, 0xeb851eb8e147ae2cULL, },
+ { 0x000000006666667eULL, 0x000000006666667eULL, },
+ { 0xe38e38e3e93e9401ULL, 0x05b05b05c71c71dfULL, },
+ { 0x0000000000000018ULL, 0x0000000000000018ULL, },
+ { 0x000000008e38e3a7ULL, 0xffffffffe38e38fdULL, }, /* 48 */
+ { 0x000000008e38e3a7ULL, 0xffffffffe38e38fdULL, },
+ { 0x2f684bdb425ed0b1ULL, 0xf684bda17b425eebULL, },
+ { 0x000000011c71c736ULL, 0xffffffffc71c71e2ULL, },
+ { 0x1c71c71e27d27d42ULL, 0xfa4fa4fa49f49f66ULL, },
+ { 0x00000001aaaaaac5ULL, 0xffffffffaaaaaac7ULL, },
+ { 0x35ba781b4587e6d2ULL, 0x0fcd6e9d6b74f050ULL, },
+ { 0x0000000238e38e54ULL, 0xffffffff8e38e3acULL, },
+ { 0x00000001aaaaaac7ULL, 0xffffffffaaaaaac9ULL, }, /* 56 */
+ { 0x00000001aaaaaac7ULL, 0xffffffffaaaaaac9ULL, },
+ { 0xd097b427a12f6869ULL, 0x097b425ebda12f87ULL, },
+ { 0x000000011c71c73aULL, 0xffffffffc71c71e6ULL, },
+ { 0xe38e38e477777796ULL, 0x05b05b05aaaaaacaULL, },
+ { 0x000000008e38e3adULL, 0xffffffffe38e3903ULL, },
+ { 0xca4587e781948b2fULL, 0xf032916206522c5fULL, },
+ { 0x0000000000000020ULL, 0x0000000000000020ULL, },
+ { 0x3e3ad4ae1266c2b0ULL, 0x1637d725aebdb734ULL, }, /* 64 */
+ { 0x4c74e0d60a3d6d94ULL, 0x1badd2dd9f4dac90ULL, },
+ { 0x6874e8f94205b90cULL, 0x27eb0c41af2c3022ULL, },
+ { 0x42dab657e16f25e8ULL, 0x06d6782e137656f2ULL, },
+ { 0x5114c27fd945d0ccULL, 0x0c4c73e604064c4eULL, },
+ { 0x68a91e898c276755ULL, 0x0f77ad378bdfb302ULL, },
+ { 0x54c82cde41d1cf13ULL, 0x0b6108a5f38e1598ULL, },
+ { 0x6f755d3eddd1234aULL, 0xfbbaace2f5421908ULL, },
+ { 0x8b75656215996ec2ULL, 0x07f7e64705209c9aULL, }, /* 72 */
+ { 0x779473b6cb43d680ULL, 0x03e141b56cceff30ULL, },
+ { 0xa6279a1866fb9f64ULL, 0x2631668db9e53ac1ULL, },
+ { 0x67a1f71bd99e4586ULL, 0x312ec9f6206e6e69ULL, },
+ { 0x4207c47a7907b262ULL, 0x101a35e284b89539ULL, },
+ { 0x5cb4f4db15070699ULL, 0x0073da1f866c98a9ULL, },
+ { 0x1e2f51de87a9acbbULL, 0x0b713d87ecf5cc51ULL, },
+ { 0x721d49ba5f0acfa8ULL, 0x5ba5bbe9afeae691ULL, },
+ { 0x4bcd68690d995de0ULL, 0x771da6b4b6c967ebULL, }, /* 80 */
+ { 0x4ea9a2cfbb5acd7bULL, 0x79dd6a73439e6387ULL, },
+ { 0x47c800b999dd2371ULL, 0x766d25914ef7a7a0ULL, },
+ { 0x41b0fa10eb77cf84ULL, 0x26e85189458965f8ULL, },
+ { 0x1fc448ce062c2944ULL, 0x31f490a9422a80e6ULL, },
+ { 0x211bdfadfd79770eULL, 0x3b25f4cac5763378ULL, },
+ { 0x16fbb87edd87b6f0ULL, 0x57c0b65fabdda20eULL, },
+ { 0x14621091eac4a5f6ULL, 0x4d29a25d32fa9ef6ULL, },
+ { 0x07832ded1c464b02ULL, 0x6396905709e3cfa4ULL, }, /* 88 */
+ { 0x0ff4a84eab8df3b9ULL, 0x6bc9a7d8c6adf2eaULL, },
+ { 0x21e53326bfbd0b05ULL, 0x8f8f3b9c679dff5aULL, },
+ { 0x191ed6a24e1576f9ULL, 0x9e8c2e402760373aULL, },
+ { 0x19b438400fc27751ULL, 0x819c4bbfd3ee6972ULL, },
+ { 0x1e0d5dc1094ae999ULL, 0x7496a289f5eff010ULL, },
+ { 0x11af620b7bc03943ULL, 0x8a11f229836addc7ULL, },
+ { 0x46fa45d0e84440fcULL, 0xe8d2c0211fb042bfULL, },
+ { 0x22142516b5a8adbcULL, 0xe1cf1923e186aad1ULL, }, /* 96 */
+ { 0x066ebbbb4ff6da44ULL, 0xd918d7e6a7e61877ULL, },
+ { 0x100acc9d22839a48ULL, 0xce291932929e367fULL, },
+ { 0x0dfe419d62a62f64ULL, 0xc020fe45a8cf7acfULL, },
+ { 0x2ba79b6ffbf3c63bULL, 0xb428f52c49fce695ULL, },
+ { 0x29b3b85200bdf100ULL, 0xb4ae7ea2f52aa5b9ULL, },
+ { 0x293bb84d6360c0b6ULL, 0xae33b26e4c493c49ULL, },
+ { 0x46a99fdf54f4862dULL, 0xae790dc5055f6f51ULL, },
+ { 0x18480e0fd728c7c3ULL, 0xa000ad7b15f8ebe0ULL, }, /* 104 */
+ { 0x1b8b97aa205e1239ULL, 0x89c78b8909c4a8e5ULL, },
+ { 0x09abb26b05ef649dULL, 0x74242fa1bd49e740ULL, },
+ { 0x04e233bc861d272bULL, 0x9c5343ab30f62f9fULL, },
+ { 0xda2da0d0884dc3d1ULL, 0xb824f201640b4147ULL, },
+ { 0x9d8b22ee1b9a2e0fULL, 0xb642ddf1edb0747fULL, },
+ { 0x7c81956533686a37ULL, 0xdd5181781dc3ad37ULL, },
+ { 0xc60b1905717ff25aULL, 0xe2af726e71ad7ad7ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c
new file mode 100644
index 0000000000..bcaafe3b71
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPADD_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPADD_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 0 */
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x00ae00ae00ae00aeULL, 0x00ae00ae00ae00aeULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x006c006c006c006cULL, 0x006c006c006c006cULL, },
+ { 0x0006000600060006ULL, 0x0006000600060006ULL, },
+ { 0x0095ffeb00400095ULL, 0xffeb00400095ffebULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, }, /* 8 */
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x00b400b400b400b4ULL, 0x00b400b400b400b4ULL, }, /* 16 */
+ { 0x00b400b400b400b4ULL, 0x00b400b400b400b4ULL, },
+ { 0x3a7c3a7c3a7c3a7cULL, 0x3a7c3a7c3a7c3a7cULL, },
+ { 0x0160016001600160ULL, 0x0160016001600160ULL, },
+ { 0x2450245024502450ULL, 0x2450245024502450ULL, },
+ { 0x020c020c020c020cULL, 0x020c020c020c020cULL, },
+ { 0x3216f8fa15883216ULL, 0xf8fa15883216f8faULL, },
+ { 0x02b802b802b802b8ULL, 0x02b802b802b802b8ULL, },
+ { 0x020e020e020e020eULL, 0x020e020e020e020eULL, }, /* 24 */
+ { 0x020e020e020e020eULL, 0x020e020e020e020eULL, },
+ { 0xc8f2c8f2c8f2c8f2ULL, 0xc8f2c8f2c8f2c8f2ULL, },
+ { 0x0164016401640164ULL, 0x0164016401640164ULL, },
+ { 0xdedcdedcdedcdedcULL, 0xdedcdedcdedcdedcULL, },
+ { 0x00ba00ba00ba00baULL, 0x00ba00ba00ba00baULL, },
+ { 0xd13f09b1ed78d13fULL, 0x09b1ed78d13f09b1ULL, },
+ { 0x0010001000100010ULL, 0x0010001000100010ULL, },
+ { 0x0078007800780078ULL, 0x0078007800780078ULL, }, /* 32 */
+ { 0x0078007800780078ULL, 0x0078007800780078ULL, },
+ { 0x2368236823682368ULL, 0x2368236823682368ULL, },
+ { 0x00e000e000e000e0ULL, 0x00e000e000e000e0ULL, },
+ { 0x1600160016001600ULL, 0x1600160016001600ULL, },
+ { 0x0148014801480148ULL, 0x0148014801480148ULL, },
+ { 0x1e54fbcc0d101e54ULL, 0xfbcc0d101e54fbccULL, },
+ { 0x01b001b001b001b0ULL, 0x01b001b001b001b0ULL, },
+ { 0x014a014a014a014aULL, 0x014a014a014a014aULL, }, /* 40 */
+ { 0x014a014a014a014aULL, 0x014a014a014a014aULL, },
+ { 0xdf06df06df06df06ULL, 0xdf06df06df06df06ULL, },
+ { 0x00e400e400e400e4ULL, 0x00e400e400e400e4ULL, },
+ { 0xec2cec2cec2cec2cULL, 0xec2cec2cec2cec2cULL, },
+ { 0x007e007e007e007eULL, 0x007e007e007e007eULL, },
+ { 0xe40105dff4f0e401ULL, 0x05dff4f0e40105dfULL, },
+ { 0x0018001800180018ULL, 0x0018001800180018ULL, },
+ { 0x00a7fffd005200a7ULL, 0xfffd005200a7fffdULL, }, /* 48 */
+ { 0x00a7fffd005200a7ULL, 0xfffd005200a7fffdULL, },
+ { 0x30b1f6eb13ce30b1ULL, 0xf6eb13ce30b1f6ebULL, },
+ { 0x0136ffe2008c0136ULL, 0xffe2008c0136ffe2ULL, },
+ { 0x1e42fa660c541e42ULL, 0xfa660c541e42fa66ULL, },
+ { 0x01c5ffc700c601c5ULL, 0xffc700c601c5ffc7ULL, },
+ { 0x37d20f503fca37d2ULL, 0x0f503fca37d20f50ULL, },
+ { 0x0254ffac01000254ULL, 0xffac01000254ffacULL, },
+ { 0x01c7ffc900c801c7ULL, 0xffc900c801c7ffc9ULL, }, /* 56 */
+ { 0x01c7ffc900c801c7ULL, 0xffc900c801c7ffc9ULL, },
+ { 0xd2690987edf8d269ULL, 0x0987edf8d2690987ULL, },
+ { 0x013affe60090013aULL, 0xffe60090013affe6ULL, },
+ { 0xe49605caf530e496ULL, 0x05caf530e49605caULL, },
+ { 0x00ad0003005800adULL, 0x0003005800ad0003ULL, },
+ { 0xcb2ff05fc18ecb2fULL, 0xf05fc18ecb2ff05fULL, },
+ { 0x0020002000200020ULL, 0x0020002000200020ULL, },
+ { 0x64440d542be42c59ULL, 0x3f8a231d3b3d19b0ULL, }, /* 64 */
+ { 0x4b48f9380e321b6cULL, 0x413129b25958ffe0ULL, },
+ { 0x97ec1304f058d493ULL, 0x3c8626d66eabf540ULL, },
+ { 0x8422012411cade1dULL, 0x14cc12fe8f0ffa20ULL, },
+ { 0x6b26ed08f418cd30ULL, 0x16731993ad2ae050ULL, },
+ { 0x7c43135139aada21ULL, 0x18082ed0be64faa4ULL, },
+ { 0x66b3f20f392cf02eULL, 0x1c2e3e58c200062eULL, },
+ { 0x50250fd64095f94cULL, 0x149f5aa0cb1bfe12ULL, },
+ { 0x9cc929a222bbb273ULL, 0x0ff457c4e06ef372ULL, }, /* 72 */
+ { 0x87390860223dc880ULL, 0x141a674ce40afefcULL, },
+ { 0xc26d3f883f4f3df9ULL, 0x204b7471077c05e5ULL, },
+ { 0xb9731e9e1bdc24afULL, 0x111e8fc92f75fa0fULL, },
+ { 0xa5a90cbe3d4e2e39ULL, 0xe9647bf14fd9feefULL, },
+ { 0x8f1b2a8544b73757ULL, 0xe1d5983958f4f6d3ULL, },
+ { 0x8621099b21441e0dULL, 0xd2a8b39180edeafdULL, },
+ { 0xcf8222a84d293955ULL, 0x0732f211af821281ULL, },
+ { 0xb24e311468e36182ULL, 0x1d5df7b5739a06edULL, }, /* 80 */
+ { 0x9fb838d0948447f9ULL, 0x1c22f28463ef0925ULL, },
+ { 0xa63c3700ca342b06ULL, 0x1b16f62c40350d56ULL, },
+ { 0x91603bbac05427d0ULL, 0x0dabf3fc381feb90ULL, },
+ { 0xed2843f4d67c28c3ULL, 0xef47f1f54694ece0ULL, },
+ { 0xe3373f50950e1df3ULL, 0xeb96f4e231bee6f8ULL, },
+ { 0x00111042b00d1732ULL, 0xf8f3f7b81663e296ULL, },
+ { 0x0550257c952a23bcULL, 0xfd4e0730286f0ddaULL, },
+ { 0x2418088a94861e5bULL, 0x1bcf191d5d740802ULL, }, /* 88 */
+ { 0x1d34dae8a7fc1a85ULL, 0x1f6e155281a10a8aULL, },
+ { 0x25f8ef24c16f4c23ULL, 0x12f7103e9bd702c4ULL, },
+ { 0x33b0f882bf8c4de5ULL, 0x0b68ff0eb3981908ULL, },
+ { 0xfaa812ea88fc60b6ULL, 0x38790427823a1198ULL, },
+ { 0x11760a6866984906ULL, 0x38280709862a18aaULL, },
+ { 0x355ee4445e3624a9ULL, 0x3a70056ab5ba156aULL, },
+ { 0x6990f6508b1005efULL, 0x19d2f282bd2beb34ULL, },
+ { 0x09f8e7147ee80358ULL, 0x0ea3c3a4d25af434ULL, }, /* 96 */
+ { 0x0270e58e89681a57ULL, 0xed529f3dfdf4fa64ULL, },
+ { 0x2fe0ff749ea038b9ULL, 0x08bfb178f83600f4ULL, },
+ { 0x0c98e7fe6a903991ULL, 0xf0f0da2312380064ULL, },
+ { 0x272ce738ba222968ULL, 0xf060e7ef217afed4ULL, },
+ { 0x1b11fce0969a2387ULL, 0xebe0ecf24235fee0ULL, },
+ { 0x1628f080a22617f4ULL, 0xeb86f0ea54aafebcULL, },
+ { 0x0b6abf0075b21275ULL, 0xee56f2fe4664ff28ULL, },
+ { 0x2d12d3d2642dcfbbULL, 0xde28f62c3ff20223ULL, }, /* 104 */
+ { 0x24a2f1b03fd408a0ULL, 0xd2baf84428ad0529ULL, },
+ { 0xf7c6115e36c734f8ULL, 0xd6a8f9d00d740916ULL, },
+ { 0xe656ec5832b62134ULL, 0xde02fb961c9f0c1bULL, },
+ { 0xf580051836e82d2eULL, 0xed2a0e7efa190093ULL, },
+ { 0xc9300cbe462435ecULL, 0xf33df43e02952973ULL, },
+ { 0xbff0f9ec66bc299eULL, 0xf581f02ee651f985ULL, },
+ { 0x9e90f34e7f2c06f4ULL, 0x01e3f07e04092877ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_w.c
new file mode 100644
index 0000000000..90562ab8a5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPADD_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPADD_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 0 */
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x0000aaae0000aaaeULL, 0x0000aaae0000aaaeULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000666c0000666cULL, 0x0000666c0000666cULL, },
+ { 0x0000000600000006ULL, 0x0000000600000006ULL, },
+ { 0xffffe39500008e40ULL, 0x000038ebffffe395ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, }, /* 8 */
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x0000aab40000aab4ULL, 0x0000aab40000aab4ULL, }, /* 16 */
+ { 0x0000aab40000aab4ULL, 0x0000aab40000aab4ULL, },
+ { 0x38e51c7c38e51c7cULL, 0x38e51c7c38e51c7cULL, },
+ { 0x0001556000015560ULL, 0x0001556000015560ULL, },
+ { 0x2224445022244450ULL, 0x2224445022244450ULL, },
+ { 0x0002000c0002000cULL, 0x0002000c0002000cULL, },
+ { 0xf686ed162f6b0988ULL, 0x12f925faf686ed16ULL, },
+ { 0x0002aab80002aab8ULL, 0x0002aab80002aab8ULL, },
+ { 0x0002000e0002000eULL, 0x0002000e0002000eULL, }, /* 24 */
+ { 0x0002000e0002000eULL, 0x0002000e0002000eULL, },
+ { 0xc71e38f2c71e38f2ULL, 0xc71e38f2c71e38f2ULL, },
+ { 0x0001556400015564ULL, 0x0001556400015564ULL, },
+ { 0xdddeccdcdddeccdcULL, 0xdddeccdcdddeccdcULL, },
+ { 0x0000aaba0000aabaULL, 0x0000aaba0000aabaULL, },
+ { 0x097ba13fd0982f78ULL, 0xed09bdb1097ba13fULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0x0000667800006678ULL, 0x0000667800006678ULL, }, /* 32 */
+ { 0x0000667800006678ULL, 0x0000667800006678ULL, },
+ { 0x2223556822235568ULL, 0x2223556822235568ULL, },
+ { 0x0000cce00000cce0ULL, 0x0000cce00000cce0ULL, },
+ { 0x147c5200147c5200ULL, 0x147c5200147c5200ULL, },
+ { 0x0001334800013348ULL, 0x0001334800013348ULL, },
+ { 0xfa50e9541c73a510ULL, 0x0b6260ccfa50e954ULL, },
+ { 0x000199b0000199b0ULL, 0x000199b0000199b0ULL, },
+ { 0x0001334a0001334aULL, 0x0001334a0001334aULL, }, /* 40 */
+ { 0x0001334a0001334aULL, 0x0001334a0001334aULL, },
+ { 0xdddeef06dddeef06ULL, 0xdddeef06dddeef06ULL, },
+ { 0x0000cce40000cce4ULL, 0x0000cce40000cce4ULL, },
+ { 0xeb85ae2ceb85ae2cULL, 0xeb85ae2ceb85ae2cULL, },
+ { 0x0000667e0000667eULL, 0x0000667e0000667eULL, },
+ { 0x05b09401e38e82f0ULL, 0xf49f71df05b09401ULL, },
+ { 0x0000001800000018ULL, 0x0000001800000018ULL, },
+ { 0xffffe3a700008e52ULL, 0x000038fdffffe3a7ULL, }, /* 48 */
+ { 0xffffe3a700008e52ULL, 0x000038fdffffe3a7ULL, },
+ { 0xf684d0b12f6997ceULL, 0x12f75eebf684d0b1ULL, },
+ { 0xffffc73600011c8cULL, 0x000071e2ffffc736ULL, },
+ { 0xfa4f7d421c738e54ULL, 0x0b619f66fa4f7d42ULL, },
+ { 0xffffaac50001aac6ULL, 0x0000aac7ffffaac5ULL, },
+ { 0x0fcce6d235bcf9caULL, 0x3f36f0500fcce6d2ULL, },
+ { 0xffff8e5400023900ULL, 0x0000e3acffff8e54ULL, },
+ { 0xffffaac70001aac8ULL, 0x0000aac9ffffaac7ULL, }, /* 56 */
+ { 0xffffaac70001aac8ULL, 0x0000aac9ffffaac7ULL, },
+ { 0x097b6869d0994bf8ULL, 0xed0a2f87097b6869ULL, },
+ { 0xffffc73a00011c90ULL, 0x000071e6ffffc73aULL, },
+ { 0x05b07796e38f1130ULL, 0xf49faaca05b07796ULL, },
+ { 0xffffe3ad00008e58ULL, 0x00003903ffffe3adULL, },
+ { 0xf0328b2fca45cd8eULL, 0xc0ca2c5ff0328b2fULL, },
+ { 0x0000002000000020ULL, 0x0000002000000020ULL, },
+ { 0x3a57fe9422c255a4ULL, 0x16b6ba1518facfc9ULL, }, /* 64 */
+ { 0x3c4b6c241c0669eaULL, 0x193d8a02feefaadeULL, },
+ { 0x6b6084e0ea284328ULL, 0x2271e08cf3dc0f77ULL, },
+ { 0x34b7f0f2ef20736aULL, 0xfb8f1ed3fd8c7dadULL, },
+ { 0x36ab5e82e86487b0ULL, 0xfe15eec0e38158c2ULL, },
+ { 0x36bda5cf0c93ba59ULL, 0x120897b5002b2653ULL, },
+ { 0x38025a59113b8b36ULL, 0x2453b4030525b498ULL, },
+ { 0x362cc9c2346212c9ULL, 0x3bf2477af46d1b56ULL, },
+ { 0x6541e27e0283ec07ULL, 0x45269e04e9597fefULL, }, /* 72 */
+ { 0x66869708072bbce4ULL, 0x5771ba52ee540e34ULL, },
+ { 0x9bb32f904f6ed245ULL, 0x6a56b2930fcf50fdULL, },
+ { 0x6feae478431ee5e4ULL, 0x731e8c13284ca993ULL, },
+ { 0x3942508a48171626ULL, 0x4c3bca5a31fd17c9ULL, },
+ { 0x376cbff36b3d9db9ULL, 0x63da5dd121447e87ULL, },
+ { 0x0ba474db5eedb158ULL, 0x6ca2375139c1d71dULL, },
+ { 0x3edb00658507867dULL, 0xd6e9ca725a84f021ULL, },
+ { 0x21746d8f492aab6bULL, 0xc86ec10d5ef05719ULL, }, /* 80 */
+ { 0x21105bf47228d8e1ULL, 0xd541f981830d22c5ULL, },
+ { 0xf90ba39c64a9aab9ULL, 0xd00d1cd8b17e0558ULL, },
+ { 0xedf1ebed93975370ULL, 0xd7fd3855cb7afcd4ULL, },
+ { 0xf85b68939e46773eULL, 0xceb49456ccc86662ULL, },
+ { 0xf8a465f666205360ULL, 0xe8078ebee9b86012ULL, },
+ { 0xdaa6e8fa242ed740ULL, 0xfd8488e8ff04a562ULL, },
+ { 0xc84291663638bd8eULL, 0x360ea9ec09bfe9aaULL, },
+ { 0xed300e0228a5c87eULL, 0x42280c3610aaee67ULL, }, /* 88 */
+ { 0xed8592684150f62dULL, 0x43c5604a0c58a5a1ULL, },
+ { 0x1661583a33e11b5dULL, 0x38e0b738fb2ab5fdULL, },
+ { 0x27e2359b43cb17c4ULL, 0x4169f958054c48f1ULL, },
+ { 0x0ff9c2b35666c87aULL, 0x546263e7ee7c57c1ULL, },
+ { 0x0f9e0bba7cf02cdcULL, 0x3fbf94eb097a6841ULL, },
+ { 0x06c9e6ca464484ecULL, 0x61838f28157007d3ULL, },
+ { 0x0791b5936e65c7d8ULL, 0x6a978c3b0d46a893ULL, },
+ { 0x0b5ca2c16d1c8082ULL, 0x84d8b2a628807419ULL, }, /* 96 */
+ { 0x0f3c4ea553ddefbaULL, 0x5d23288204008ac5ULL, },
+ { 0x006066f95bad42d4ULL, 0x7a5e585328976801ULL, },
+ { 0xf610532580647c0eULL, 0xa2551d9f07de4a9aULL, },
+ { 0xf65aca543e1e0beaULL, 0x936bdec820b433d4ULL, },
+ { 0xf66f1d9c4e4a0274ULL, 0x945159553437f0d0ULL, },
+ { 0xf6a34c5265777892ULL, 0x744c4f1e33a0fa19ULL, },
+ { 0xf6e8ae026961c977ULL, 0x679ecf7e36000115ULL, },
+ { 0x13ee44e6654e7066ULL, 0x828c7150244331b9ULL, }, /* 104 */
+ { 0xf787434e16614d78ULL, 0x55caaa201f72a96eULL, },
+ { 0xe4e9b290ecfd62e7ULL, 0x76440870087d3a2cULL, },
+ { 0x065e2c1ac531b8faULL, 0x86cb35600e1a0d9bULL, },
+ { 0x0d00c2eeb7cb8587ULL, 0xa3f3f27b07c3312fULL, },
+ { 0x0d62db84ab6f1a84ULL, 0xd3421106ff7d27d5ULL, },
+ { 0x10143b76893e48fbULL, 0xdf44d938fb177a2fULL, },
+ { 0x1c4ff82055152453ULL, 0xffe7837ceebc407dULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_S_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_d.c
new file mode 100644
index 0000000000..106dc73d1f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPADD_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPADD_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffc00000002ULL, 0xfffffffc00000002ULL, }, /* 0 */
+ { 0xfffffffc00000002ULL, 0xfffffffc00000002ULL, },
+ { 0x5555554eaaaaaaaeULL, 0x5555554eaaaaaaaeULL, },
+ { 0xfffffff800000004ULL, 0xfffffff800000004ULL, },
+ { 0x9999998e6666666cULL, 0x9999998e6666666cULL, },
+ { 0xfffffff400000006ULL, 0xfffffff400000006ULL, },
+ { 0x71c71c638e38e395ULL, 0x1c71c70de38e38ebULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, }, /* 8 */
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0xfffffff000000008ULL, 0xfffffff000000008ULL, },
+ { 0x55555542aaaaaab4ULL, 0x55555542aaaaaab4ULL, }, /* 16 */
+ { 0x55555542aaaaaab4ULL, 0x55555542aaaaaab4ULL, },
+ { 0x38e38e2471c71c7cULL, 0x38e38e2471c71c7cULL, },
+ { 0xaaaaaa9555555560ULL, 0xaaaaaa9555555560ULL, },
+ { 0xbbbbbba444444450ULL, 0xbbbbbba444444450ULL, },
+ { 0xffffffe80000000cULL, 0xffffffe80000000cULL, },
+ { 0xf684bd87b425ed16ULL, 0xbda12f4e97b425faULL, },
+ { 0x5555553aaaaaaab8ULL, 0x5555553aaaaaaab8ULL, },
+ { 0xffffffe40000000eULL, 0xffffffe40000000eULL, }, /* 24 */
+ { 0xffffffe40000000eULL, 0xffffffe40000000eULL, },
+ { 0x71c71c54e38e38f2ULL, 0x71c71c54e38e38f2ULL, },
+ { 0xaaaaaa8d55555564ULL, 0xaaaaaa8d55555564ULL, },
+ { 0x33333314ccccccdcULL, 0x33333314ccccccdcULL, },
+ { 0x55555536aaaaaabaULL, 0x55555536aaaaaabaULL, },
+ { 0xd097b40684bda13fULL, 0xb425ece9f684bdb1ULL, },
+ { 0xffffffe000000010ULL, 0xffffffe000000010ULL, },
+ { 0x9999997666666678ULL, 0x9999997666666678ULL, }, /* 32 */
+ { 0x9999997666666678ULL, 0x9999997666666678ULL, },
+ { 0xaaaaaa8555555568ULL, 0xaaaaaa8555555568ULL, },
+ { 0x3333330ccccccce0ULL, 0x3333330ccccccce0ULL, },
+ { 0x7ae147851eb85200ULL, 0x7ae147851eb85200ULL, },
+ { 0xcccccca333333348ULL, 0xcccccca333333348ULL, },
+ { 0xf49f49c93e93e954ULL, 0xb05b0584b60b60ccULL, },
+ { 0x66666639999999b0ULL, 0x66666639999999b0ULL, },
+ { 0xcccccc9f3333334aULL, 0xcccccc9f3333334aULL, }, /* 40 */
+ { 0xcccccc9f3333334aULL, 0xcccccc9f3333334aULL, },
+ { 0x111110e2eeeeef06ULL, 0x111110e2eeeeef06ULL, },
+ { 0x33333304cccccce4ULL, 0x33333304cccccce4ULL, },
+ { 0x851eb822e147ae2cULL, 0x851eb822e147ae2cULL, },
+ { 0x9999996a6666667eULL, 0x9999996a6666667eULL, },
+ { 0xe38e38b3e93e9401ULL, 0xd27d27a2c71c71dfULL, },
+ { 0xffffffd000000018ULL, 0xffffffd000000018ULL, },
+ { 0x71c71c3f8e38e3a7ULL, 0x1c71c6e9e38e38fdULL, }, /* 48 */
+ { 0x71c71c3f8e38e3a7ULL, 0x1c71c6e9e38e38fdULL, },
+ { 0x684bd9df425ed0b1ULL, 0xda12f6507b425eebULL, },
+ { 0xe38e38af1c71c736ULL, 0x38e38e03c71c71e2ULL, },
+ { 0x0b60b5d527d27d42ULL, 0x1c71c6e549f49f66ULL, },
+ { 0x5555551eaaaaaac5ULL, 0x5555551daaaaaac7ULL, },
+ { 0x6e9e061a4587e6d2ULL, 0x2c3f35816b74f050ULL, },
+ { 0xc71c718e38e38e54ULL, 0x71c71c378e38e3acULL, },
+ { 0x5555551aaaaaaac7ULL, 0x55555519aaaaaac9ULL, }, /* 56 */
+ { 0x5555551aaaaaaac7ULL, 0x55555519aaaaaac9ULL, },
+ { 0xb425eccda12f6869ULL, 0xed097b05bda12f87ULL, },
+ { 0xe38e38a71c71c73aULL, 0x38e38dfbc71c71e6ULL, },
+ { 0x5555551777777796ULL, 0xeeeeeeb0aaaaaacaULL, },
+ { 0x71c71c338e38e3adULL, 0x1c71c6dde38e3903ULL, },
+ { 0xca4587a781948b2fULL, 0x61f9ad9406522c5fULL, },
+ { 0xffffffc000000020ULL, 0xffffffc000000020ULL, },
+ { 0x4f10a2061266c2b0ULL, 0x132f36fdaebdb734ULL, }, /* 64 */
+ { 0xe173955d0a3d6d94ULL, 0x2de485b19f4dac90ULL, },
+ { 0x5a9b88364205b90cULL, 0xe3c89435af2c3022ULL, },
+ { 0xa5506be1e16f25e8ULL, 0xb5d99e2c137656f2ULL, },
+ { 0x37b35f38d945d0ccULL, 0xd08eece004064c4eULL, },
+ { 0x46c3bc088c276755ULL, 0xd3ba26318bdfb302ULL, },
+ { 0x288f407241d1cf13ULL, 0xe4e2d49bf38e1598ULL, },
+ { 0xb38b871fddd1234aULL, 0xfd7386eef5421908ULL, },
+ { 0x2cb379f915996ec2ULL, 0xb357957305209c9aULL, }, /* 72 */
+ { 0x0e7efe62cb43d680ULL, 0xc48043dd6cceff30ULL, },
+ { 0x0966991866fb9f64ULL, 0x3d26b2ddb9e53ac1ULL, },
+ { 0x9961eeb6d99e4586ULL, 0xc46ae4f9206e6e69ULL, },
+ { 0xe416d2627907b262ULL, 0x967beeef84b89539ULL, },
+ { 0x6f13191015070699ULL, 0xaf0ca142866c98a9ULL, },
+ { 0xff0e6eae87a9acbbULL, 0x3650d35decf5cc51ULL, },
+ { 0x52fc668a5f0acfa8ULL, 0xf4ee28afafeae691ULL, },
+ { 0x8e335693216733a0ULL, 0xebf294e7e1b7da9fULL, }, /* 80 */
+ { 0x242889888a96ab79ULL, 0x1029e138e123d999ULL, },
+ { 0xa117d2200713df49ULL, 0xa936d669733f9d55ULL, },
+ { 0xea5eaf7c9d524d27ULL, 0x533cccdee6d6ad0dULL, },
+ { 0x8014252a44e6c8b7ULL, 0x5139a5a2ff917d2dULL, },
+ { 0x12e82535692eaeadULL, 0x6c74742f3b1a47edULL, },
+ { 0x6bfad303a455af5fULL, 0xa4da8c7753e03c42ULL, },
+ { 0xd7d1673544f2b638ULL, 0x37b76789ca48e5eaULL, },
+ { 0x55b32da89b1ab874ULL, 0x1136a063291c7430ULL, }, /* 88 */
+ { 0xd8fa08f2c6e9500cULL, 0x15e6a0cfa25fce7eULL, },
+ { 0xfb6ec0cb14ee46c0ULL, 0x85e0ab776ca06e87ULL, },
+ { 0x7170744f4e43c44fULL, 0x17ee0476d6f5954fULL, },
+ { 0xba3c379c6c72bc03ULL, 0xf4a9e78f41249a57ULL, },
+ { 0x923c97db1bf9726fULL, 0x0c32ba5fa7655f81ULL, },
+ { 0x08ff0c9a1b07a05dULL, 0x7e05b61db39e9936ULL, },
+ { 0x16e37ad7ce0b9d05ULL, 0x3aa86333e7ca176eULL, },
+ { 0x4396d885c2a89499ULL, 0x3259d55cbbd56e50ULL, }, /* 96 */
+ { 0x86505184e2848fd5ULL, 0xfbe6ef6acb48e5d8ULL, },
+ { 0xf19ecbd2f0d9cb45ULL, 0x102d8886fc3ba2e4ULL, },
+ { 0x985e99073ad19cddULL, 0x0fae6c4a600fe8c8ULL, },
+ { 0x40076fc7eafc7c7aULL, 0x18d0edce69b82b2cULL, },
+ { 0xc633d71b8943703fULL, 0x236de461c55a6368ULL, },
+ { 0xb2b44afd6be31aa8ULL, 0x366f22bc07569aa2ULL, },
+ { 0x832148e5fdab87bfULL, 0x3b138b90c7099132ULL, },
+ { 0x9388b611f0bd2a51ULL, 0xc95a7ba92714878aULL, }, /* 104 */
+ { 0xa598b2d7184dc31bULL, 0x02d31201c0d1f3a9ULL, },
+ { 0x26b9d9c7d27ede61ULL, 0x84305afc61d71edcULL, },
+ { 0xd994c5da2b819a07ULL, 0xda2ed7517c38dd10ULL, },
+ { 0x490b25198d55f4bbULL, 0xa54a7d332b34db68ULL, },
+ { 0x9d17b063519fea3aULL, 0x1d81a65b0c1f8770ULL, },
+ { 0x000b355286100badULL, 0x35e1e113d0b4c238ULL, },
+ { 0x316423fb99a16a0dULL, 0xddbffc10af9e9540ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_h.c
new file mode 100644
index 0000000000..5fae97e907
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPADD_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPADD_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfc02fc02fc02fc02ULL, 0xfc02fc02fc02fc02ULL, }, /* 0 */
+ { 0xfc02fc02fc02fc02ULL, 0xfc02fc02fc02fc02ULL, },
+ { 0x4eae4eae4eae4eaeULL, 0x4eae4eae4eae4eaeULL, },
+ { 0xf804f804f804f804ULL, 0xf804f804f804f804ULL, },
+ { 0x8e6c8e6c8e6c8e6cULL, 0x8e6c8e6c8e6c8e6cULL, },
+ { 0xf406f406f406f406ULL, 0xf406f406f406f406ULL, },
+ { 0x63950debb9406395ULL, 0x0debb94063950debULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, }, /* 8 */
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0xf008f008f008f008ULL, 0xf008f008f008f008ULL, },
+ { 0x42b442b442b442b4ULL, 0x42b442b442b442b4ULL, }, /* 16 */
+ { 0x42b442b442b442b4ULL, 0x42b442b442b442b4ULL, },
+ { 0x247c247c247c247cULL, 0x247c247c247c247cULL, },
+ { 0x9560956095609560ULL, 0x9560956095609560ULL, },
+ { 0xa450a450a450a450ULL, 0xa450a450a450a450ULL, },
+ { 0xe80ce80ce80ce80cULL, 0xe80ce80ce80ce80cULL, },
+ { 0xdd16a3fa6b88dd16ULL, 0xa3fa6b88dd16a3faULL, },
+ { 0x3ab83ab83ab83ab8ULL, 0x3ab83ab83ab83ab8ULL, },
+ { 0xe40ee40ee40ee40eULL, 0xe40ee40ee40ee40eULL, }, /* 24 */
+ { 0xe40ee40ee40ee40eULL, 0xe40ee40ee40ee40eULL, },
+ { 0x54f254f254f254f2ULL, 0x54f254f254f254f2ULL, },
+ { 0x8d648d648d648d64ULL, 0x8d648d648d648d64ULL, },
+ { 0x14dc14dc14dc14dcULL, 0x14dc14dc14dc14dcULL, },
+ { 0x36ba36ba36ba36baULL, 0x36ba36ba36ba36baULL, },
+ { 0xb13f94b17878b13fULL, 0x94b17878b13f94b1ULL, },
+ { 0xe010e010e010e010ULL, 0xe010e010e010e010ULL, },
+ { 0x7678767876787678ULL, 0x7678767876787678ULL, }, /* 32 */
+ { 0x7678767876787678ULL, 0x7678767876787678ULL, },
+ { 0x8568856885688568ULL, 0x8568856885688568ULL, },
+ { 0x0ce00ce00ce00ce0ULL, 0x0ce00ce00ce00ce0ULL, },
+ { 0x5200520052005200ULL, 0x5200520052005200ULL, },
+ { 0xa348a348a348a348ULL, 0xa348a348a348a348ULL, },
+ { 0xc95484cc4110c954ULL, 0x84cc4110c95484ccULL, },
+ { 0x39b039b039b039b0ULL, 0x39b039b039b039b0ULL, },
+ { 0x9f4a9f4a9f4a9f4aULL, 0x9f4a9f4a9f4a9f4aULL, }, /* 40 */
+ { 0x9f4a9f4a9f4a9f4aULL, 0x9f4a9f4a9f4a9f4aULL, },
+ { 0xe306e306e306e306ULL, 0xe306e306e306e306ULL, },
+ { 0x04e404e404e404e4ULL, 0x04e404e404e404e4ULL, },
+ { 0x562c562c562c562cULL, 0x562c562c562c562cULL, },
+ { 0x6a7e6a7e6a7e6a7eULL, 0x6a7e6a7e6a7e6a7eULL, },
+ { 0xb401a2df91f0b401ULL, 0xa2df91f0b401a2dfULL, },
+ { 0xd018d018d018d018ULL, 0xd018d018d018d018ULL, },
+ { 0x3fa7e9fd95523fa7ULL, 0xe9fd95523fa7e9fdULL, }, /* 48 */
+ { 0x3fa7e9fd95523fa7ULL, 0xe9fd95523fa7e9fdULL, },
+ { 0x34b1a5eb18ce34b1ULL, 0xa5eb18ce34b1a5ebULL, },
+ { 0xaf3603e25a8caf36ULL, 0x03e25a8caf3603e2ULL, },
+ { 0xd542e566f854d542ULL, 0xe566f854d542e566ULL, },
+ { 0x1ec51dc71fc61ec5ULL, 0x1dc71fc61ec51dc7ULL, },
+ { 0x36d2f3507aca36d2ULL, 0xf3507aca36d2f350ULL, },
+ { 0x8e5437ace5008e54ULL, 0x37ace5008e5437acULL, },
+ { 0x1ac719c91bc81ac7ULL, 0x19c91bc81ac719c9ULL, }, /* 56 */
+ { 0x1ac719c91bc81ac7ULL, 0x19c91bc81ac719c9ULL, },
+ { 0x7869b087eaf87869ULL, 0xb087eaf87869b087ULL, },
+ { 0xa73afbe65290a73aULL, 0xfbe65290a73afbe6ULL, },
+ { 0x1796b0ca4b301796ULL, 0xb0ca4b301796b0caULL, },
+ { 0x33adde03895833adULL, 0xde03895833adde03ULL, },
+ { 0x8b2f225ff38e8b2fULL, 0x225ff38e8b2f225fULL, },
+ { 0xc020c020c020c020ULL, 0xc020c020c020c020ULL, },
+ { 0x34443154ebe4ec59ULL, 0xff8ae31df73d39b0ULL, }, /* 64 */
+ { 0x084880383032306cULL, 0x6831f4b22a587de0ULL, },
+ { 0x88eca4049c587e93ULL, 0xca865ad6e8ab9840ULL, },
+ { 0xe522f524bdcadd1dULL, 0x54ccaffeb00f3b20ULL, },
+ { 0xb926440802182130ULL, 0xbd73c193e32a7f50ULL, },
+ { 0x3c436a516daabc21ULL, 0xad084cd0f46491a4ULL, },
+ { 0x27b3ac0f1c2c2c2eULL, 0x802ef7580d00b12eULL, },
+ { 0xd025c9d65495de4cULL, 0x729f70a02b1b9712ULL, },
+ { 0x50c9eda2c0bb2c73ULL, 0xd4f4d6c4e96eb172ULL, }, /* 72 */
+ { 0x3c392f606f3d9c80ULL, 0xa81a814c020ad0fcULL, },
+ { 0xcf6d16889c4f27f9ULL, 0x644b18717b7cd7e5ULL, },
+ { 0x3673589e07dcc9afULL, 0x451e58c9f775050fULL, },
+ { 0x92a9a9be294e2839ULL, 0xcf64adf1bed9a7efULL, },
+ { 0x3b1bc78561b7da57ULL, 0xc1d52739dcf48dd3ULL, },
+ { 0xa221099bcd447c0dULL, 0xa2a8679158edbafdULL, },
+ { 0xeb8222a8f9295b55ULL, 0xd3326611d982e681ULL, },
+ { 0x9e2ec7142fc38eccULL, 0x252170b1ef468aadULL, }, /* 80 */
+ { 0x5b3cced0addf038eULL, 0x4792d47b141b612dULL, },
+ { 0xad78e4f4df354c2fULL, 0xcd93f2f8260072b6ULL, },
+ { 0x1e3041f03b3c9d99ULL, 0xc8df44c83f16491aULL, },
+ { 0x42003b965b6cf7faULL, 0x5d309124882a7c82ULL, },
+ { 0x82b67598b4cfbfcbULL, 0x920afeb79da82432ULL, },
+ { 0x1a0a2a0ede448d00ULL, 0xb0b8797422bf2d4eULL, },
+ { 0x288031e03ccc097aULL, 0xbee01b9c6a6f85c8ULL, },
+ { 0x72c0106694442af7ULL, 0x50aa560d08f0ea98ULL, }, /* 88 */
+ { 0x710637d8e7d45355ULL, 0xfa50963144a8cb2cULL, },
+ { 0xbf0eecaa3a2faae6ULL, 0x63e63b048e4cebf3ULL, },
+ { 0x16f03414587a870eULL, 0x72f35dbcffa25349ULL, },
+ { 0x860072bc94eeb761ULL, 0xf61ea6c34a7a8fc5ULL, },
+ { 0x0962bb704a1c48aaULL, 0x245c33d36e927f7fULL, },
+ { 0x31e284ea963ac4c2ULL, 0x77782d72d0929bc6ULL, },
+ { 0x8d10d6a4d868ace6ULL, 0x29fba58a7f86a05cULL, },
+ { 0xde98199821f81f82ULL, 0x9afbdf4d3dea12acULL, }, /* 96 */
+ { 0x9378a92e86104a4dULL, 0x2d160528eade271cULL, },
+ { 0x134065aca120761fULL, 0x431f140f3db4433cULL, },
+ { 0x37d8497ac688a50dULL, 0x63391a6dd0b6741cULL, },
+ { 0x0e1578a8502e25b8ULL, 0xa12e387d0e90b4d4ULL, },
+ { 0x2b65b9a082a8483bULL, 0xd8e26e173326bf2cULL, },
+ { 0xa084f7800a3a820bULL, 0xc220c0c740af27aaULL, },
+ { 0x9f5c29002e8ae771ULL, 0xeea4613d7100db80ULL, },
+ { 0x2a8844debf5e9d5eULL, 0x9d46e906bc7b0527ULL, }, /* 104 */
+ { 0x769006829567219dULL, 0xf041a3364eb808ecULL, },
+ { 0xf87860ea545d8208ULL, 0x4ba95712a1ba1c84ULL, },
+ { 0xc9483d8edc44cc9eULL, 0xe5aeac4a2c832ae0ULL, },
+ { 0x37706d823a10b0daULL, 0x079d461a6b55dbf4ULL, },
+ { 0x72109dfa526c8ea6ULL, 0x9f45813ac7e235caULL, },
+ { 0xa8e0f6aa85343e96ULL, 0x37cdf6b28585e2d4ULL, },
+ { 0x37803ef0bffea306ULL, 0x17150f92ff9c2ed8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_w.c
new file mode 100644
index 0000000000..2bea9f669b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPADD_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPADD_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffc0002fffc0002ULL, 0xfffc0002fffc0002ULL, }, /* 0 */
+ { 0xfffc0002fffc0002ULL, 0xfffc0002fffc0002ULL, },
+ { 0x554eaaae554eaaaeULL, 0x554eaaae554eaaaeULL, },
+ { 0xfff80004fff80004ULL, 0xfff80004fff80004ULL, },
+ { 0x998e666c998e666cULL, 0x998e666c998e666cULL, },
+ { 0xfff40006fff40006ULL, 0xfff40006fff40006ULL, },
+ { 0x1c63e39571b88e40ULL, 0xc70e38eb1c63e395ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, }, /* 8 */
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0xfff00008fff00008ULL, 0xfff00008fff00008ULL, },
+ { 0x5542aab45542aab4ULL, 0x5542aab45542aab4ULL, }, /* 16 */
+ { 0x5542aab45542aab4ULL, 0x5542aab45542aab4ULL, },
+ { 0x38cf1c7c38cf1c7cULL, 0x38cf1c7c38cf1c7cULL, },
+ { 0xaa955560aa955560ULL, 0xaa955560aa955560ULL, },
+ { 0xbba44450bba44450ULL, 0xbba44450bba44450ULL, },
+ { 0xffe8000cffe8000cULL, 0xffe8000cffe8000cULL, },
+ { 0xbd87ed16f66b0988ULL, 0x84a425fabd87ed16ULL, },
+ { 0x553aaab8553aaab8ULL, 0x553aaab8553aaab8ULL, },
+ { 0xffe4000effe4000eULL, 0xffe4000effe4000eULL, }, /* 24 */
+ { 0xffe4000effe4000eULL, 0xffe4000effe4000eULL, },
+ { 0x71aa38f271aa38f2ULL, 0x71aa38f271aa38f2ULL, },
+ { 0xaa8d5564aa8d5564ULL, 0xaa8d5564aa8d5564ULL, },
+ { 0x3314ccdc3314ccdcULL, 0x3314ccdc3314ccdcULL, },
+ { 0x5536aaba5536aabaULL, 0x5536aaba5536aabaULL, },
+ { 0xb406a13fd0782f78ULL, 0x9794bdb1b406a13fULL, },
+ { 0xffe00010ffe00010ULL, 0xffe00010ffe00010ULL, },
+ { 0x9976667899766678ULL, 0x9976667899766678ULL, }, /* 32 */
+ { 0x9976667899766678ULL, 0x9976667899766678ULL, },
+ { 0xaa855568aa855568ULL, 0xaa855568aa855568ULL, },
+ { 0x330ccce0330ccce0ULL, 0x330ccce0330ccce0ULL, },
+ { 0x7ab852007ab85200ULL, 0x7ab852007ab85200ULL, },
+ { 0xcca33348cca33348ULL, 0xcca33348cca33348ULL, },
+ { 0xb02fe954f473a510ULL, 0x6beb60ccb02fe954ULL, },
+ { 0x663999b0663999b0ULL, 0x663999b0663999b0ULL, },
+ { 0xcc9f334acc9f334aULL, 0xcc9f334acc9f334aULL, }, /* 40 */
+ { 0xcc9f334acc9f334aULL, 0xcc9f334acc9f334aULL, },
+ { 0x10e2ef0610e2ef06ULL, 0x10e2ef0610e2ef06ULL, },
+ { 0x3304cce43304cce4ULL, 0x3304cce43304cce4ULL, },
+ { 0x84efae2c84efae2cULL, 0x84efae2c84efae2cULL, },
+ { 0x996a667e996a667eULL, 0x996a667e996a667eULL, },
+ { 0xd24d9401e35e82f0ULL, 0xc13c71dfd24d9401ULL, },
+ { 0xffd00018ffd00018ULL, 0xffd00018ffd00018ULL, },
+ { 0x1c3fe3a771948e52ULL, 0xc6ea38fd1c3fe3a7ULL, }, /* 48 */
+ { 0x1c3fe3a771948e52ULL, 0xc6ea38fd1c3fe3a7ULL, },
+ { 0xd9dfd0b1681797ceULL, 0x4ba65eebd9dfd0b1ULL, },
+ { 0x38afc736e3591c8cULL, 0x8e0471e238afc736ULL, },
+ { 0x1c3c7d420b298e54ULL, 0x2d4c9f661c3c7d42ULL, },
+ { 0x551faac5551daac6ULL, 0x551eaac7551faac5ULL, },
+ { 0x2c08e6d26e64f9caULL, 0xb0c4f0502c08e6d2ULL, },
+ { 0x718f8e54c6e23900ULL, 0x1c38e3ac718f8e54ULL, },
+ { 0x551baac75519aac8ULL, 0x551aaac9551baac7ULL, }, /* 56 */
+ { 0x551baac75519aac8ULL, 0x551aaac9551baac7ULL, },
+ { 0xecce6869b3e94bf8ULL, 0x25b12f87ecce6869ULL, },
+ { 0x38a7c73ae3511c90ULL, 0x8dfc71e638a7c73aULL, },
+ { 0xeeb1779655171130ULL, 0x884aaacaeeb17796ULL, },
+ { 0x1c33e3ad71888e58ULL, 0xc6de39031c33e3adULL, },
+ { 0x61ba8b2fca05cd8eULL, 0x32522c5f61ba8b2fULL, },
+ { 0xffc00020ffc00020ULL, 0xffc00020ffc00020ULL, },
+ { 0x1883fe94228255a4ULL, 0x1676ba1575c8cfc9ULL, }, /* 64 */
+ { 0x9f026c24710669eaULL, 0x245b8a02c3f8aadeULL, },
+ { 0x985184e0bcca4328ULL, 0x38ede08c879f0f77ULL, },
+ { 0xe844f0f21702736aULL, 0x68d01ed3cbb87dadULL, },
+ { 0x6ec35e82658687b0ULL, 0x76b4eec019e858c2ULL, },
+ { 0x6651a5cf17c5ba59ULL, 0x00db97b536922653ULL, },
+ { 0x10115a59bc888b36ULL, 0x953fb40350cbb498ULL, },
+ { 0x7e8ac9c2890512c9ULL, 0x03c7477aa84e1b56ULL, },
+ { 0x77d9e27ed4c8ec07ULL, 0x18599e046bf47fefULL, }, /* 72 */
+ { 0x21999708798bbce4ULL, 0xacbdba52862e0e34ULL, },
+ { 0x0cce2f904c6cd245ULL, 0x4da0b293fdff50fdULL, },
+ { 0x67a1e4780c1be5e4ULL, 0xce178c138ffda993ULL, },
+ { 0xb795508a66541626ULL, 0xfdf9ca5ad41717c9ULL, },
+ { 0x260ebff332d09db9ULL, 0x6c815dd12b997e87ULL, },
+ { 0x80e274dbf27fb158ULL, 0xecf83751bd97d71dULL, },
+ { 0xb4190065dd35867dULL, 0x84d1ca72f61ef021ULL, },
+ { 0x146be93b2ce39d07ULL, 0xb4edb1658fe8e617ULL, }, /* 80 */
+ { 0x28da2b76b4930398ULL, 0x43fbb752e67034d3ULL, },
+ { 0x6202107639989575ULL, 0xdd1056c8882a591fULL, },
+ { 0x8e704692d2e83f33ULL, 0x8605bb9831163f53ULL, },
+ { 0x19f6294a0938f7c3ULL, 0xb5d3886b8d6db0c9ULL, },
+ { 0x338d977ccca46e03ULL, 0x26ffd0ded278d778ULL, },
+ { 0xbd9d53669d1f0d1fULL, 0xcf6d52287e678700ULL, },
+ { 0x18106087e287df80ULL, 0x6e5a3285497c7c8eULL, },
+ { 0x7be90cbb50b10f2eULL, 0x91193a91e83049caULL, }, /* 88 */
+ { 0xf5c762fa74f1dd41ULL, 0xc6a6d96a1360b472ULL, },
+ { 0xdec724f4426380a0ULL, 0x8e924c103a77a87aULL, },
+ { 0x43bb09c1cc850053ULL, 0x06479b02f6444a68ULL, },
+ { 0x709d98fbece3b6fdULL, 0x0f02ef4f1e3d11f4ULL, },
+ { 0xdf964592c2f0673eULL, 0xbf06914326915827ULL, },
+ { 0xa595174288afc04eULL, 0x4dac2c104d1f338eULL, },
+ { 0xf0400b1764f99f91ULL, 0x904ab47cadc0214cULL, },
+ { 0x7a4505ebaa0a3823ULL, 0xc2ce09ca715dec1cULL, }, /* 96 */
+ { 0xc0c227c1d78e87b7ULL, 0xfc9e0ad8846cfb1bULL, },
+ { 0x4b501be126c0ecd3ULL, 0x47813bbab4be1843ULL, },
+ { 0x8c94284d7bbb0613ULL, 0x5f37b7ed7918a6b1ULL, },
+ { 0x16e12feca5f2470cULL, 0xecb24110b92e33d5ULL, },
+ { 0x2d734e2e0f77e762ULL, 0x2dc8706ed959cbd3ULL, },
+ { 0x5a430652c80bfcc7ULL, 0x835871922d75cf6eULL, },
+ { 0xb30826c2c930c150ULL, 0xe0148a4e74790481ULL, },
+ { 0x46021066c48e3720ULL, 0x6e76bee0c30066e8ULL, }, /* 104 */
+ { 0x80543cd67141b3f2ULL, 0x14074d905449ba08ULL, },
+ { 0x003ba47a25839f81ULL, 0x536fe6e8a79655ebULL, },
+ { 0x709b823c97a86aeeULL, 0x13e9a6a824155b79ULL, },
+ { 0xad5a661d2dfbd29aULL, 0x780997c18cea8383ULL, },
+ { 0x024c799cf912e891ULL, 0x0bb620125e8129b7ULL, },
+ { 0x0de66afc224e0f31ULL, 0x23590398c1ea5059ULL, },
+ { 0x1d512ac23c5b270dULL, 0x38de17a18940924dULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPADD_U_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_d.c
new file mode 100644
index 0000000000..560e29a248
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPSUB_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPSUB_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, }, /* 0 */
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, },
+ { 0xffffffff55555552ULL, 0xffffffff55555552ULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xffffffff99999994ULL, 0xffffffff99999994ULL, },
+ { 0xfffffffffffffffaULL, 0xfffffffffffffffaULL, },
+ { 0xffffffff71c71c6bULL, 0x000000001c71c715ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, }, /* 8 */
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xffffffff5555554cULL, 0xffffffff5555554cULL, }, /* 16 */
+ { 0xffffffff5555554cULL, 0xffffffff5555554cULL, },
+ { 0xc71c71c58e38e384ULL, 0xc71c71c58e38e384ULL, },
+ { 0xfffffffeaaaaaaa0ULL, 0xfffffffeaaaaaaa0ULL, },
+ { 0xdddddddbbbbbbbb0ULL, 0xdddddddbbbbbbbb0ULL, },
+ { 0xfffffffdfffffff4ULL, 0xfffffffdfffffff4ULL, },
+ { 0xd097b4234bda12eaULL, 0x097b425c684bda06ULL, },
+ { 0xfffffffd55555548ULL, 0xfffffffd55555548ULL, },
+ { 0xfffffffdfffffff2ULL, 0xfffffffdfffffff2ULL, }, /* 24 */
+ { 0xfffffffdfffffff2ULL, 0xfffffffdfffffff2ULL, },
+ { 0x38e38e371c71c70eULL, 0x38e38e371c71c70eULL, },
+ { 0xfffffffeaaaaaa9cULL, 0xfffffffeaaaaaa9cULL, },
+ { 0x2222222133333324ULL, 0x2222222133333324ULL, },
+ { 0xffffffff55555546ULL, 0xffffffff55555546ULL, },
+ { 0x2f684bd97b425ec1ULL, 0xf684bda1097b424fULL, },
+ { 0xfffffffffffffff0ULL, 0xfffffffffffffff0ULL, },
+ { 0xffffffff99999988ULL, 0xffffffff99999988ULL, }, /* 32 */
+ { 0xffffffff99999988ULL, 0xffffffff99999988ULL, },
+ { 0xdddddddcaaaaaa98ULL, 0xdddddddcaaaaaa98ULL, },
+ { 0xffffffff33333320ULL, 0xffffffff33333320ULL, },
+ { 0xeb851eb6e147ae00ULL, 0xeb851eb6e147ae00ULL, },
+ { 0xfffffffeccccccb8ULL, 0xfffffffeccccccb8ULL, },
+ { 0xe38e38e1c16c16acULL, 0x05b05b0449f49f34ULL, },
+ { 0xfffffffe66666650ULL, 0xfffffffe66666650ULL, },
+ { 0xfffffffeccccccb6ULL, 0xfffffffeccccccb6ULL, }, /* 40 */
+ { 0xfffffffeccccccb6ULL, 0xfffffffeccccccb6ULL, },
+ { 0x22222221111110faULL, 0x22222221111110faULL, },
+ { 0xffffffff3333331cULL, 0xffffffff3333331cULL, },
+ { 0x147ae1471eb851d4ULL, 0x147ae1471eb851d4ULL, },
+ { 0xffffffff99999982ULL, 0xffffffff99999982ULL, },
+ { 0x1c71c71c16c16bffULL, 0xfa4fa4fa38e38e21ULL, },
+ { 0xffffffffffffffe8ULL, 0xffffffffffffffe8ULL, },
+ { 0xffffffff71c71c59ULL, 0x000000001c71c703ULL, }, /* 48 */
+ { 0xffffffff71c71c59ULL, 0x000000001c71c703ULL, },
+ { 0xd097b424bda12f4fULL, 0x097b425e84bda115ULL, },
+ { 0xfffffffee38e38caULL, 0x0000000038e38e1eULL, },
+ { 0xe38e38e1d82d82beULL, 0x05b05b05b60b609aULL, },
+ { 0xfffffffe5555553bULL, 0x0000000055555539ULL, },
+ { 0xca4587e4ba78192eULL, 0xf0329162948b0fb0ULL, },
+ { 0xfffffffdc71c71acULL, 0x0000000071c71c54ULL, },
+ { 0xfffffffe55555539ULL, 0x0000000055555537ULL, }, /* 56 */
+ { 0xfffffffe55555539ULL, 0x0000000055555537ULL, },
+ { 0x2f684bd85ed09797ULL, 0xf684bda1425ed079ULL, },
+ { 0xfffffffee38e38c6ULL, 0x0000000038e38e1aULL, },
+ { 0x1c71c71b8888886aULL, 0xfa4fa4fa55555536ULL, },
+ { 0xffffffff71c71c53ULL, 0x000000001c71c6fdULL, },
+ { 0x35ba78187e6b74d1ULL, 0x0fcd6e9df9add3a1ULL, },
+ { 0xffffffffffffffe0ULL, 0xffffffffffffffe0ULL, },
+ { 0xc1c52b51ed993d50ULL, 0xe9c828da514248ccULL, }, /* 64 */
+ { 0xb38b1f29f5c2926cULL, 0xe4522d2260b25370ULL, },
+ { 0x978b1706bdfa46f4ULL, 0xd814f3be50d3cfdeULL, },
+ { 0xbd2549a81e90da18ULL, 0xf92987d1ec89a90eULL, },
+ { 0xaeeb3d8026ba2f34ULL, 0xf3b38c19fbf9b3b2ULL, },
+ { 0x9756e17673d898abULL, 0xf08852c874204cfeULL, },
+ { 0xab37d321be2e30edULL, 0xf49ef75a0c71ea68ULL, },
+ { 0x908aa2c1222edcb6ULL, 0x0445531d0abde6f8ULL, },
+ { 0x748a9a9dea66913eULL, 0xf80819b8fadf6366ULL, }, /* 72 */
+ { 0x886b8c4934bc2980ULL, 0xfc1ebe4a933100d0ULL, },
+ { 0x59d865e79904609cULL, 0xd9ce9972461ac53fULL, },
+ { 0x985e08e42661ba7aULL, 0xced13609df919197ULL, },
+ { 0xbdf83b8586f84d9eULL, 0xefe5ca1d7b476ac7ULL, },
+ { 0xa34b0b24eaf8f967ULL, 0xff8c25e079936757ULL, },
+ { 0xe1d0ae2178565345ULL, 0xf48ec278130a33afULL, },
+ { 0x8de2b645a0f53058ULL, 0xa45a44165015196fULL, },
+ { 0x6792d4f3d7eea55cULL, 0xbfd22ee1a25aa627ULL, }, /* 80 */
+ { 0x75702d5b9af89c83ULL, 0xcc593d1da09f7be9ULL, },
+ { 0x801c3e1c97724195ULL, 0xb4c868d4067dd2d2ULL, },
+ { 0xdeafd0d6f0bea5c3ULL, 0x957877eb733b98b2ULL, },
+ { 0xd1883629f50ec77bULL, 0xb587d85cf1ffef10ULL, },
+ { 0xd4133b37d7cbfcc8ULL, 0xbc35d373b6f24df8ULL, },
+ { 0xbab344ed957a4c42ULL, 0xae8dcb499ce6cd0bULL, },
+ { 0x004c193eb947b2ddULL, 0x68b0a9907b71a293ULL, },
+ { 0x0b979b74995fc935ULL, 0x4a9602f12aa080cfULL, }, /* 88 */
+ { 0x2ae2653846d12eb1ULL, 0x4185939a2d850f91ULL, },
+ { 0x4c5017cc0eed7401ULL, 0x466840b4575dc0d7ULL, },
+ { 0x255760c7e1e38957ULL, 0x8360b1037a4f3497ULL, },
+ { 0x3b88c1c3a41f6803ULL, 0xa8cf0d07b592cd69ULL, },
+ { 0x585dd51272f3e482ULL, 0xb5723c3756218857ULL, },
+ { 0x94c1c43b5f5b538eULL, 0xdd9794c5786cc9c2ULL, },
+ { 0xa0b80278cc3c6a8bULL, 0xf710a53506ea3e4aULL, },
+ { 0x7c607ecd0201d92bULL, 0xf9bcdab0e105825cULL, }, /* 96 */
+ { 0xb628bad7d2470e0fULL, 0xfb660e974362496cULL, },
+ { 0x9ae11df599c281fbULL, 0xfd2738784b8dbfeaULL, },
+ { 0x7bc5bf3b5e23aeffULL, 0xfe707ab5676dfce2ULL, },
+ { 0x614dabb2dc4e0a36ULL, 0xf5f8795b76d8fd08ULL, },
+ { 0x6dbd1a209fc658b0ULL, 0xecd982bc128c8ceaULL, },
+ { 0x8cb93c5d61b1a8d0ULL, 0xecbaa1839f7e477aULL, },
+ { 0x6d33947e52d25a59ULL, 0xf62aab8428f0bf14ULL, },
+ { 0xa7970469e4259b2dULL, 0x0543881aad9efd08ULL, }, /* 104 */
+ { 0x8310e5e55f8149f3ULL, 0xe925758a04d06282ULL, },
+ { 0x746e208dd13c0f61ULL, 0xee4c7bccbccd15e4ULL, },
+ { 0x8da69743b598403fULL, 0xdac93db8514253e0ULL, },
+ { 0xdb31a0aea0a5cde6ULL, 0xe5bd105b853454a0ULL, },
+ { 0x0e6cfc3a89e7bd7cULL, 0xb06ea3bad3a90bd8ULL, },
+ { 0x338cc47438edb042ULL, 0x7df572596f6dffe8ULL, },
+ { 0x07fce3091840a942ULL, 0xdbd5224936527bd0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_h.c
new file mode 100644
index 0000000000..3fb88ab5c2
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPSUB_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPSUB_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, }, /* 0 */
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xff52ff52ff52ff52ULL, 0xff52ff52ff52ff52ULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xff94ff94ff94ff94ULL, 0xff94ff94ff94ff94ULL, },
+ { 0xfffafffafffafffaULL, 0xfffafffafffafffaULL, },
+ { 0xff6b0015ffc0ff6bULL, 0x0015ffc0ff6b0015ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, }, /* 8 */
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xff4cff4cff4cff4cULL, 0xff4cff4cff4cff4cULL, }, /* 16 */
+ { 0xff4cff4cff4cff4cULL, 0xff4cff4cff4cff4cULL, },
+ { 0xc584c584c584c584ULL, 0xc584c584c584c584ULL, },
+ { 0xfea0fea0fea0fea0ULL, 0xfea0fea0fea0fea0ULL, },
+ { 0xdbb0dbb0dbb0dbb0ULL, 0xdbb0dbb0dbb0dbb0ULL, },
+ { 0xfdf4fdf4fdf4fdf4ULL, 0xfdf4fdf4fdf4fdf4ULL, },
+ { 0xcdea0706ea78cdeaULL, 0x0706ea78cdea0706ULL, },
+ { 0xfd48fd48fd48fd48ULL, 0xfd48fd48fd48fd48ULL, },
+ { 0xfdf2fdf2fdf2fdf2ULL, 0xfdf2fdf2fdf2fdf2ULL, }, /* 24 */
+ { 0xfdf2fdf2fdf2fdf2ULL, 0xfdf2fdf2fdf2fdf2ULL, },
+ { 0x370e370e370e370eULL, 0x370e370e370e370eULL, },
+ { 0xfe9cfe9cfe9cfe9cULL, 0xfe9cfe9cfe9cfe9cULL, },
+ { 0x2124212421242124ULL, 0x2124212421242124ULL, },
+ { 0xff46ff46ff46ff46ULL, 0xff46ff46ff46ff46ULL, },
+ { 0x2ec1f64f12882ec1ULL, 0xf64f12882ec1f64fULL, },
+ { 0xfff0fff0fff0fff0ULL, 0xfff0fff0fff0fff0ULL, },
+ { 0xff88ff88ff88ff88ULL, 0xff88ff88ff88ff88ULL, }, /* 32 */
+ { 0xff88ff88ff88ff88ULL, 0xff88ff88ff88ff88ULL, },
+ { 0xdc98dc98dc98dc98ULL, 0xdc98dc98dc98dc98ULL, },
+ { 0xff20ff20ff20ff20ULL, 0xff20ff20ff20ff20ULL, },
+ { 0xea00ea00ea00ea00ULL, 0xea00ea00ea00ea00ULL, },
+ { 0xfeb8feb8feb8feb8ULL, 0xfeb8feb8feb8feb8ULL, },
+ { 0xe1ac0434f2f0e1acULL, 0x0434f2f0e1ac0434ULL, },
+ { 0xfe50fe50fe50fe50ULL, 0xfe50fe50fe50fe50ULL, },
+ { 0xfeb6feb6feb6feb6ULL, 0xfeb6feb6feb6feb6ULL, }, /* 40 */
+ { 0xfeb6feb6feb6feb6ULL, 0xfeb6feb6feb6feb6ULL, },
+ { 0x20fa20fa20fa20faULL, 0x20fa20fa20fa20faULL, },
+ { 0xff1cff1cff1cff1cULL, 0xff1cff1cff1cff1cULL, },
+ { 0x13d413d413d413d4ULL, 0x13d413d413d413d4ULL, },
+ { 0xff82ff82ff82ff82ULL, 0xff82ff82ff82ff82ULL, },
+ { 0x1bfffa210b101bffULL, 0xfa210b101bfffa21ULL, },
+ { 0xffe8ffe8ffe8ffe8ULL, 0xffe8ffe8ffe8ffe8ULL, },
+ { 0xff590003ffaeff59ULL, 0x0003ffaeff590003ULL, }, /* 48 */
+ { 0xff590003ffaeff59ULL, 0x0003ffaeff590003ULL, },
+ { 0xcf4f0915ec32cf4fULL, 0x0915ec32cf4f0915ULL, },
+ { 0xfeca001eff74fecaULL, 0x001eff74feca001eULL, },
+ { 0xe1be059af3ace1beULL, 0x059af3ace1be059aULL, },
+ { 0xfe3b0039ff3afe3bULL, 0x0039ff3afe3b0039ULL, },
+ { 0xc82ef0b0c036c82eULL, 0xf0b0c036c82ef0b0ULL, },
+ { 0xfdac0054ff00fdacULL, 0x0054ff00fdac0054ULL, },
+ { 0xfe390037ff38fe39ULL, 0x0037ff38fe390037ULL, }, /* 56 */
+ { 0xfe390037ff38fe39ULL, 0x0037ff38fe390037ULL, },
+ { 0x2d97f67912082d97ULL, 0xf67912082d97f679ULL, },
+ { 0xfec6001aff70fec6ULL, 0x001aff70fec6001aULL, },
+ { 0x1b6afa360ad01b6aULL, 0xfa360ad01b6afa36ULL, },
+ { 0xff53fffdffa8ff53ULL, 0xfffdffa8ff53fffdULL, },
+ { 0x34d10fa13e7234d1ULL, 0x0fa13e7234d10fa1ULL, },
+ { 0xffe0ffe0ffe0ffe0ULL, 0xffe0ffe0ffe0ffe0ULL, },
+ { 0x9bbcf2acd41cd3a7ULL, 0xc076dce3c4c3e650ULL, }, /* 64 */
+ { 0xb4b806c8f1cee494ULL, 0xbecfd64ea6a80020ULL, },
+ { 0x6814ecfc0fa82b6dULL, 0xc37ad92a91550ac0ULL, },
+ { 0x7bdefedcee3621e3ULL, 0xeb34ed0270f105e0ULL, },
+ { 0x94da12f80be832d0ULL, 0xe98de66d52d61fb0ULL, },
+ { 0x83bdecafc65625dfULL, 0xe7f8d130419c055cULL, },
+ { 0x994d0df1c6d40fd2ULL, 0xe3d2c1a83e00f9d2ULL, },
+ { 0xafdbf02abf6b06b4ULL, 0xeb61a56034e501eeULL, },
+ { 0x6337d65edd454d8dULL, 0xf00ca83c1f920c8eULL, }, /* 72 */
+ { 0x78c7f7a0ddc33780ULL, 0xebe698b41bf60104ULL, },
+ { 0x3d93c078c0b1c207ULL, 0xdfb58b8ff884fa1bULL, },
+ { 0x468de162e424db51ULL, 0xeee27037d08b05f1ULL, },
+ { 0x5a57f342c2b2d1c7ULL, 0x169c840fb0270111ULL, },
+ { 0x70e5d57bbb49c8a9ULL, 0x1e2b67c7a70c092dULL, },
+ { 0x79dff665debce1f3ULL, 0x2d584c6f7f131503ULL, },
+ { 0x307edd58b2d7c6abULL, 0xf8ce0def507eed7fULL, },
+ { 0x12d2ebaaceb9ef2dULL, 0x0f44139e1494e19bULL, }, /* 80 */
+ { 0x07500cecbf88e9fcULL, 0x109a22b12d84e9f5ULL, },
+ { 0xed7c0a0c9689dd79ULL, 0xfe3a2a165149ee24ULL, },
+ { 0xcf880594d43cb481ULL, 0x00ba413659fef988ULL, },
+ { 0xea40f026c424ed7dULL, 0x1ce42a975ba6fcf8ULL, },
+ { 0xfa52e174e584e55aULL, 0x19f040936a55fe20ULL, },
+ { 0xdb86fe7ec64b0603ULL, 0x13a14ea67f40fbeaULL, },
+ { 0x115cd8c4cd3c05cdULL, 0x1699652699e9f314ULL, },
+ { 0xf33cc884be3c10e4ULL, 0x399852dba428ee14ULL, }, /* 88 */
+ { 0x0273f878eba21554ULL, 0x31ee6cb7a1dcf428ULL, },
+ { 0xdaad1e38d3d148edULL, 0x27a784e6885df2c4ULL, },
+ { 0x04ea0acced565727ULL, 0x33f546b6479bdaa0ULL, },
+ { 0x0fe60140cf623084ULL, 0x29715ee078b0d340ULL, },
+ { 0x097de88007d93f14ULL, 0x2a887b768288e2aaULL, },
+ { 0xe07fb5d0025365dfULL, 0x116297ca6cdaedb8ULL, },
+ { 0xc74ecab2f1b47bc3ULL, 0x1ec35e229b5ad07eULL, },
+ { 0x8c4ab55e1124622cULL, 0x2e844d9c6f52bb96ULL, }, /* 96 */
+ { 0x3746c0d800b436a2ULL, 0x52ee6f0548caaafeULL, },
+ { 0x3412b2381dcc3c34ULL, 0x4226686a634c9036ULL, },
+ { 0x44feb5ac2d2c1b48ULL, 0x1f863d063f8e6aaeULL, },
+ { 0x45ced628325f1f0bULL, 0x190e4cdb56714772ULL, },
+ { 0x3a43c6b04bc8259aULL, 0x17ca65193394327cULL, },
+ { 0x4cabe5a01d613107ULL, 0x14467dc849f92468ULL, },
+ { 0x383d0ac03df53bb8ULL, 0x1554a52945b51a80ULL, },
+ { 0x352bf8744cc532afULL, 0x1f4190b4693720beULL, }, /* 104 */
+ { 0x37711cdc568e2109ULL, 0x24b0770882d72146ULL, },
+ { 0x21c319bc5896349eULL, 0x12b492065fe41709ULL, },
+ { 0x42090ae65cb41b62ULL, 0x0416792084231302ULL, },
+ { 0x226211dc497800b0ULL, 0x072cb6d850f915fcULL, },
+ { 0xf5441b3a17b21910ULL, 0x0ce58de86df716f2ULL, },
+ { 0xe51807761e2e171eULL, 0x10b4544095541446ULL, },
+ { 0xe980e35e0a5c10acULL, 0x137085a05b4f30deULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c
new file mode 100644
index 0000000000..b95878b67b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPSUB_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPSUB_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, }, /* 0 */
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xffff5552ffff5552ULL, 0xffff5552ffff5552ULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xffff9994ffff9994ULL, 0xffff9994ffff9994ULL, },
+ { 0xfffffffafffffffaULL, 0xfffffffafffffffaULL, },
+ { 0x00001c6bffff71c0ULL, 0xffffc71500001c6bULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, }, /* 8 */
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xffff554cffff554cULL, 0xffff554cffff554cULL, }, /* 16 */
+ { 0xffff554cffff554cULL, 0xffff554cffff554cULL, },
+ { 0xc71ae384c71ae384ULL, 0xc71ae384c71ae384ULL, },
+ { 0xfffeaaa0fffeaaa0ULL, 0xfffeaaa0fffeaaa0ULL, },
+ { 0xdddbbbb0dddbbbb0ULL, 0xdddbbbb0dddbbbb0ULL, },
+ { 0xfffdfff4fffdfff4ULL, 0xfffdfff4fffdfff4ULL, },
+ { 0x097912ead094f678ULL, 0xed06da06097912eaULL, },
+ { 0xfffd5548fffd5548ULL, 0xfffd5548fffd5548ULL, },
+ { 0xfffdfff2fffdfff2ULL, 0xfffdfff2fffdfff2ULL, }, /* 24 */
+ { 0xfffdfff2fffdfff2ULL, 0xfffdfff2fffdfff2ULL, },
+ { 0x38e1c70e38e1c70eULL, 0x38e1c70e38e1c70eULL, },
+ { 0xfffeaa9cfffeaa9cULL, 0xfffeaa9cfffeaa9cULL, },
+ { 0x2221332422213324ULL, 0x2221332422213324ULL, },
+ { 0xffff5546ffff5546ULL, 0xffff5546ffff5546ULL, },
+ { 0xf6845ec12f67d088ULL, 0x12f6424ff6845ec1ULL, },
+ { 0xfffffff0fffffff0ULL, 0xfffffff0fffffff0ULL, },
+ { 0xffff9988ffff9988ULL, 0xffff9988ffff9988ULL, }, /* 32 */
+ { 0xffff9988ffff9988ULL, 0xffff9988ffff9988ULL, },
+ { 0xdddcaa98dddcaa98ULL, 0xdddcaa98dddcaa98ULL, },
+ { 0xffff3320ffff3320ULL, 0xffff3320ffff3320ULL, },
+ { 0xeb83ae00eb83ae00ULL, 0xeb83ae00eb83ae00ULL, },
+ { 0xfffeccb8fffeccb8ULL, 0xfffeccb8fffeccb8ULL, },
+ { 0x05af16ace38c5af0ULL, 0xf49d9f3405af16acULL, },
+ { 0xfffe6650fffe6650ULL, 0xfffe6650fffe6650ULL, },
+ { 0xfffeccb6fffeccb6ULL, 0xfffeccb6fffeccb6ULL, }, /* 40 */
+ { 0xfffeccb6fffeccb6ULL, 0xfffeccb6fffeccb6ULL, },
+ { 0x222110fa222110faULL, 0x222110fa222110faULL, },
+ { 0xffff331cffff331cULL, 0xffff331cffff331cULL, },
+ { 0x147a51d4147a51d4ULL, 0x147a51d4147a51d4ULL, },
+ { 0xffff9982ffff9982ULL, 0xffff9982ffff9982ULL, },
+ { 0xfa4f6bff1c717d10ULL, 0x0b608e21fa4f6bffULL, },
+ { 0xffffffe8ffffffe8ULL, 0xffffffe8ffffffe8ULL, },
+ { 0x00001c59ffff71aeULL, 0xffffc70300001c59ULL, }, /* 48 */
+ { 0x00001c59ffff71aeULL, 0xffffc70300001c59ULL, },
+ { 0x097b2f4fd0966832ULL, 0xed08a115097b2f4fULL, },
+ { 0x000038cafffee374ULL, 0xffff8e1e000038caULL, },
+ { 0x05b082bee38c71acULL, 0xf49e609a05b082beULL, },
+ { 0x0000553bfffe553aULL, 0xffff55390000553bULL, },
+ { 0xf033192eca430636ULL, 0xc0c90fb0f033192eULL, },
+ { 0x000071acfffdc700ULL, 0xffff1c54000071acULL, },
+ { 0x00005539fffe5538ULL, 0xffff553700005539ULL, }, /* 56 */
+ { 0x00005539fffe5538ULL, 0xffff553700005539ULL, },
+ { 0xf68497972f66b408ULL, 0x12f5d079f6849797ULL, },
+ { 0x000038c6fffee370ULL, 0xffff8e1a000038c6ULL, },
+ { 0xfa4f886a1c70eed0ULL, 0x0b605536fa4f886aULL, },
+ { 0x00001c53ffff71a8ULL, 0xffffc6fd00001c53ULL, },
+ { 0x0fcd74d135ba3272ULL, 0x3f35d3a10fcd74d1ULL, },
+ { 0xffffffe0ffffffe0ULL, 0xffffffe0ffffffe0ULL, },
+ { 0xc5a8016cdd3daa5cULL, 0xe94945ebe7053037ULL, }, /* 64 */
+ { 0xc3b493dce3f99616ULL, 0xe6c275fe01105522ULL, },
+ { 0x949f7b2015d7bcd8ULL, 0xdd8e1f740c23f089ULL, },
+ { 0xcb480f0e10df8c96ULL, 0x0470e12d02738253ULL, },
+ { 0xc954a17e179b7850ULL, 0x01ea11401c7ea73eULL, },
+ { 0xc9425a31f36c45a7ULL, 0xedf7684bffd4d9adULL, },
+ { 0xc7fda5a7eec474caULL, 0xdbac4bfdfada4b68ULL, },
+ { 0xc9d3363ecb9ded37ULL, 0xc40db8860b92e4aaULL, },
+ { 0x9abe1d82fd7c13f9ULL, 0xbad961fc16a68011ULL, }, /* 72 */
+ { 0x997968f8f8d4431cULL, 0xa88e45ae11abf1ccULL, },
+ { 0x644cd070b0912dbbULL, 0x95a94d6df030af03ULL, },
+ { 0x90151b88bce11a1cULL, 0x8ce173edd7b3566dULL, },
+ { 0xc6bdaf76b7e8e9daULL, 0xb3c435a6ce02e837ULL, },
+ { 0xc893400d94c26247ULL, 0x9c25a22fdebb8179ULL, },
+ { 0xf45b8b25a1124ea8ULL, 0x935dc8afc63e28e3ULL, },
+ { 0xc124ff9b7af87983ULL, 0x2916358ea57b0fdfULL, },
+ { 0xa3bdf52f3f1bc6d3ULL, 0x1a9b7790a9e67552ULL, }, /* 80 */
+ { 0xa2394ebc1f432fbaULL, 0x38d091638b040700ULL, },
+ { 0x9c98e9da3d8da28dULL, 0x17578e46633c7554ULL, },
+ { 0xca2304601c11139aULL, 0xecce6f4f9252c75cULL, },
+ { 0xb167fd62111ca498ULL, 0xed848a6b7ffb85a6ULL, },
+ { 0xb01a590af79618c4ULL, 0xcf3de0319d05b479ULL, },
+ { 0xb2490b42008cb27aULL, 0xcfbf82ea8729672eULL, },
+ { 0xd36607e1f75b1a82ULL, 0x8006f7ab6a0e64dcULL, },
+ { 0xbf56e259efe4672cULL, 0xa61769778a2f91d2ULL, }, /* 88 */
+ { 0xbe4f061a0bbba5e0ULL, 0xc922e830b7ade689ULL, },
+ { 0xaac85110e5ef76abULL, 0xcc5f9db0a366adc6ULL, },
+ { 0xc91b5b88fd4a93d2ULL, 0x879c58c17a96cfbaULL, },
+ { 0xb8799dfa21be5efeULL, 0xa721331f6c3d78f0ULL, },
+ { 0xb76ef97e2ca86ef4ULL, 0xbb78ca223c0de8adULL, },
+ { 0x9da743266b64f51cULL, 0xba24b1045354f4faULL, },
+ { 0xc2f3162f429e4870ULL, 0x764125c06e4d3512ULL, },
+ { 0xa89d5e1d1ffccbf4ULL, 0x51bf6a197f87f33bULL, }, /* 96 */
+ { 0x890f17ff2c462c7cULL, 0x34f589127c4cc49aULL, },
+ { 0x53dc26951679feb0ULL, 0x2aa458e36a7c8cdeULL, },
+ { 0x7ed4f0c1135e605eULL, 0x1a22c08d472920e2ULL, },
+ { 0x80f6d8c622f1e674ULL, 0x071f986d36987e53ULL, },
+ { 0x7ee91ba012abf971ULL, 0xeab87172091da737ULL, },
+ { 0x80fac8d20b8e2fb8ULL, 0x0ad43e562523cff0ULL, },
+ { 0x7ef3481012ac516eULL, 0x1acdbd0e31a33d13ULL, },
+ { 0xbf53a8023cd97b5aULL, 0x07b9c024393d8136ULL, }, /* 104 */
+ { 0x8e3cb38085aaebe3ULL, 0xf84dd1305e923ebfULL, },
+ { 0x50c22f685af8caedULL, 0xef14166874d2544dULL, },
+ { 0x7a3548245bc2dee5ULL, 0xf6b38ff08f52b803ULL, },
+ { 0x3e4f96f53628fefdULL, 0xbe65c7ed60e1faffULL, },
+ { 0x2c2056e3221de63fULL, 0x871151e081227a9dULL, },
+ { 0x113314bc1293f380ULL, 0x774bb8df643781b9ULL, },
+ { 0x07d911730a4b3a5dULL, 0x8b56a81c77aef6ebULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_S_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_d.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_d.c
new file mode 100644
index 0000000000..fc6c4e61dc
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPSUB_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPSUB_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x00000003fffffffeULL, 0x00000003fffffffeULL, }, /* 0 */
+ { 0x00000003fffffffeULL, 0x00000003fffffffeULL, },
+ { 0xaaaaaab155555552ULL, 0xaaaaaab155555552ULL, },
+ { 0x00000007fffffffcULL, 0x00000007fffffffcULL, },
+ { 0x6666667199999994ULL, 0x6666667199999994ULL, },
+ { 0x0000000bfffffffaULL, 0x0000000bfffffffaULL, },
+ { 0x8e38e39c71c71c6bULL, 0xe38e38f21c71c715ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, }, /* 8 */
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0x0000000ffffffff8ULL, 0x0000000ffffffff8ULL, },
+ { 0xaaaaaabd5555554cULL, 0xaaaaaabd5555554cULL, }, /* 16 */
+ { 0xaaaaaabd5555554cULL, 0xaaaaaabd5555554cULL, },
+ { 0xc71c71db8e38e384ULL, 0xc71c71db8e38e384ULL, },
+ { 0x5555556aaaaaaaa0ULL, 0x5555556aaaaaaaa0ULL, },
+ { 0x4444445bbbbbbbb0ULL, 0x4444445bbbbbbbb0ULL, },
+ { 0x00000017fffffff4ULL, 0x00000017fffffff4ULL, },
+ { 0x097b42784bda12eaULL, 0x425ed0b1684bda06ULL, },
+ { 0xaaaaaac555555548ULL, 0xaaaaaac555555548ULL, },
+ { 0x0000001bfffffff2ULL, 0x0000001bfffffff2ULL, }, /* 24 */
+ { 0x0000001bfffffff2ULL, 0x0000001bfffffff2ULL, },
+ { 0x8e38e3ab1c71c70eULL, 0x8e38e3ab1c71c70eULL, },
+ { 0x55555572aaaaaa9cULL, 0x55555572aaaaaa9cULL, },
+ { 0xcccccceb33333324ULL, 0xcccccceb33333324ULL, },
+ { 0xaaaaaac955555546ULL, 0xaaaaaac955555546ULL, },
+ { 0x2f684bf97b425ec1ULL, 0x4bda1316097b424fULL, },
+ { 0x0000001ffffffff0ULL, 0x0000001ffffffff0ULL, },
+ { 0x6666668999999988ULL, 0x6666668999999988ULL, }, /* 32 */
+ { 0x6666668999999988ULL, 0x6666668999999988ULL, },
+ { 0x5555557aaaaaaa98ULL, 0x5555557aaaaaaa98ULL, },
+ { 0xccccccf333333320ULL, 0xccccccf333333320ULL, },
+ { 0x851eb87ae147ae00ULL, 0x851eb87ae147ae00ULL, },
+ { 0x3333335cccccccb8ULL, 0x3333335cccccccb8ULL, },
+ { 0x0b60b636c16c16acULL, 0x4fa4fa7b49f49f34ULL, },
+ { 0x999999c666666650ULL, 0x999999c666666650ULL, },
+ { 0x33333360ccccccb6ULL, 0x33333360ccccccb6ULL, }, /* 40 */
+ { 0x33333360ccccccb6ULL, 0x33333360ccccccb6ULL, },
+ { 0xeeeeef1d111110faULL, 0xeeeeef1d111110faULL, },
+ { 0xccccccfb3333331cULL, 0xccccccfb3333331cULL, },
+ { 0x7ae147dd1eb851d4ULL, 0x7ae147dd1eb851d4ULL, },
+ { 0x6666669599999982ULL, 0x6666669599999982ULL, },
+ { 0x1c71c74c16c16bffULL, 0x2d82d85d38e38e21ULL, },
+ { 0x0000002fffffffe8ULL, 0x0000002fffffffe8ULL, },
+ { 0x8e38e3c071c71c59ULL, 0xe38e39161c71c703ULL, }, /* 48 */
+ { 0x8e38e3c071c71c59ULL, 0xe38e39161c71c703ULL, },
+ { 0x97b42620bda12f4fULL, 0x25ed09af84bda115ULL, },
+ { 0x1c71c750e38e38caULL, 0xc71c71fc38e38e1eULL, },
+ { 0xf49f4a2ad82d82beULL, 0xe38e391ab60b609aULL, },
+ { 0xaaaaaae15555553bULL, 0xaaaaaae255555539ULL, },
+ { 0x9161f9e5ba78192eULL, 0xd3c0ca7e948b0fb0ULL, },
+ { 0x38e38e71c71c71acULL, 0x8e38e3c871c71c54ULL, },
+ { 0xaaaaaae555555539ULL, 0xaaaaaae655555537ULL, }, /* 56 */
+ { 0xaaaaaae555555539ULL, 0xaaaaaae655555537ULL, },
+ { 0x4bda13325ed09797ULL, 0x12f684fa425ed079ULL, },
+ { 0x1c71c758e38e38c6ULL, 0xc71c720438e38e1aULL, },
+ { 0xaaaaaae88888886aULL, 0x1111114f55555536ULL, },
+ { 0x8e38e3cc71c71c53ULL, 0xe38e39221c71c6fdULL, },
+ { 0x35ba78587e6b74d1ULL, 0x9e06526bf9add3a1ULL, },
+ { 0x0000003fffffffe0ULL, 0x0000003fffffffe0ULL, },
+ { 0xb0ef5df9ed993d50ULL, 0xecd0c902514248ccULL, }, /* 64 */
+ { 0x1e8c6aa2f5c2926cULL, 0xd21b7a4e60b25370ULL, },
+ { 0xa56477c9bdfa46f4ULL, 0x1c376bca50d3cfdeULL, },
+ { 0x5aaf941e1e90da18ULL, 0x4a2661d3ec89a90eULL, },
+ { 0xc84ca0c726ba2f34ULL, 0x2f71131ffbf9b3b2ULL, },
+ { 0xb93c43f773d898abULL, 0x2c45d9ce74204cfeULL, },
+ { 0xd770bf8dbe2e30edULL, 0x1b1d2b640c71ea68ULL, },
+ { 0x4c7478e0222edcb6ULL, 0x028c79110abde6f8ULL, },
+ { 0xd34c8606ea66913eULL, 0x4ca86a8cfadf6366ULL, }, /* 72 */
+ { 0xf181019d34bc2980ULL, 0x3b7fbc22933100d0ULL, },
+ { 0xf69966e79904609cULL, 0xc2d94d22461ac53fULL, },
+ { 0x669e11492661ba7aULL, 0x3b951b06df919197ULL, },
+ { 0x1be92d9d86f84d9eULL, 0x698411107b476ac7ULL, },
+ { 0x90ece6efeaf8f967ULL, 0x50f35ebd79936757ULL, },
+ { 0x00f1915178565345ULL, 0xc9af2ca2130a33afULL, },
+ { 0xad039975a0f53058ULL, 0x0b11d7505015196fULL, },
+ { 0x376d4d72ebbc7b1cULL, 0xb833881ecd4918dbULL, }, /* 80 */
+ { 0xb97c39c63d30eb26ULL, 0x9983e1a16fddbe3bULL, },
+ { 0x103118e687f4c4aaULL, 0x36d2d322776b1540ULL, },
+ { 0xd7103f328f5683b0ULL, 0xc97816b7d22d1890ULL, },
+ { 0x4dd93b94622edfd8ULL, 0xbd32853a6649bd9eULL, },
+ { 0xe38ab03df0d4eedcULL, 0xa6b087fab9ab9432ULL, },
+ { 0x9b8bc7cd79738e5aULL, 0x1099960abd7ff844ULL, },
+ { 0x2a9e79f404df0445ULL, 0x8a1a574d141add54ULL, },
+ { 0x1323c575df66a395ULL, 0x4d70aaa974eb601eULL, }, /* 88 */
+ { 0xbc9ea974b0ce57aeULL, 0x3dff93a625e35e6cULL, },
+ { 0xbd4cca940103a7a6ULL, 0x1b03e192077feba2ULL, },
+ { 0x69e12c9b9ff2608eULL, 0x0713d9101835bf32ULL, },
+ { 0x183a0715853e498aULL, 0xeced28ff102b04faULL, },
+ { 0xd806808efcdcfa1bULL, 0xda07aee4d9a29bfcULL, },
+ { 0x8f0ceb4c5a20614fULL, 0x2693974265c37330ULL, },
+ { 0x2f219f4eacacaf61ULL, 0xcde749de29866580ULL, },
+ { 0xfac6c540b5ec9bf9ULL, 0x67fa3d30bf85f9fcULL, }, /* 96 */
+ { 0x58719a8af58d41b9ULL, 0x8af69bdae8797a8cULL, },
+ { 0x0293ed8dc2154481ULL, 0x7aef92fa834de3f0ULL, },
+ { 0xe296644d91f354e5ULL, 0xd4332e315ac37ee4ULL, },
+ { 0xd78a5344aa8ce0f6ULL, 0xbcf1bf88825a127aULL, },
+ { 0xcfe6e77bd50e6bfaULL, 0xa42046c9a6110292ULL, },
+ { 0xc2e4e16ef7883199ULL, 0x8a2eb57c71a6b370ULL, },
+ { 0xb83af7ab54b68847ULL, 0x7682eb14d9902e98ULL, },
+ { 0xfeb58099fb6e2639ULL, 0xd298a4d4f4eef1ccULL, }, /* 104 */
+ { 0x9cbae3e8d8c9b31fULL, 0x0e0c2c1a33a56ab0ULL, },
+ { 0x95dc4a7a980a468fULL, 0xe95439aa32919b0aULL, },
+ { 0xc29c82993429f90bULL, 0xa33308195e2c1fecULL, },
+ { 0x5a0a569e52e5f3acULL, 0x0a72368b53acb754ULL, },
+ { 0x140968eb707c3bbeULL, 0xcd5491c571071d8cULL, },
+ { 0xe1db913744288b2bULL, 0x10c008b6922667d4ULL, },
+ { 0x65b190239a38c686ULL, 0xa6d4ec5b01d651c4ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c
new file mode 100644
index 0000000000..741c887bbd
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPSUB_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPSUB_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x03fe03fe03fe03feULL, 0x03fe03fe03fe03feULL, }, /* 0 */
+ { 0x03fe03fe03fe03feULL, 0x03fe03fe03fe03feULL, },
+ { 0xb152b152b152b152ULL, 0xb152b152b152b152ULL, },
+ { 0x07fc07fc07fc07fcULL, 0x07fc07fc07fc07fcULL, },
+ { 0x7194719471947194ULL, 0x7194719471947194ULL, },
+ { 0x0bfa0bfa0bfa0bfaULL, 0x0bfa0bfa0bfa0bfaULL, },
+ { 0x9c6bf21546c09c6bULL, 0xf21546c09c6bf215ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, }, /* 8 */
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0x0ff80ff80ff80ff8ULL, 0x0ff80ff80ff80ff8ULL, },
+ { 0xbd4cbd4cbd4cbd4cULL, 0xbd4cbd4cbd4cbd4cULL, }, /* 16 */
+ { 0xbd4cbd4cbd4cbd4cULL, 0xbd4cbd4cbd4cbd4cULL, },
+ { 0xdb84db84db84db84ULL, 0xdb84db84db84db84ULL, },
+ { 0x6aa06aa06aa06aa0ULL, 0x6aa06aa06aa06aa0ULL, },
+ { 0x5bb05bb05bb05bb0ULL, 0x5bb05bb05bb05bb0ULL, },
+ { 0x17f417f417f417f4ULL, 0x17f417f417f417f4ULL, },
+ { 0x22ea5c06947822eaULL, 0x5c06947822ea5c06ULL, },
+ { 0xc548c548c548c548ULL, 0xc548c548c548c548ULL, },
+ { 0x1bf21bf21bf21bf2ULL, 0x1bf21bf21bf21bf2ULL, }, /* 24 */
+ { 0x1bf21bf21bf21bf2ULL, 0x1bf21bf21bf21bf2ULL, },
+ { 0xab0eab0eab0eab0eULL, 0xab0eab0eab0eab0eULL, },
+ { 0x729c729c729c729cULL, 0x729c729c729c729cULL, },
+ { 0xeb24eb24eb24eb24ULL, 0xeb24eb24eb24eb24ULL, },
+ { 0xc946c946c946c946ULL, 0xc946c946c946c946ULL, },
+ { 0x4ec16b4f87884ec1ULL, 0x6b4f87884ec16b4fULL, },
+ { 0x1ff01ff01ff01ff0ULL, 0x1ff01ff01ff01ff0ULL, },
+ { 0x8988898889888988ULL, 0x8988898889888988ULL, }, /* 32 */
+ { 0x8988898889888988ULL, 0x8988898889888988ULL, },
+ { 0x7a987a987a987a98ULL, 0x7a987a987a987a98ULL, },
+ { 0xf320f320f320f320ULL, 0xf320f320f320f320ULL, },
+ { 0xae00ae00ae00ae00ULL, 0xae00ae00ae00ae00ULL, },
+ { 0x5cb85cb85cb85cb8ULL, 0x5cb85cb85cb85cb8ULL, },
+ { 0x36ac7b34bef036acULL, 0x7b34bef036ac7b34ULL, },
+ { 0xc650c650c650c650ULL, 0xc650c650c650c650ULL, },
+ { 0x60b660b660b660b6ULL, 0x60b660b660b660b6ULL, }, /* 40 */
+ { 0x60b660b660b660b6ULL, 0x60b660b660b660b6ULL, },
+ { 0x1cfa1cfa1cfa1cfaULL, 0x1cfa1cfa1cfa1cfaULL, },
+ { 0xfb1cfb1cfb1cfb1cULL, 0xfb1cfb1cfb1cfb1cULL, },
+ { 0xa9d4a9d4a9d4a9d4ULL, 0xa9d4a9d4a9d4a9d4ULL, },
+ { 0x9582958295829582ULL, 0x9582958295829582ULL, },
+ { 0x4bff5d216e104bffULL, 0x5d216e104bff5d21ULL, },
+ { 0x2fe82fe82fe82fe8ULL, 0x2fe82fe82fe82fe8ULL, },
+ { 0xc05916036aaec059ULL, 0x16036aaec0591603ULL, }, /* 48 */
+ { 0xc05916036aaec059ULL, 0x16036aaec0591603ULL, },
+ { 0xcb4f5a15e732cb4fULL, 0x5a15e732cb4f5a15ULL, },
+ { 0x50cafc1ea57450caULL, 0xfc1ea57450cafc1eULL, },
+ { 0x2abe1a9a07ac2abeULL, 0x1a9a07ac2abe1a9aULL, },
+ { 0xe13be239e03ae13bULL, 0xe239e03ae13be239ULL, },
+ { 0xc92e0cb08536c92eULL, 0x0cb08536c92e0cb0ULL, },
+ { 0x71acc8541b0071acULL, 0xc8541b0071acc854ULL, },
+ { 0xe539e637e438e539ULL, 0xe637e438e539e637ULL, }, /* 56 */
+ { 0xe539e637e438e539ULL, 0xe637e438e539e637ULL, },
+ { 0x87974f7915088797ULL, 0x4f79150887974f79ULL, },
+ { 0x58c6041aad7058c6ULL, 0x041aad7058c6041aULL, },
+ { 0xe86a4f36b4d0e86aULL, 0x4f36b4d0e86a4f36ULL, },
+ { 0xcc5321fd76a8cc53ULL, 0x21fd76a8cc5321fdULL, },
+ { 0x74d1dda10c7274d1ULL, 0xdda10c7274d1dda1ULL, },
+ { 0x3fe03fe03fe03fe0ULL, 0x3fe03fe03fe03fe0ULL, },
+ { 0xcbbcceac141c13a7ULL, 0x00761ce308c3c650ULL, }, /* 64 */
+ { 0xf7b87fc8cfcecf94ULL, 0x97cf0b4ed5a88220ULL, },
+ { 0x77145bfc63a8816dULL, 0x357aa52a175567c0ULL, },
+ { 0x1ade0adc423622e3ULL, 0xab3450024ff1c4e0ULL, },
+ { 0x46dabbf8fde8ded0ULL, 0x428d3e6d1cd680b0ULL, },
+ { 0xc3bd95af925643dfULL, 0x52f8b3300b9c6e5cULL, },
+ { 0xd84d53f1e3d4d3d2ULL, 0x7fd208a8f3004ed2ULL, },
+ { 0x2fdb362aab6b21b4ULL, 0x8d618f60d4e568eeULL, },
+ { 0xaf37125e3f45d38dULL, 0x2b0c293c16924e8eULL, }, /* 72 */
+ { 0xc3c7d0a090c36380ULL, 0x57e67eb4fdf62f04ULL, },
+ { 0x3093e97863b1d807ULL, 0x9bb5e78f8484281bULL, },
+ { 0xc98da762f8243651ULL, 0xbae2a737088bfaf1ULL, },
+ { 0x6d575642d6b2d7c7ULL, 0x309c520f41275811ULL, },
+ { 0xc4e5387b9e4925a9ULL, 0x3e2bd8c7230c722dULL, },
+ { 0x5ddff66532bc83f3ULL, 0x5d58986fa7134503ULL, },
+ { 0x147edd5806d7a4abULL, 0x2cce99ef267e197fULL, },
+ { 0xd5b2d0aab3994377ULL, 0xcd083b9ac440025bULL, }, /* 80 */
+ { 0x80bf8eec25e70baaULL, 0xb6e600dda46ca823ULL, },
+ { 0xe79991b05061b0b1ULL, 0xd91c24ba24bc8d1fULL, },
+ { 0x5352504a2070df63ULL, 0x473b74aadc80fd45ULL, },
+ { 0x0546cd72f0907c98ULL, 0x1ab13142c4b84c19ULL, },
+ { 0xcc6ba15c55b01774ULL, 0x6e1606c3875c1b25ULL, },
+ { 0x1dbdf6d689f3d0f7ULL, 0x4ac43fe21dbb145aULL, },
+ { 0xd6baa1542922ce15ULL, 0x697e5fbada60ca72ULL, },
+ { 0x1806cdbe15b6846fULL, 0x18091759d3f43a3aULL, }, /* 88 */
+ { 0xfc0a8444a6e31a5bULL, 0x0daafd828699ee8eULL, },
+ { 0x4f36fd647760debdULL, 0x7c3fb8561364c110ULL, },
+ { 0x1bfcc992394ee12bULL, 0xfca40e06ed110caeULL, },
+ { 0xa54ca0a4128a8bb6ULL, 0x70d40b38f9c0fc46ULL, },
+ { 0xcb1d6138bde219f9ULL, 0x9c68fd7fb61366a6ULL, },
+ { 0x3887fa1a7e8f8fe6ULL, 0x2ce4bb5039504af0ULL, },
+ { 0xf65edccc34eccb94ULL, 0x3e041478ff0f739cULL, },
+ { 0x4cc27494d274632dULL, 0x2a3ee78cfad81d3cULL, }, /* 96 */
+ { 0xd40e966c853c370eULL, 0x04feaa379b04067cULL, },
+ { 0x5da2b998597c214bULL, 0x9da08eb7ff4efc8cULL, },
+ { 0xe9269a421c1c0396ULL, 0x2f41456bdcd248bcULL, },
+ { 0xe87f80bc039cfc91ULL, 0xed3c08269718789cULL, },
+ { 0xa6c53808a9213425ULL, 0xa2aefe7284cdb89cULL, },
+ { 0x71cd34f063590a91ULL, 0xef6839544786e41cULL, },
+ { 0x6adcd8201277fe43ULL, 0x7a42072920b97f84ULL, },
+ { 0xd64c3010a53c52d9ULL, 0x2ffcd8e8ec4662d9ULL, }, /* 104 */
+ { 0x2bcc04d0fd7bb9d3ULL, 0x54334ac042e043bbULL, },
+ { 0xc73077f8e331ebe0ULL, 0x1c5f5244f12a2b70ULL, },
+ { 0x309c82661787fc47ULL, 0xc7f3cf1c49211c79ULL, },
+ { 0xeb78588cf53e082dULL, 0x75954984106eb821ULL, },
+ { 0x5fa026e08f6af367ULL, 0xa8dfb35ce9820111ULL, },
+ { 0x04b0e03c469efd7fULL, 0x7a6806a42e2df58fULL, },
+ { 0xcca0baf00eacf773ULL, 0xd54e79140435c3e5ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_w.c b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_w.c
new file mode 100644
index 0000000000..3e1b711b61
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction DPSUB_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Dot Product";
+ char *instruction_name = "DPSUB_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0003fffe0003fffeULL, 0x0003fffe0003fffeULL, }, /* 0 */
+ { 0x0003fffe0003fffeULL, 0x0003fffe0003fffeULL, },
+ { 0xaab15552aab15552ULL, 0xaab15552aab15552ULL, },
+ { 0x0007fffc0007fffcULL, 0x0007fffc0007fffcULL, },
+ { 0x6671999466719994ULL, 0x6671999466719994ULL, },
+ { 0x000bfffa000bfffaULL, 0x000bfffa000bfffaULL, },
+ { 0xe39c1c6b8e4771c0ULL, 0x38f1c715e39c1c6bULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, }, /* 8 */
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0x000ffff8000ffff8ULL, 0x000ffff8000ffff8ULL, },
+ { 0xaabd554caabd554cULL, 0xaabd554caabd554cULL, }, /* 16 */
+ { 0xaabd554caabd554cULL, 0xaabd554caabd554cULL, },
+ { 0xc730e384c730e384ULL, 0xc730e384c730e384ULL, },
+ { 0x556aaaa0556aaaa0ULL, 0x556aaaa0556aaaa0ULL, },
+ { 0x445bbbb0445bbbb0ULL, 0x445bbbb0445bbbb0ULL, },
+ { 0x0017fff40017fff4ULL, 0x0017fff40017fff4ULL, },
+ { 0x427812ea0994f678ULL, 0x7b5bda06427812eaULL, },
+ { 0xaac55548aac55548ULL, 0xaac55548aac55548ULL, },
+ { 0x001bfff2001bfff2ULL, 0x001bfff2001bfff2ULL, }, /* 24 */
+ { 0x001bfff2001bfff2ULL, 0x001bfff2001bfff2ULL, },
+ { 0x8e55c70e8e55c70eULL, 0x8e55c70e8e55c70eULL, },
+ { 0x5572aa9c5572aa9cULL, 0x5572aa9c5572aa9cULL, },
+ { 0xcceb3324cceb3324ULL, 0xcceb3324cceb3324ULL, },
+ { 0xaac95546aac95546ULL, 0xaac95546aac95546ULL, },
+ { 0x4bf95ec12f87d088ULL, 0x686b424f4bf95ec1ULL, },
+ { 0x001ffff0001ffff0ULL, 0x001ffff0001ffff0ULL, },
+ { 0x6689998866899988ULL, 0x6689998866899988ULL, }, /* 32 */
+ { 0x6689998866899988ULL, 0x6689998866899988ULL, },
+ { 0x557aaa98557aaa98ULL, 0x557aaa98557aaa98ULL, },
+ { 0xccf33320ccf33320ULL, 0xccf33320ccf33320ULL, },
+ { 0x8547ae008547ae00ULL, 0x8547ae008547ae00ULL, },
+ { 0x335cccb8335cccb8ULL, 0x335cccb8335cccb8ULL, },
+ { 0x4fd016ac0b8c5af0ULL, 0x94149f344fd016acULL, },
+ { 0x99c6665099c66650ULL, 0x99c6665099c66650ULL, },
+ { 0x3360ccb63360ccb6ULL, 0x3360ccb63360ccb6ULL, }, /* 40 */
+ { 0x3360ccb63360ccb6ULL, 0x3360ccb63360ccb6ULL, },
+ { 0xef1d10faef1d10faULL, 0xef1d10faef1d10faULL, },
+ { 0xccfb331cccfb331cULL, 0xccfb331cccfb331cULL, },
+ { 0x7b1051d47b1051d4ULL, 0x7b1051d47b1051d4ULL, },
+ { 0x6695998266959982ULL, 0x6695998266959982ULL, },
+ { 0x2db26bff1ca17d10ULL, 0x3ec38e212db26bffULL, },
+ { 0x002fffe8002fffe8ULL, 0x002fffe8002fffe8ULL, },
+ { 0xe3c01c598e6b71aeULL, 0x3915c703e3c01c59ULL, }, /* 48 */
+ { 0xe3c01c598e6b71aeULL, 0x3915c703e3c01c59ULL, },
+ { 0x26202f4f97e86832ULL, 0xb459a11526202f4fULL, },
+ { 0xc75038ca1ca6e374ULL, 0x71fb8e1ec75038caULL, },
+ { 0xe3c382bef4d671acULL, 0xd2b3609ae3c382beULL, },
+ { 0xaae0553baae2553aULL, 0xaae15539aae0553bULL, },
+ { 0xd3f7192e919b0636ULL, 0x4f3b0fb0d3f7192eULL, },
+ { 0x8e7071ac391dc700ULL, 0xe3c71c548e7071acULL, },
+ { 0xaae45539aae65538ULL, 0xaae55537aae45539ULL, }, /* 56 */
+ { 0xaae45539aae65538ULL, 0xaae55537aae45539ULL, },
+ { 0x133197974c16b408ULL, 0xda4ed07913319797ULL, },
+ { 0xc75838c61caee370ULL, 0x72038e1ac75838c6ULL, },
+ { 0x114e886aaae8eed0ULL, 0x77b55536114e886aULL, },
+ { 0xe3cc1c538e7771a8ULL, 0x3921c6fde3cc1c53ULL, },
+ { 0x9e4574d135fa3272ULL, 0xcdadd3a19e4574d1ULL, },
+ { 0x003fffe0003fffe0ULL, 0x003fffe0003fffe0ULL, },
+ { 0xe77c016cdd7daa5cULL, 0xe98945eb8a373037ULL, }, /* 64 */
+ { 0x60fd93dc8ef99616ULL, 0xdba475fe3c075522ULL, },
+ { 0x67ae7b204335bcd8ULL, 0xc7121f747860f089ULL, },
+ { 0x17bb0f0ee8fd8c96ULL, 0x972fe12d34478253ULL, },
+ { 0x913ca17e9a797850ULL, 0x894b1140e617a73eULL, },
+ { 0x99ae5a31e83a45a7ULL, 0xff24684bc96dd9adULL, },
+ { 0xefeea5a7437774caULL, 0x6ac04bfdaf344b68ULL, },
+ { 0x8175363e76faed37ULL, 0xfc38b88657b1e4aaULL, },
+ { 0x88261d822b3713f9ULL, 0xe7a661fc940b8011ULL, }, /* 72 */
+ { 0xde6668f88674431cULL, 0x534245ae79d1f1ccULL, },
+ { 0xf331d070b3932dbbULL, 0xb25f4d6d0200af03ULL, },
+ { 0x985e1b88f3e41a1cULL, 0x31e873ed7002566dULL, },
+ { 0x486aaf7699abe9daULL, 0x020635a62be8e837ULL, },
+ { 0xd9f1400dcd2f6247ULL, 0x937ea22fd4668179ULL, },
+ { 0x7f1d8b250d804ea8ULL, 0x1307c8af426828e3ULL, },
+ { 0x4be6ff9b22ca7983ULL, 0x7b2e358e09e10fdfULL, },
+ { 0x3d0470dbf4d6b86fULL, 0x548567e8f5250450ULL, }, /* 80 */
+ { 0x00d897321b41b715ULL, 0x02517c05df66c875ULL, },
+ { 0x991ec80ea3b5c306ULL, 0xa18dc9b22cff8e2fULL, },
+ { 0x44850796bb133f8dULL, 0xdc2a4cc591614211ULL, },
+ { 0x192b30fc8866f607ULL, 0x97e8c289d36e61aaULL, },
+ { 0x0058689e9fcad43dULL, 0xfe7a0cc7a239bc40ULL, },
+ { 0xb8bc4cc2b8296867ULL, 0xccf01b9e1a7e74adULL, },
+ { 0x61014864181c5d2cULL, 0x4c8bc05ea1b0cc11ULL, },
+ { 0xec0d0e4af547db74ULL, 0x2d758eed74a13bb5ULL, }, /* 88 */
+ { 0x03e797060056a10fULL, 0xc1a1d5f8579892eaULL, },
+ { 0x9a3ca5d4a8548905ULL, 0xfd2bfd1807c0081aULL, },
+ { 0x4820b48cf1454f6bULL, 0xe982ac5dfb74445aULL, },
+ { 0x7eec2fbcb0c3c941ULL, 0x9d1459e9d27d4766ULL, },
+ { 0x020a22e0debbd140ULL, 0x4fbb0ef3a9e0453bULL, },
+ { 0xe8df4a9ccb0c350bULL, 0x37b3761e2e442cffULL, },
+ { 0x7c3604df51731065ULL, 0xd9add64be7d81e17ULL, },
+ { 0x35a1aacf3f24481fULL, 0x900caa26ecaf303bULL, }, /* 96 */
+ { 0x7f0fd7311d2a2997ULL, 0x5e11155ee03d0362ULL, },
+ { 0x7959c1ef0ab6e6c3ULL, 0x41695f03ff01377bULL, },
+ { 0x89d8f6a1bc2ded57ULL, 0x29ed46aadb5c8a3cULL, },
+ { 0x01ec800ecaa24ac8ULL, 0xf32ccdbb9c58b788ULL, },
+ { 0xffd7297c53176782ULL, 0x4acc984953e0cc00ULL, },
+ { 0x04316ff6e9707c3dULL, 0xd5f54b0b0ac9f7e0ULL, },
+ { 0xffe6fc76421c7405ULL, 0x8f42f98ab98b12e9ULL, },
+ { 0xa75ea33ed2e809e1ULL, 0xb6fdbf643abee85cULL, }, /* 104 */
+ { 0xc75019063471bcc9ULL, 0x05bcd250f1d0ad42ULL, },
+ { 0x300d94eaa78224eaULL, 0x615cfa00370a0c2aULL, },
+ { 0xaa1a04f419d03dccULL, 0x8fe0ca60107a1a34ULL, },
+ { 0x5f0bb18ad9b000d4ULL, 0xd3ed3780ee630840ULL, },
+ { 0x25e24aa388dc4d8cULL, 0x40c1586349788fbaULL, },
+ { 0x0ec344de11f41ac8ULL, 0xed9aea2a99a95e8aULL, },
+ { 0x02499bebf3ac5a24ULL, 0xecb186c0e06045b8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_DPSUB_U_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c
new file mode 100644
index 0000000000..7e984a786e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_A.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_A.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa8eaaaa8eaaaa8eULL, 0xaaaa8eaaaa8eaaaaULL, },
+ { 0xaa71aaaa71aaaa71ULL, 0xaaaa71aaaa71aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x558e55558e55558eULL, 0x55558e55558e5555ULL, },
+ { 0x5571555571555571ULL, 0x5555715555715555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcc8e38cc8e38cc8eULL, 0x38cc8e38cc8e38ccULL, },
+ { 0xcc71c7cc71c7cc71ULL, 0xc7cc71c7cc71c7ccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x338e38338e38338eULL, 0x38338e38338e3833ULL, },
+ { 0x3371c73371c73371ULL, 0xc73371c73371c733ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaa8eaaaa8eaaaa8eULL, 0xaaaa8eaaaa8eaaaaULL, },
+ { 0x558e55558e55558eULL, 0x55558e55558e5555ULL, },
+ { 0xcc8e38cc8e38cc8eULL, 0x38cc8e38cc8e38ccULL, },
+ { 0x338e38338e38338eULL, 0x38338e38338e3833ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38ec7e38ec7e38eULL, 0xc7e38ec7e38ec7e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaa71aaaa71aaaa71ULL, 0xaaaa71aaaa71aaaaULL, },
+ { 0x5571555571555571ULL, 0x5555715555715555ULL, },
+ { 0xcc71c7cc71c7cc71ULL, 0xc7cc71c7cc71c7ccULL, },
+ { 0x3371c73371c73371ULL, 0xc73371c73371c733ULL, },
+ { 0xe38ec7e38ec7e38eULL, 0xc7e38ec7e38ec7e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6634d935540ULL, 0x4b67bb5e157b520cULL, },
+ { 0x886aaeaab9628b80ULL, 0x4b67c65eab7bb014ULL, },
+ { 0x886ae64d5e62554eULL, 0x8d67885ea97bb0a0ULL, },
+ { 0x886ae6634d935540ULL, 0x4b67bb5e157b520cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aae634d938b80ULL, 0x27d8bb1aab3f5214ULL, },
+ { 0x704f16635e93c74eULL, 0x8df188d8a94252a0ULL, },
+ { 0x886aaeaab9628b80ULL, 0x4b67c65eab7bb014ULL, }, /* 72 */
+ { 0xac5aae634d938b80ULL, 0x27d8bb1aab3f5214ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x705aaeaa5e318b80ULL, 0x8dd888d8a94225a0ULL, },
+ { 0x886ae64d5e62554eULL, 0x8d67885ea97bb0a0ULL, },
+ { 0x704f16635e93c74eULL, 0x8df188d8a94252a0ULL, },
+ { 0x705aaeaa5ecf8b80ULL, 0x8dd888d8a94225a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c
new file mode 100644
index 0000000000..3dfdb482f4
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_A.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_A.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c
new file mode 100644
index 0000000000..e1d65f98dc
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_A.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_A.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa8e38aaaaULL, 0xaaaa8e38aaaaaaaaULL, },
+ { 0xaaaaaaaa71c7aaaaULL, 0xaaaa71c7aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x555555558e385555ULL, 0x55558e3855555555ULL, },
+ { 0x5555555571c75555ULL, 0x555571c755555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccc38e38e38ccccULL, 0x38e38e38cccc38e3ULL, },
+ { 0xccccc71c71c7ccccULL, 0xc71c71c7ccccc71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333338e38e383333ULL, 0x38e38e38333338e3ULL, },
+ { 0x3333c71c71c73333ULL, 0xc71c71c73333c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaa8e38aaaaULL, 0xaaaa8e38aaaaaaaaULL, },
+ { 0x555555558e385555ULL, 0x55558e3855555555ULL, },
+ { 0xcccc38e38e38ccccULL, 0x38e38e38cccc38e3ULL, },
+ { 0x333338e38e383333ULL, 0x38e38e38333338e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38ec71c8e38e38eULL, 0xc71c8e38e38ec71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaa71c7aaaaULL, 0xaaaa71c7aaaaaaaaULL, },
+ { 0x5555555571c75555ULL, 0x555571c755555555ULL, },
+ { 0xccccc71c71c7ccccULL, 0xc71c71c7ccccc71cULL, },
+ { 0x3333c71c71c73333ULL, 0xc71c71c73333c71cULL, },
+ { 0xe38ec71c8e38e38eULL, 0xc71c8e38e38ec71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc4d935540ULL, 0x4b67bb1a153f52fcULL, },
+ { 0x886aaeaab9cf8b80ULL, 0x4b67c6ffab2bb00cULL, },
+ { 0x886ae6cc5e315540ULL, 0x8df188d8a942b00cULL, },
+ { 0x886ae6cc4d935540ULL, 0x4b67bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaa4d938b80ULL, 0x27d8bb1aab2b52fcULL, },
+ { 0x704f164d5e31c708ULL, 0x8df188d8a94252fcULL, },
+ { 0x886aaeaab9cf8b80ULL, 0x4b67c6ffab2bb00cULL, }, /* 72 */
+ { 0xac5aaeaa4d938b80ULL, 0x27d8bb1aab2b52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704faeaa5e318b80ULL, 0x8df188d8a9422514ULL, },
+ { 0x886ae6cc5e315540ULL, 0x8df188d8a942b00cULL, },
+ { 0x704f164d5e31c708ULL, 0x8df188d8a94252fcULL, },
+ { 0x704faeaa5e318b80ULL, 0x8df188d8a9422514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c
new file mode 100644
index 0000000000..600f60af56
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_a_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_A.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_A.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x555555558e38e38eULL, 0x5555555555555555ULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0xcccccccc71c71c71ULL, 0xc71c71c7ccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333333338e38e38eULL, 0x38e38e3833333333ULL, },
+ { 0x3333333371c71c71ULL, 0xc71c71c733333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x555555558e38e38eULL, 0x5555555555555555ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x333333338e38e38eULL, 0x38e38e3833333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaa71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0xcccccccc71c71c71ULL, 0xc71c71c7ccccccccULL, },
+ { 0x3333333371c71c71ULL, 0xc71c71c733333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc4d93c708ULL, 0x4b670b5e153f52fcULL, },
+ { 0x886ae6ccb9cf8b80ULL, 0x4b670b5eab2b2514ULL, },
+ { 0x886ae6cc5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc4d93c708ULL, 0x4b670b5e153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaa4d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6ccb9cf8b80ULL, 0x4b670b5eab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaa4d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_A_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c
new file mode 100644
index 0000000000..ab4161f20c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xffff38ffff38ffffULL, 0x38ffff38ffff38ffULL, },
+ { 0x1c71ff1c71ff1c71ULL, 0xff1c71ff1c71ff1cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000380000380000ULL, 0x3800003800003800ULL, },
+ { 0x1c71001c71001c71ULL, 0x001c71001c71001cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe3aa38e3aa38e3aaULL, 0x38e3aa38e3aa38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5571555571555571ULL, 0x5555715555715555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe3cc38e3cc38e3ccULL, 0x38e3cc38e3cc38e3ULL, },
+ { 0x1c71cc1c71cc1c71ULL, 0xcc1c71cc1c71cc1cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333383333383333ULL, 0x3833333833333833ULL, },
+ { 0x3371333371333371ULL, 0x3333713333713333ULL, },
+ { 0xffff38ffff38ffffULL, 0x38ffff38ffff38ffULL, }, /* 48 */
+ { 0x0000380000380000ULL, 0x3800003800003800ULL, },
+ { 0xe3aa38e3aa38e3aaULL, 0x38e3aa38e3aa38e3ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe3cc38e3cc38e3ccULL, 0x38e3cc38e3cc38e3ULL, },
+ { 0x3333383333383333ULL, 0x3833333833333833ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71381c71381c71ULL, 0x381c71381c71381cULL, },
+ { 0x1c71ff1c71ff1c71ULL, 0xff1c71ff1c71ff1cULL, }, /* 56 */
+ { 0x1c71001c71001c71ULL, 0x001c71001c71001cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5571555571555571ULL, 0x5555715555715555ULL, },
+ { 0x1c71cc1c71cc1c71ULL, 0xcc1c71cc1c71cc1cULL, },
+ { 0x3371333371333371ULL, 0x3333713333713333ULL, },
+ { 0x1c71381c71381c71ULL, 0x381c71381c71381cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfb6a00634d625540ULL, 0x4b670b5e157b520cULL, },
+ { 0xac6ae6cc28625540ULL, 0x4b670b5efe7b2514ULL, },
+ { 0x706a164d5e62554eULL, 0x4b670b5efe7be20cULL, },
+ { 0xfb6a00634d625540ULL, 0x4b670b5e157b520cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfb5a00634dcfc708ULL, 0x27f7c61a153f5214ULL, },
+ { 0x704f16635e31e24eULL, 0x12f7bb1a154252fcULL, },
+ { 0xac6ae6cc28625540ULL, 0x4b670b5efe7b2514ULL, }, /* 72 */
+ { 0xfb5a00634dcfc708ULL, 0x27f7c61a153f5214ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x705a164d5e31e24eULL, 0x27f1c6ffab422514ULL, },
+ { 0x706a164d5e62554eULL, 0x4b670b5efe7be20cULL, },
+ { 0x704f16635e31e24eULL, 0x12f7bb1a154252fcULL, },
+ { 0x705a164d5e31e24eULL, 0x27f1c6ffab422514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c
new file mode 100644
index 0000000000..54a78ae56a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c
new file mode 100644
index 0000000000..79b1e0adfd
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xffff38e3ffffffffULL, 0x38e3ffffffff38e3ULL, },
+ { 0x1c71ffff71c71c71ULL, 0xffff71c71c71ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000038e300000000ULL, 0x38e30000000038e3ULL, },
+ { 0x1c71000071c71c71ULL, 0x000071c71c710000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3aaaae38eULL, 0x38e3aaaae38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555571c75555ULL, 0x555571c755555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3cccce38eULL, 0x38e3cccce38e38e3ULL, },
+ { 0x1c71cccc71c71c71ULL, 0xcccc71c71c71ccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333338e333333333ULL, 0x38e33333333338e3ULL, },
+ { 0x3333333371c73333ULL, 0x333371c733333333ULL, },
+ { 0xffff38e3ffffffffULL, 0x38e3ffffffff38e3ULL, }, /* 48 */
+ { 0x000038e300000000ULL, 0x38e30000000038e3ULL, },
+ { 0xe38e38e3aaaae38eULL, 0x38e3aaaae38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e3cccce38eULL, 0x38e3cccce38e38e3ULL, },
+ { 0x333338e333333333ULL, 0x38e33333333338e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c7138e371c71c71ULL, 0x38e371c71c7138e3ULL, },
+ { 0x1c71ffff71c71c71ULL, 0xffff71c71c71ffffULL, }, /* 56 */
+ { 0x1c71000071c71c71ULL, 0x000071c71c710000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555571c75555ULL, 0x555571c755555555ULL, },
+ { 0x1c71cccc71c71c71ULL, 0xcccc71c71c71ccccULL, },
+ { 0x3333333371c73333ULL, 0x333371c733333333ULL, },
+ { 0x1c7138e371c71c71ULL, 0x38e371c71c7138e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d935540ULL, 0x4b670b5e153f52fcULL, },
+ { 0xac5ae6cc28625540ULL, 0x4b670b5efe7b2514ULL, },
+ { 0x704f164d5e315540ULL, 0x4b670b5efe7be2a0ULL, },
+ { 0xfbbe00634d935540ULL, 0x4b670b5e153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ff153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5ae6cc28625540ULL, 0x4b670b5efe7b2514ULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ff153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e315540ULL, 0x4b670b5efe7be2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c
new file mode 100644
index 0000000000..32e32456eb
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38ffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffff1c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x38e38e3800000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3ccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xcccccccc1c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x38e38e3833333333ULL, },
+ { 0x3333333371c71c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38ffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e3800000000ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e3ccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e3833333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffff1c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x000000001c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555571c71c71ULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xcccccccc1c71c71cULL, },
+ { 0x3333333371c71c71ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x4b670b5e153f52fcULL, },
+ { 0xac5aaeaa28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x4b670b5e153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ff153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaa28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ff153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c
new file mode 100644
index 0000000000..a63d226279
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe3aaaae3aaaae3aaULL, 0xaae3aaaae3aaaae3ULL, },
+ { 0xaaaac7aaaac7aaaaULL, 0xc7aaaac7aaaac7aaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e55e38e55e38eULL, 0x55e38e55e38e55e3ULL, },
+ { 0x5571c75571c75571ULL, 0xc75571c75571c755ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe3cccce3cccce3ccULL, 0xcce3cccce3cccce3ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3371c73371c73371ULL, 0xc73371c73371c733ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe3aaaae3aaaae3aaULL, 0xaae3aaaae3aaaae3ULL, },
+ { 0xe38e55e38e55e38eULL, 0x55e38e55e38e55e3ULL, },
+ { 0xe3cccce3cccce3ccULL, 0xcce3cccce3cccce3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38ec7e38ec7e38eULL, 0xc7e38ec7e38ec7e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaac7aaaac7aaaaULL, 0xc7aaaac7aaaac7aaULL, },
+ { 0x5571c75571c75571ULL, 0xc75571c75571c755ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3371c73371c73371ULL, 0xc73371c73371c733ULL, },
+ { 0xe38ec7e38ec7e38eULL, 0xc7e38ec7e38ec7e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbee6cc4d93c740ULL, 0x4bf7bb5efe7bb0fcULL, },
+ { 0xac6ae6ccb9cf8b80ULL, 0x4bd8c6fffe7bb014ULL, },
+ { 0x886ae6cc5e62e24eULL, 0x8df188d8fe7be2a0ULL, },
+ { 0xfbbee6cc4d93c740ULL, 0x4bf7bb5efe7bb0fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbeaeaab9cfc780ULL, 0x27f7c6ffab3f52fcULL, },
+ { 0xfbbe16635e93e24eULL, 0x8df7bbd8a942e2fcULL, },
+ { 0xac6ae6ccb9cf8b80ULL, 0x4bd8c6fffe7bb014ULL, }, /* 72 */
+ { 0xfbbeaeaab9cfc780ULL, 0x27f7c6ffab3f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cfe280ULL, 0x8df1c6ffab42e2a0ULL, },
+ { 0x886ae6cc5e62e24eULL, 0x8df188d8fe7be2a0ULL, },
+ { 0xfbbe16635e93e24eULL, 0x8df7bbd8a942e2fcULL, },
+ { 0xac5aaeaab9cfe280ULL, 0x8df1c6ffab42e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c
new file mode 100644
index 0000000000..815a9ef497
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c
new file mode 100644
index 0000000000..b668b39507
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38eaaaaaaaae38eULL, 0xaaaaaaaae38eaaaaULL, },
+ { 0xaaaac71caaaaaaaaULL, 0xc71caaaaaaaac71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e55558e38e38eULL, 0x55558e38e38e5555ULL, },
+ { 0x5555c71c71c75555ULL, 0xc71c71c75555c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38ecccccccce38eULL, 0xcccccccce38eccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333c71c71c73333ULL, 0xc71c71c73333c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38eaaaaaaaae38eULL, 0xaaaaaaaae38eaaaaULL, },
+ { 0xe38e55558e38e38eULL, 0x55558e38e38e5555ULL, },
+ { 0xe38ecccccccce38eULL, 0xcccccccce38eccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38ec71c8e38e38eULL, 0xc71c8e38e38ec71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaac71caaaaaaaaULL, 0xc71caaaaaaaac71cULL, },
+ { 0x5555c71c71c75555ULL, 0xc71c71c75555c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333c71c71c73333ULL, 0xc71c71c73333c71cULL, },
+ { 0xe38ec71c8e38e38eULL, 0xc71c8e38e38ec71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbee6cc4d93c708ULL, 0x4b67bb1afe7bb00cULL, },
+ { 0xac5ae6ccb9cf8b80ULL, 0x4b67c6fffe7bb00cULL, },
+ { 0x886ae6cc5e31e24eULL, 0x8df188d8fe7be2a0ULL, },
+ { 0xfbbee6cc4d93c708ULL, 0x4b67bb1afe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbeaeaab9cfc708ULL, 0x27d8c6ffab2b52fcULL, },
+ { 0xfbbe164d5e31e24eULL, 0x8df1bb1aa942e2a0ULL, },
+ { 0xac5ae6ccb9cf8b80ULL, 0x4b67c6fffe7bb00cULL, }, /* 72 */
+ { 0xfbbeaeaab9cfc708ULL, 0x27d8c6ffab2b52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cfe24eULL, 0x8df1c6ffab2be2a0ULL, },
+ { 0x886ae6cc5e31e24eULL, 0x8df188d8fe7be2a0ULL, },
+ { 0xfbbe164d5e31e24eULL, 0x8df1bb1aa942e2a0ULL, },
+ { 0xac5aaeaab9cfe24eULL, 0x8df1c6ffab2be2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c
new file mode 100644
index 0000000000..3329455f92
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_max_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MAX_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MAX_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0xaaaaaaaae38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x55555555e38e38e3ULL, },
+ { 0x5555555571c71c71ULL, 0xc71c71c755555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333371c71c71ULL, 0xc71c71c733333333ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0xaaaaaaaae38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x55555555e38e38e3ULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x5555555571c71c71ULL, 0xc71c71c755555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333371c71c71ULL, 0xc71c71c733333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc5e31e24eULL, 0x8df188d8fe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe0063b9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xfbbe00635e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x4b670b5efe7bb00cULL, }, /* 72 */
+ { 0xfbbe0063b9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8ab2b2514ULL, },
+ { 0x886ae6cc5e31e24eULL, 0x8df188d8fe7bb00cULL, },
+ { 0xfbbe00635e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8ab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MAX_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c
new file mode 100644
index 0000000000..8fdbfc3bd3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_A.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_A.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe3aa38e3aa38e3aaULL, 0x38e3aa38e3aa38e3ULL, },
+ { 0x1caac71caac71caaULL, 0xc71caac71caac71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe35538e35538e355ULL, 0x38e35538e35538e3ULL, },
+ { 0x1c55c71c55c71c55ULL, 0xc71c55c71c55c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe3cccce3cccce3ccULL, 0xcce3cccce3cccce3ULL, },
+ { 0x1ccccc1ccccc1cccULL, 0xcc1ccccc1ccccc1cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe33333e33333e333ULL, 0x33e33333e33333e3ULL, },
+ { 0x1c33331c33331c33ULL, 0x331c33331c33331cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe3aa38e3aa38e3aaULL, 0x38e3aa38e3aa38e3ULL, },
+ { 0xe35538e35538e355ULL, 0x38e35538e35538e3ULL, },
+ { 0xe3cccce3cccce3ccULL, 0xcce3cccce3cccce3ULL, },
+ { 0xe33333e33333e333ULL, 0x33e33333e33333e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71381c71381c71ULL, 0x381c71381c71381cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1caac71caac71caaULL, 0xc71caac71caac71cULL, },
+ { 0x1c55c71c55c71c55ULL, 0xc71c55c71c55c71cULL, },
+ { 0x1ccccc1ccccc1cccULL, 0xcc1ccccc1ccccc1cULL, },
+ { 0x1c33331c33331c33ULL, 0x331c33331c33331cULL, },
+ { 0x1c71381c71381c71ULL, 0x381c71381c71381cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00cc2862c708ULL, 0x12f70b1afe3fb0fcULL, },
+ { 0xac5ae6cc28cf5540ULL, 0x27d80bfffe2b250cULL, },
+ { 0x704f16cc2831e240ULL, 0x4bf10bd8fe42e20cULL, },
+ { 0xfbbe00cc2862c708ULL, 0x12f70b1afe3fb0fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00aab9cfc708ULL, 0x12f7c6ff152b25fcULL, },
+ { 0xfbbe004d4d31e208ULL, 0x12f7bb1a153fe2fcULL, },
+ { 0xac5ae6cc28cf5540ULL, 0x27d80bfffe2b250cULL, }, /* 72 */
+ { 0xfbbe00aab9cfc708ULL, 0x12f7c6ff152b25fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac4f164db931e24eULL, 0x27f1c6ffab2be214ULL, },
+ { 0x704f16cc2831e240ULL, 0x4bf10bd8fe42e20cULL, },
+ { 0xfbbe004d4d31e208ULL, 0x12f7bb1a153fe2fcULL, },
+ { 0xac4f164db9cfe24eULL, 0x27f1c6ffab2be214ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c
new file mode 100644
index 0000000000..6a9f6bf10e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_A.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_A.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c
new file mode 100644
index 0000000000..67a40b96f3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_A.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_A.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3aaaae38eULL, 0x38e3aaaae38e38e3ULL, },
+ { 0x1c71c71caaaa1c71ULL, 0xc71caaaa1c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e35555e38eULL, 0x38e35555e38e38e3ULL, },
+ { 0x1c71c71c55551c71ULL, 0xc71c55551c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38ecccccccce38eULL, 0xcccccccce38eccccULL, },
+ { 0x1c71cccccccc1c71ULL, 0xcccccccc1c71ccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e33333333e38eULL, 0x33333333e38e3333ULL, },
+ { 0x1c71333333331c71ULL, 0x333333331c713333ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e3aaaae38eULL, 0x38e3aaaae38e38e3ULL, },
+ { 0xe38e38e35555e38eULL, 0x38e35555e38e38e3ULL, },
+ { 0xe38ecccccccce38eULL, 0xcccccccce38eccccULL, },
+ { 0xe38e33333333e38eULL, 0x33333333e38e3333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c7138e371c71c71ULL, 0x38e371c71c7138e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71caaaa1c71ULL, 0xc71caaaa1c71c71cULL, },
+ { 0x1c71c71c55551c71ULL, 0xc71c55551c71c71cULL, },
+ { 0x1c71cccccccc1c71ULL, 0xcccccccc1c71ccccULL, },
+ { 0x1c71333333331c71ULL, 0x333333331c713333ULL, },
+ { 0x1c7138e371c71c71ULL, 0x38e371c71c7138e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00632862c708ULL, 0x12f70b5efe7bb00cULL, },
+ { 0xac5ae6cc28625540ULL, 0x27d80b5efe7b2514ULL, },
+ { 0x704f164d2862e24eULL, 0x4b670b5efe7be2a0ULL, },
+ { 0xfbbe00632862c708ULL, 0x12f70b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe0063b9cfc708ULL, 0x12f7c6ff153f2514ULL, },
+ { 0xfbbe00634d93e24eULL, 0x12f7bb1a153fe2a0ULL, },
+ { 0xac5ae6cc28625540ULL, 0x27d80b5efe7b2514ULL, }, /* 72 */
+ { 0xfbbe0063b9cfc708ULL, 0x12f7c6ff153f2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5a164db9cfe24eULL, 0x27d8c6ffab2be2a0ULL, },
+ { 0x704f164d2862e24eULL, 0x4b670b5efe7be2a0ULL, },
+ { 0xfbbe00634d93e24eULL, 0x12f7bb1a153fe2a0ULL, },
+ { 0xac5a164db9cfe24eULL, 0x27d8c6ffab2be2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c
new file mode 100644
index 0000000000..d08cb9cea8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_a_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_A.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_A.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71caaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e355555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0x1c71c71cccccccccULL, 0xcccccccc1c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e333333333ULL, 0x33333333e38e38e3ULL, },
+ { 0x1c71c71c33333333ULL, 0x333333331c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e355555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3ccccccccULL, 0xcccccccce38e38e3ULL, },
+ { 0xe38e38e333333333ULL, 0x33333333e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71caaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71cccccccccULL, 0xcccccccc1c71c71cULL, },
+ { 0x1c71c71c33333333ULL, 0x333333331c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe006328625540ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0xac5aaeaa28625540ULL, 0x27d8c6fffe7bb00cULL, },
+ { 0x704f164d28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe006328625540ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe0063b9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaa28625540ULL, 0x27d8c6fffe7bb00cULL, }, /* 72 */
+ { 0xfbbe0063b9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d28625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_A_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c
new file mode 100644
index 0000000000..048233bbab
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe38effe38effe38eULL, 0xffe38effe38effe3ULL, },
+ { 0xffffc7ffffc7ffffULL, 0xc7ffffc7ffffc7ffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e00e38e00e38eULL, 0x00e38e00e38e00e3ULL, },
+ { 0x0000c70000c70000ULL, 0xc70000c70000c700ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa8eaaaa8eaaaa8eULL, 0xaaaa8eaaaa8eaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c55c71c55c71c55ULL, 0xc71c55c71c55c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcc8ecccc8ecccc8eULL, 0xcccc8ecccc8eccccULL, },
+ { 0xccccc7ccccc7ccccULL, 0xc7ccccc7ccccc7ccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e33e38e33e38eULL, 0x33e38e33e38e33e3ULL, },
+ { 0x1c33c71c33c71c33ULL, 0xc71c33c71c33c71cULL, },
+ { 0xe38effe38effe38eULL, 0xffe38effe38effe3ULL, }, /* 48 */
+ { 0xe38e00e38e00e38eULL, 0x00e38e00e38e00e3ULL, },
+ { 0xaa8eaaaa8eaaaa8eULL, 0xaaaa8eaaaa8eaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xcc8ecccc8ecccc8eULL, 0xcccc8ecccc8eccccULL, },
+ { 0xe38e33e38e33e38eULL, 0x33e38e33e38e33e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38ec7e38ec7e38eULL, 0xc7e38ec7e38ec7e3ULL, },
+ { 0xffffc7ffffc7ffffULL, 0xc7ffffc7ffffc7ffULL, }, /* 56 */
+ { 0x0000c70000c70000ULL, 0xc70000c70000c700ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c55c71c55c71c55ULL, 0xc71c55c71c55c71cULL, },
+ { 0xccccc7ccccc7ccccULL, 0xc7ccccc7ccccc7ccULL, },
+ { 0x1c33c71c33c71c33ULL, 0xc71c33c71c33c71cULL, },
+ { 0xe38ec7e38ec7e38eULL, 0xc7e38ec7e38ec7e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x88bee6cc2893c708ULL, 0x12f7bb1afe3fb0fcULL, },
+ { 0x885aaeaab9cf8b80ULL, 0x27d8c6ffab2bb00cULL, },
+ { 0x884fe6cc2831e240ULL, 0x8df188d8a942b0a0ULL, },
+ { 0x88bee6cc2893c708ULL, 0x12f7bb1afe3fb0fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xacbeaeaab9938b80ULL, 0x12d8bbffab2b25fcULL, },
+ { 0xfbbe004d4d93c708ULL, 0x8df188d8a93fe2a0ULL, },
+ { 0x885aaeaab9cf8b80ULL, 0x27d8c6ffab2bb00cULL, }, /* 72 */
+ { 0xacbeaeaab9938b80ULL, 0x12d8bbffab2b25fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac4faeaab9cf8b80ULL, 0x8dd888d8a92be2a0ULL, },
+ { 0x884fe6cc2831e240ULL, 0x8df188d8a942b0a0ULL, },
+ { 0xfbbe004d4d93c708ULL, 0x8df188d8a93fe2a0ULL, },
+ { 0xac4faeaab9cf8b80ULL, 0x8dd888d8a92be2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c
new file mode 100644
index 0000000000..04e18ebdbf
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c
new file mode 100644
index 0000000000..3bf32d487a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe38effff8e38e38eULL, 0xffff8e38e38effffULL, },
+ { 0xffffc71cffffffffULL, 0xc71cffffffffc71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e00008e38e38eULL, 0x00008e38e38e0000ULL, },
+ { 0x0000c71c00000000ULL, 0xc71c00000000c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa8e38aaaaULL, 0xaaaa8e38aaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c55551c71ULL, 0xc71c55551c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc8e38ccccULL, 0xcccc8e38ccccccccULL, },
+ { 0xccccc71cccccccccULL, 0xc71cccccccccc71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e33338e38e38eULL, 0x33338e38e38e3333ULL, },
+ { 0x1c71c71c33331c71ULL, 0xc71c33331c71c71cULL, },
+ { 0xe38effff8e38e38eULL, 0xffff8e38e38effffULL, }, /* 48 */
+ { 0xe38e00008e38e38eULL, 0x00008e38e38e0000ULL, },
+ { 0xaaaaaaaa8e38aaaaULL, 0xaaaa8e38aaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xcccccccc8e38ccccULL, 0xcccc8e38ccccccccULL, },
+ { 0xe38e33338e38e38eULL, 0x33338e38e38e3333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38ec71c8e38e38eULL, 0xc71c8e38e38ec71cULL, },
+ { 0xffffc71cffffffffULL, 0xc71cffffffffc71cULL, }, /* 56 */
+ { 0x0000c71c00000000ULL, 0xc71c00000000c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c55551c71ULL, 0xc71c55551c71c71cULL, },
+ { 0xccccc71cccccccccULL, 0xc71cccccccccc71cULL, },
+ { 0x1c71c71c33331c71ULL, 0xc71c33331c71c71cULL, },
+ { 0xe38ec71c8e38e38eULL, 0xc71c8e38e38ec71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc2862c708ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0x886aaeaab9cf8b80ULL, 0x27d8c6ffab2bb00cULL, },
+ { 0x886ae6cc2862e24eULL, 0x8df188d8a942b00cULL, },
+ { 0x886ae6cc2862c708ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1aab2b2514ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886aaeaab9cf8b80ULL, 0x27d8c6ffab2bb00cULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1aab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc2862e24eULL, 0x8df188d8a942b00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c
new file mode 100644
index 0000000000..eeb2ec9359
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c7ffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0xc71c71c700000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc8e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c7ccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x33333333e38e38e3ULL, },
+ { 0x1c71c71c33333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffe38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xcccccccc8e38e38eULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0x33333333e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c7ffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c700000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c7ccccccccULL, },
+ { 0x1c71c71c33333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xc71c71c7e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0x886ae6ccb9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x12f7bb1afe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1aab2b2514ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6ccb9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1aab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xfbbe00634d93c708ULL, 0x8df188d8a942e2a0ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c
new file mode 100644
index 0000000000..bdebf68a49
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaa8e38aa8e38aa8eULL, 0x38aa8e38aa8e38aaULL, },
+ { 0x1c71aa1c71aa1c71ULL, 0xaa1c71aa1c71aa1cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555385555385555ULL, 0x3855553855553855ULL, },
+ { 0x1c55551c55551c55ULL, 0x551c55551c55551cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcc8e38cc8e38cc8eULL, 0x38cc8e38cc8e38ccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c33331c33331c33ULL, 0x331c33331c33331cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaa8e38aa8e38aa8eULL, 0x38aa8e38aa8e38aaULL, },
+ { 0x5555385555385555ULL, 0x3855553855553855ULL, },
+ { 0xcc8e38cc8e38cc8eULL, 0x38cc8e38cc8e38ccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71381c71381c71ULL, 0x381c71381c71381cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71aa1c71aa1c71ULL, 0xaa1c71aa1c71aa1cULL, },
+ { 0x1c55551c55551c55ULL, 0x551c55551c55551cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c33331c33331c33ULL, 0x331c33331c33331cULL, },
+ { 0x1c71381c71381c71ULL, 0x381c71381c71381cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886a006328625508ULL, 0x12670b1a153f520cULL, },
+ { 0x885aaeaa28625540ULL, 0x27670b5eab2b250cULL, },
+ { 0x704f164d28315540ULL, 0x4b670b5ea942b00cULL, },
+ { 0x886a006328625508ULL, 0x12670b1a153f520cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5a00634d938b08ULL, 0x12d8bb1a152b2514ULL, },
+ { 0x704f004d4d31c708ULL, 0x12f1881a153f52a0ULL, },
+ { 0x885aaeaa28625540ULL, 0x27670b5eab2b250cULL, }, /* 72 */
+ { 0xac5a00634d938b08ULL, 0x12d8bb1a152b2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e318b4eULL, 0x27d888d8a92b2514ULL, },
+ { 0x704f164d28315540ULL, 0x4b670b5ea942b00cULL, },
+ { 0x704f004d4d31c708ULL, 0x12f1881a153f52a0ULL, },
+ { 0x704f164d5e318b4eULL, 0x27d888d8a92b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c
new file mode 100644
index 0000000000..fcd90167ed
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x4b670b5efe7bb00cULL, },
+ { 0x704f164d5e31e24eULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c
new file mode 100644
index 0000000000..16f54b79e1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaa38e38e38aaaaULL, 0x38e38e38aaaa38e3ULL, },
+ { 0x1c71aaaa71c71c71ULL, 0xaaaa71c71c71aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x555538e355555555ULL, 0x38e35555555538e3ULL, },
+ { 0x1c71555555551c71ULL, 0x555555551c715555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcccc38e38e38ccccULL, 0x38e38e38cccc38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71333333331c71ULL, 0x333333331c713333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaa38e38e38aaaaULL, 0x38e38e38aaaa38e3ULL, },
+ { 0x555538e355555555ULL, 0x38e35555555538e3ULL, },
+ { 0xcccc38e38e38ccccULL, 0x38e38e38cccc38e3ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c7138e371c71c71ULL, 0x38e371c71c7138e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71aaaa71c71c71ULL, 0xaaaa71c71c71aaaaULL, },
+ { 0x1c71555555551c71ULL, 0x555555551c715555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71333333331c71ULL, 0x333333331c713333ULL, },
+ { 0x1c7138e371c71c71ULL, 0x38e371c71c7138e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886a006328625540ULL, 0x12f70b5e153f52fcULL, },
+ { 0x886aaeaa28625540ULL, 0x27d80b5eab2b2514ULL, },
+ { 0x704f164d28625540ULL, 0x4b670b5ea942b00cULL, },
+ { 0x886a006328625540ULL, 0x12f70b5e153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5a00634d938b80ULL, 0x12f7bb1a153f2514ULL, },
+ { 0x704f00634d93c708ULL, 0x12f788d8153f52fcULL, },
+ { 0x886aaeaa28625540ULL, 0x27d80b5eab2b2514ULL, }, /* 72 */
+ { 0xac5a00634d938b80ULL, 0x12f7bb1a153f2514ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e318b80ULL, 0x27d888d8a9422514ULL, },
+ { 0x704f164d28625540ULL, 0x4b670b5ea942b00cULL, },
+ { 0x704f00634d93c708ULL, 0x12f788d8153f52fcULL, },
+ { 0x704f164d5e318b80ULL, 0x27d888d8a9422514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c
new file mode 100644
index 0000000000..574c169d03
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-max-min/test_msa_min_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MIN_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Max Min";
+ char *instruction_name = "MIN_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0x38e38e38aaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x38e38e3855555555ULL, },
+ { 0x1c71c71c55555555ULL, 0x555555551c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c33333333ULL, 0x333333331c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0x38e38e38aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x38e38e3855555555ULL, },
+ { 0xcccccccc8e38e38eULL, 0x38e38e38ccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x1c71c71c55555555ULL, 0x555555551c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c33333333ULL, 0x333333331c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e381c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d28625540ULL, 0x4b670b5ea942e2a0ULL, },
+ { 0x886ae6cc28625540ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaa4d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d4d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x886ae6cc28625540ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaa4d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffa942e2a0ULL, },
+ { 0x704f164d28625540ULL, 0x4b670b5ea942e2a0ULL, },
+ { 0x704f164d4d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x704f164d5e31e24eULL, 0x27d8c6ffa942e2a0ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MIN_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_b.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_b.c
new file mode 100644
index 0000000000..1533790cae
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xe4aae2e4aae2e4aaULL, 0xe2e4aae2e4aae2e4ULL, },
+ { 0xfeaae3feaae3feaaULL, 0xe3feaae3feaae3feULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2121212121212121ULL, 0x2121212121212121ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x1b551d1b551d1b55ULL, 0x1d1b551d1b551d1bULL, },
+ { 0x01551c01551c0155ULL, 0x1c01551c01551c01ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe9cccce9cccce9ccULL, 0xcce9cccce9cccce9ULL, },
+ { 0xe8cccce8cccce8ccULL, 0xcce8cccce8cccce8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1633331633331633ULL, 0x3316333316333316ULL, },
+ { 0x1733331733331733ULL, 0x3317333317333317ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe3e438e3e438e3e4ULL, 0x38e3e438e3e438e3ULL, },
+ { 0xe3e338e3e338e3e3ULL, 0x38e3e338e3e338e3ULL, },
+ { 0xe3f604e3f604e3f6ULL, 0x04e3f604e3f604e3ULL, },
+ { 0xe3f405e3f405e3f4ULL, 0x05e3f405e3f405e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff38ffff38ffffULL, 0x38ffff38ffff38ffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c1bc71c1bc71c1bULL, 0xc71c1bc71c1bc71cULL, },
+ { 0x1c1cc71c1cc71c1cULL, 0xc71c1cc71c1cc71cULL, },
+ { 0x1c09fb1c09fb1c09ULL, 0xfb1c09fb1c09fb1cULL, },
+ { 0x1c0bfa1c0bfa1c0bULL, 0xfa1c0bfa1c0bfa1cULL, },
+ { 0x1c71ff1c71ff1c71ULL, 0xff1c71ff1c71ff1cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x0028e6cc28621c00ULL, 0x03040b10fe3cb000ULL, },
+ { 0xdc10e6cc28005540ULL, 0x24170b00fe25fa0cULL, },
+ { 0xf81bfccc28001940ULL, 0x4b0d0b0efe39ec0cULL, },
+ { 0xfbbe002f25f5c708ULL, 0x12f7fd1a013f02fcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xfbbe000d06f5c708ULL, 0x12f7f500151408fcULL, },
+ { 0xfbbe00164df5e508ULL, 0x12f7bb1a153f16fcULL, },
+ { 0xac5afcdee1cfe000ULL, 0x27d8fdffff2b2508ULL, }, /* 72 */
+ { 0xfc18aeaab9cffd00ULL, 0x03fcc6ffff2b2500ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac0bf0f7b900e5ceULL, 0x27f6c6ffab2b0714ULL, },
+ { 0x704f16190e31e20eULL, 0xd8f1f6d8ff42e200ULL, },
+ { 0x020d164d1131e206ULL, 0xf9facdf2fd03e200ULL, },
+ { 0x1c4f164d1700e24eULL, 0xdbf1fc00fe17e2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_d.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_d.c
new file mode 100644
index 0000000000..a8237f4244
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x0000000000000000ULL, 0xe38e38e38e38e38dULL, },
+ { 0xfffffffffffffffdULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222221ULL, 0x2222222222222221ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x0000000000000002ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe93e93e93e93e93eULL, 0xccccccccccccccccULL, },
+ { 0xe93e93e93e93e93dULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x16c16c16c16c16c1ULL, 0x3333333333333333ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x05b05b05b05b05afULL, },
+ { 0xe38e38e38e38e38eULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xfa4fa4fa4fa4fa4fULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffa2dbefac389060ULL, 0x127fda10bebdb718ULL, },
+ { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0xf8b9fd198694378eULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xfd40a74bf7d7c5e8ULL, 0x01e950cb80ac7f1cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0xd9589437a7be92acULL, },
+ { 0x019b20633f34191eULL, 0xffbfeb7528bed488ULL, },
+ { 0x1ca9c4f818016dceULL, 0xdda316d7ff992cc8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_h.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_h.c
new file mode 100644
index 0000000000..5d6e4d63f8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x0000e38daaaa0000ULL, 0xe38daaaa0000e38dULL, },
+ { 0xfffde38eaaaafffdULL, 0xe38eaaaafffde38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2221222122212221ULL, 0x2221222122212221ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x1c711c7255551c71ULL, 0x1c7255551c711c72ULL, },
+ { 0x00021c7155550002ULL, 0x1c71555500021c71ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe93ecccccccce93eULL, 0xcccccccce93eccccULL, },
+ { 0xe93dcccccccce93dULL, 0xcccccccce93dccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x16c13333333316c1ULL, 0x3333333316c13333ULL, },
+ { 0x16c23333333316c2ULL, 0x3333333316c23333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3e38ee38eULL, 0x38e3e38ee38e38e3ULL, },
+ { 0xe38e38e3e38de38eULL, 0x38e3e38de38e38e3ULL, },
+ { 0xe38e05aff4a0e38eULL, 0x05aff4a0e38e05afULL, },
+ { 0xe38e05b0f49ee38eULL, 0x05b0f49ee38e05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff38e3ffffffffULL, 0x38e3ffffffff38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c1c711c71ULL, 0xc71c1c711c71c71cULL, },
+ { 0x1c71c71c1c721c71ULL, 0xc71c1c721c71c71cULL, },
+ { 0x1c71fa500b5f1c71ULL, 0xfa500b5f1c71fa50ULL, },
+ { 0x1c71fa4f0b611c71ULL, 0xfa4f0b611c71fa4fULL, },
+ { 0x1c71ffff71c71c71ULL, 0xffff71c71c71ffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffa2ffef28621c48ULL, 0x12820b5efe7bb00cULL, },
+ { 0xdc10e6cc28625540ULL, 0x238f0b5efe7bfa34ULL, },
+ { 0xf8b9fd19286219dcULL, 0x4b670b5efe7beaccULL, },
+ { 0xfbbe00632531c708ULL, 0x12f7ff4e017e0308ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xfbbe00630762c708ULL, 0x12f7f41b153f08d4ULL, },
+ { 0xfbbe00634d93e4baULL, 0x12f7bb1a153f183cULL, },
+ { 0xac5afa46e231e0c0ULL, 0x27d8ffd5febe2514ULL, }, /* 72 */
+ { 0xfd40ffe0b9cffd70ULL, 0x01eac6ffeae82514ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5af191b9cfe496ULL, 0x27d8c6ffab2b07b4ULL, },
+ { 0x704f164d0d6de24eULL, 0xd958fa84ffdfe2a0ULL, },
+ { 0x019b0042109ee24eULL, 0xffbbcdbefe3ee2a0ULL, },
+ { 0x1ca9164d1800e24eULL, 0xdda1fadafe17e2a0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_w.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_w.c
new file mode 100644
index 0000000000..1b068f28f5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xe38e38e4aaaaaaaaULL, 0xe38e38e2e38e38e4ULL, },
+ { 0xfffffffeaaaaaaaaULL, 0xe38e38e3fffffffeULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222122222221ULL, 0x2222222122222221ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x1c71c71b55555555ULL, 0x1c71c71d1c71c71bULL, },
+ { 0x0000000155555555ULL, 0x1c71c71c00000001ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe93e93e9ccccccccULL, 0xcccccccce93e93e9ULL, },
+ { 0xe93e93e8ccccccccULL, 0xcccccccce93e93e8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x16c16c1633333333ULL, 0x3333333316c16c16ULL, },
+ { 0x16c16c1733333333ULL, 0x3333333316c16c17ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3e38e38e4ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3e38e38e3ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e38e3f49f49f6ULL, 0x05b05b04e38e38e3ULL, },
+ { 0xe38e38e3f49f49f4ULL, 0x05b05b05e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38ffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c1c71c71bULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c1c71c71cULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c0b60b609ULL, 0xfa4fa4fb1c71c71cULL, },
+ { 0x1c71c71c0b60b60bULL, 0xfa4fa4fa1c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffff1c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0xffa2dbf828625540ULL, 0x127fda10fe7bb00cULL, },
+ { 0xdc10382228625540ULL, 0x238e445ffe7bb00cULL, },
+ { 0xf8b9fd1928625540ULL, 0x4b670b5efe7bb00cULL, },
+ { 0xfbbe0063253171c8ULL, 0x12f7bb1a0002f3a4ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xfbbe006307635288ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaae231e0c0ULL, 0x27d8c6fffe985280ULL, }, /* 72 */
+ { 0xfd40a751b9cf8b80ULL, 0x01e950cbeae91e08ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d0d6d37ceULL, 0xd9589436ffb8aff4ULL, },
+ { 0x019b205b109e1b46ULL, 0xffbfeb74fe402e90ULL, },
+ { 0x1ca9c4f718016dceULL, 0xdda316d6fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_b.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_b.c
new file mode 100644
index 0000000000..0d9ddf5907
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c711f1c711f1c71ULL, 0x1f1c711f1c711f1cULL, },
+ { 0x031d38031d38031dULL, 0x38031d38031d3803ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xaa1c02aa1c02aa1cULL, 0x02aa1c02aa1c02aaULL, },
+ { 0x0239aa0239aa0239ULL, 0xaa0239aa0239aa02ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x55551d55551d5555ULL, 0x1d55551d55551d55ULL, },
+ { 0x0155550155550155ULL, 0x5501555501555501ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xcc3e24cc3e24cc3eULL, 0x24cc3e24cc3e24ccULL, },
+ { 0x085b05085b05085bULL, 0x05085b05085b0508ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1733331733331733ULL, 0x3317333317333317ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x398e38398e38398eULL, 0x38398e38398e3839ULL, },
+ { 0x3939383939383939ULL, 0x3839393839393839ULL, },
+ { 0x178e38178e38178eULL, 0x38178e38178e3817ULL, },
+ { 0x1728051728051728ULL, 0x0517280517280517ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x031d38031d38031dULL, 0x38031d38031d3803ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c711d1c711d1c71ULL, 0x1d1c711d1c711d1cULL, },
+ { 0x1c1c1d1c1c1d1c1cULL, 0x1d1c1c1d1c1c1d1cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c0b2e1c0b2e1c0bULL, 0x2e1c0b2e1c0b2e1cULL, },
+ { 0x1c711f1c711f1c71ULL, 0x1f1c711f1c711f1cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x886ae60628625500ULL, 0x03670b10023c0c0cULL, },
+ { 0x8810382228625540ULL, 0x24670b5e53251c0cULL, },
+ { 0x181b0a3228005540ULL, 0x4b670b5e5539b00cULL, },
+ { 0x7354006325311d08ULL, 0x1229001a153f5200ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f0a00634d933c08ULL, 0x121fbb1a1514080cULL, },
+ { 0x1b2000164d00c708ULL, 0x1206331a153f525cULL, },
+ { 0x245aaeaa190b3600ULL, 0x270a0043ab2b2508ULL, }, /* 72 */
+ { 0xac5aae471f3c8b00ULL, 0x03d80b15032b2514ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b14105b0b8b32ULL, 0x27d83e27022b2514ULL, },
+ { 0x704f164d0e31380eULL, 0x4223041ca9423204ULL, },
+ { 0x704f164d11311b06ULL, 0x0ff1880801033ea0ULL, },
+ { 0x704f164d5e31574eULL, 0x181988d8a9170400ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_d.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_d.c
new file mode 100644
index 0000000000..1c3aa2bb36
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c73ULL, },
+ { 0x0000000000000006ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000001ULL, },
+ { 0x0000000000000004ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x5555555555555555ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x0000000000000002ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x2222222222222223ULL, },
+ { 0x05b05b05b05b05b5ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000006ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x2d82d82d82d82d83ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c73ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x127fda10bebdb718ULL, },
+ { 0x886ae6cc28625540ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07eca3072f2ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x73531997253171c8ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x1b1fd3c89130026cULL, 0x12f7bb1a153f52fcULL, },
+ { 0x23efc7de916d3640ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaab9cf8b80ULL, 0x01e950cb80ac7f1cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x428a7d79aac73294ULL, },
+ { 0x704f164d5e31e24eULL, 0x092b6b2214879dbcULL, },
+ { 0x704f164d5e31e24eULL, 0x166733d9a7c17364ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_h.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_h.c
new file mode 100644
index 0000000000..a17a69f1f3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c711c7371c71c71ULL, 0x1c7371c71c711c73ULL, },
+ { 0x000638e31c710006ULL, 0x38e31c71000638e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xaaaa00011c72aaaaULL, 0x00011c72aaaa0001ULL, },
+ { 0x0004aaaa38e30004ULL, 0xaaaa38e30004aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x55551c7255555555ULL, 0x1c72555555551c72ULL, },
+ { 0x0002555555550002ULL, 0x5555555500025555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xcccc22233e94ccccULL, 0x22233e94cccc2223ULL, },
+ { 0x05b505b05b0505b5ULL, 0x05b05b0505b505b0ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x16c23333333316c2ULL, 0x3333333316c23333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e438e38e3838e4ULL, 0x38e38e3838e438e3ULL, },
+ { 0x38e438e338e338e4ULL, 0x38e338e338e438e3ULL, },
+ { 0x16c238e38e3816c2ULL, 0x38e38e3816c238e3ULL, },
+ { 0x16c205b027d216c2ULL, 0x05b027d216c205b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000638e31c710006ULL, 0x38e31c71000638e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c711c7271c71c71ULL, 0x1c7271c71c711c72ULL, },
+ { 0x1c711c721c721c71ULL, 0x1c721c721c711c72ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c712d830b611c71ULL, 0x2d830b611c712d83ULL, },
+ { 0x1c711c7371c71c71ULL, 0x1c7371c71c711c73ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x886a005028625540ULL, 0x12820b5e14c60a14ULL, },
+ { 0x886a382228625540ULL, 0x238f0b5e53501bbcULL, },
+ { 0x181b07ca28625540ULL, 0x4b670b5e5539b00cULL, },
+ { 0x7354006325311c88ULL, 0x12f7053a153f52fcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6400634d933b88ULL, 0x12f7bb1a153f08d4ULL, },
+ { 0x1b2000634d93c708ULL, 0x12f73242153f52fcULL, },
+ { 0x23f0aeaa18473640ULL, 0x27d805c1ab2b2514ULL, }, /* 72 */
+ { 0xac5a00411ea98b80ULL, 0x01ea0be501332514ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b128f5b9e8b80ULL, 0x27d83e2701e92514ULL, },
+ { 0x704f164d0d6d37ceULL, 0x428a0070a9423294ULL, },
+ { 0x704f0042109e1b46ULL, 0x093088d814893ca8ULL, },
+ { 0x704f164d5e3156ceULL, 0x166988d8a9420428ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_w.c b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_w.c
new file mode 100644
index 0000000000..ac0f704b18
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-modulo/test_msa_mod_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MOD_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Modulo";
+ char *instruction_name = "MOD_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71f1c71c71cULL, },
+ { 0x000000031c71c71dULL, 0x38e38e3800000003ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0xaaaaaaaa1c71c71cULL, 0x00000002aaaaaaaaULL, },
+ { 0x0000000238e38e39ULL, 0xaaaaaaaa00000002ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x5555555555555555ULL, 0x1c71c71d55555555ULL, },
+ { 0x0000000155555555ULL, 0x5555555500000001ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xcccccccc3e93e93eULL, 0x22222224ccccccccULL, },
+ { 0x05b05b085b05b05bULL, 0x05b05b0505b05b08ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x16c16c1733333333ULL, 0x3333333316c16c17ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e398e38e38eULL, 0x38e38e3838e38e39ULL, },
+ { 0x38e38e3938e38e39ULL, 0x38e38e3838e38e39ULL, },
+ { 0x16c16c178e38e38eULL, 0x38e38e3816c16c17ULL, },
+ { 0x16c16c1727d27d28ULL, 0x05b05b0516c16c17ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000031c71c71dULL, 0x38e38e3800000003ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71d1c71c71cULL, },
+ { 0x1c71c71c1c71c71cULL, 0x1c71c71d1c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c71c0b60b60bULL, 0x2d82d82e1c71c71cULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71f1c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x886ae6cc28625540ULL, 0x127fda1014c31f38ULL, },
+ { 0x886ae6cc28625540ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07f28625540ULL, 0x4b670b5e5538cd6cULL, },
+ { 0x73531997253171c8ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b94d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x1b1fd3c94d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x23efc7de18463680ULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0xac5aaeaa1ea7fd70ULL, 0x01e950cb01308d34ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x27d8c6ff01e84274ULL, },
+ { 0x704f164d0d6d37ceULL, 0x428a7d7aa942e2a0ULL, },
+ { 0x704f164d109e1b46ULL, 0x092b6b2214879dbcULL, },
+ { 0x704f164d5e31e24eULL, 0x166733dba942e2a0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MOD_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_b.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_b.c
new file mode 100644
index 0000000000..d543e1af28
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MADDV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MADDV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x5757575757575757ULL, 0x5757575757575757ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x3636363636363636ULL, 0x3636363636363636ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x2075cb2075cb2075ULL, 0xcb2075cb2075cb20ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, }, /* 8 */
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x0404040404040404ULL, 0x0404040404040404ULL, },
+ { 0x5a5a5a5a5a5a5a5aULL, 0x5a5a5a5a5a5a5a5aULL, }, /* 16 */
+ { 0x5a5a5a5a5a5a5a5aULL, 0x5a5a5a5a5a5a5a5aULL, },
+ { 0x3e3e3e3e3e3e3e3eULL, 0x3e3e3e3e3e3e3e3eULL, },
+ { 0xb0b0b0b0b0b0b0b0ULL, 0xb0b0b0b0b0b0b0b0ULL, },
+ { 0x2828282828282828ULL, 0x2828282828282828ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0xc45236c45236c452ULL, 0x36c45236c45236c4ULL, },
+ { 0x5c5c5c5c5c5c5c5cULL, 0x5c5c5c5c5c5c5c5cULL, },
+ { 0x0707070707070707ULL, 0x0707070707070707ULL, }, /* 24 */
+ { 0x0707070707070707ULL, 0x0707070707070707ULL, },
+ { 0x7979797979797979ULL, 0x7979797979797979ULL, },
+ { 0xb2b2b2b2b2b2b2b2ULL, 0xb2b2b2b2b2b2b2b2ULL, },
+ { 0x6e6e6e6e6e6e6e6eULL, 0x6e6e6e6e6e6e6e6eULL, },
+ { 0x5d5d5d5d5d5d5d5dULL, 0x5d5d5d5d5d5d5d5dULL, },
+ { 0xbc83f5bc83f5bc83ULL, 0xf5bc83f5bc83f5bcULL, },
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, },
+ { 0x3c3c3c3c3c3c3c3cULL, 0x3c3c3c3c3c3c3c3cULL, }, /* 32 */
+ { 0x3c3c3c3c3c3c3c3cULL, 0x3c3c3c3c3c3c3c3cULL, },
+ { 0xb4b4b4b4b4b4b4b4ULL, 0xb4b4b4b4b4b4b4b4ULL, },
+ { 0x7070707070707070ULL, 0x7070707070707070ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xa4a4a4a4a4a4a4a4ULL, 0xa4a4a4a4a4a4a4a4ULL, },
+ { 0x88cc4488cc4488ccULL, 0x4488cc4488cc4488ULL, },
+ { 0xd8d8d8d8d8d8d8d8ULL, 0xd8d8d8d8d8d8d8d8ULL, },
+ { 0xa5a5a5a5a5a5a5a5ULL, 0xa5a5a5a5a5a5a5a5ULL, }, /* 40 */
+ { 0xa5a5a5a5a5a5a5a5ULL, 0xa5a5a5a5a5a5a5a5ULL, },
+ { 0x8383838383838383ULL, 0x8383838383838383ULL, },
+ { 0x7272727272727272ULL, 0x7272727272727272ULL, },
+ { 0x1616161616161616ULL, 0x1616161616161616ULL, },
+ { 0x3f3f3f3f3f3f3f3fULL, 0x3f3f3f3f3f3f3f3fULL, },
+ { 0x7889677889677889ULL, 0x6778896778896778ULL, },
+ { 0x0c0c0c0c0c0c0c0cULL, 0x0c0c0c0c0c0c0c0cULL, },
+ { 0x297ed4297ed4297eULL, 0xd4297ed4297ed429ULL, }, /* 48 */
+ { 0x297ed4297ed4297eULL, 0xd4297ed4297ed429ULL, },
+ { 0xe7ca04e7ca04e7caULL, 0x04e7ca04e7ca04e7ULL, },
+ { 0x46f09c46f09c46f0ULL, 0x9c46f09c46f09c46ULL, },
+ { 0x2a183c2a183c2a18ULL, 0x3c2a183c2a183c2aULL, },
+ { 0x6362646362646362ULL, 0x6463626463626463ULL, },
+ { 0xac26a4ac26a4ac26ULL, 0xa4ac26a4ac26a4acULL, },
+ { 0x80d42c80d42c80d4ULL, 0x2c80d42c80d42c80ULL, },
+ { 0x6463656463656463ULL, 0x6564636564636564ULL, }, /* 56 */
+ { 0x6463656463656463ULL, 0x6564636564636564ULL, },
+ { 0xfc6d8bfc6d8bfc6dULL, 0x8bfc6d8bfc6d8bfcULL, },
+ { 0x48f29e48f29e48f2ULL, 0x9e48f29e48f29e48ULL, },
+ { 0x98fe3298fe3298feULL, 0x3298fe3298fe3298ULL, },
+ { 0x2c81d72c81d72c81ULL, 0xd72c81d72c81d72cULL, },
+ { 0x002f5f002f5f002fULL, 0x5f002f5f002f5f00ULL, },
+ { 0x1010101010101010ULL, 0x1010101010101010ULL, },
+ { 0x50f4b4a050944910ULL, 0x09818994142910a0ULL, }, /* 64 */
+ { 0xa8a0b48458da5c10ULL, 0x4fe29220ea6e7070ULL, },
+ { 0x08e408fc40188310ULL, 0xbcca14c29417e060ULL, },
+ { 0x889acc58f0da8d90ULL, 0x0bc1ec1242cd40e0ULL, },
+ { 0xe046cc3cf820a090ULL, 0x5122f59e1812a0b0ULL, },
+ { 0xf94acc85218951d0ULL, 0x95738e42d193e4c0ULL, },
+ { 0x9d16cc43c6665ed0ULL, 0x53db3028d828be70ULL, },
+ { 0x6db8cc0a0c890c40ULL, 0x3d628818b56622f0ULL, },
+ { 0xcdfc2082f4c73340ULL, 0xaa4a0aba5f0f92e0ULL, }, /* 72 */
+ { 0x71c8204099a44040ULL, 0x68b2aca066a46c90ULL, },
+ { 0x016c64244a05b940ULL, 0x59f2d0a19fddc520ULL, },
+ { 0x4132584638a46f40ULL, 0xd44a00c982f36fa0ULL, },
+ { 0xc1e81ca2e86679c0ULL, 0x2341d81930a9cf20ULL, },
+ { 0x918a1c692e892730ULL, 0x0dc830090de733a0ULL, },
+ { 0xd150108b1c28dd30ULL, 0x88206031f0fddd20ULL, },
+ { 0xd1b1f4b4a08961f4ULL, 0x3101a07181016120ULL, },
+ { 0xd9fb2c24a0fb96f4ULL, 0x8c6880ef7f7c11a0ULL, }, /* 80 */
+ { 0x9c452c10c01c3094ULL, 0x64c00035ea008320ULL, },
+ { 0x6c8714b080c04094ULL, 0xa0c00000380072a0ULL, },
+ { 0xac30cca08080c0acULL, 0xc0800000300016a0ULL, },
+ { 0x0c101420808080acULL, 0x00000000d0003620ULL, },
+ { 0xd0f014800000000cULL, 0x00000000e00082a0ULL, },
+ { 0x9050ac800000000cULL, 0x0000000080004c20ULL, },
+ { 0x90007400000000b4ULL, 0x0000000000006420ULL, },
+ { 0x1000ac00000000b4ULL, 0x00000000000024a0ULL, }, /* 88 */
+ { 0xc000ac0000000054ULL, 0x000000000000ac20ULL, },
+ { 0xc000940000000054ULL, 0x00000000000088a0ULL, },
+ { 0xc0004c00000000ecULL, 0x00000000000098a0ULL, },
+ { 0xc0009400000000ecULL, 0x0000000000001820ULL, },
+ { 0x000094000000004cULL, 0x000000000000c8a0ULL, },
+ { 0x00002c000000004cULL, 0x000000000000b020ULL, },
+ { 0x0000f40000000074ULL, 0x0000000000001020ULL, },
+ { 0x00002c0000000074ULL, 0x00000000000010a0ULL, }, /* 96 */
+ { 0x0000b40000000074ULL, 0x0000000000001020ULL, },
+ { 0x00006c0000000074ULL, 0x00000000000010a0ULL, },
+ { 0x0000740000000074ULL, 0x0000000000001020ULL, },
+ { 0x0000740000000014ULL, 0x00000000000030a0ULL, },
+ { 0x00007400000000b4ULL, 0x0000000000009020ULL, },
+ { 0x0000740000000054ULL, 0x000000000000b0a0ULL, },
+ { 0x00007400000000f4ULL, 0x0000000000001020ULL, },
+ { 0x00004c00000000f4ULL, 0x00000000000060a0ULL, }, /* 104 */
+ { 0x0000f400000000f4ULL, 0x0000000000004020ULL, },
+ { 0x0000cc00000000f4ULL, 0x00000000000080a0ULL, },
+ { 0x00007400000000f4ULL, 0x0000000000000020ULL, },
+ { 0x00006c000000004cULL, 0x0000000000000020ULL, },
+ { 0x0000b40000000074ULL, 0x0000000000000020ULL, },
+ { 0x00002c00000000ccULL, 0x0000000000000020ULL, },
+ { 0x0000f400000000f4ULL, 0x0000000000000020ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_d.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_d.c
new file mode 100644
index 0000000000..fda35f757b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MADDV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MADDV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x5555555555555557ULL, 0x5555555555555557ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, },
+ { 0x3333333333333336ULL, 0x3333333333333336ULL, },
+ { 0x0000000000000003ULL, 0x0000000000000003ULL, },
+ { 0x1c71c71c71c71c75ULL, 0xc71c71c71c71c720ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, }, /* 8 */
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x0000000000000004ULL, 0x0000000000000004ULL, },
+ { 0x555555555555555aULL, 0x555555555555555aULL, }, /* 16 */
+ { 0x555555555555555aULL, 0x555555555555555aULL, },
+ { 0x8e38e38e38e38e3eULL, 0x8e38e38e38e38e3eULL, },
+ { 0xaaaaaaaaaaaaaab0ULL, 0xaaaaaaaaaaaaaab0ULL, },
+ { 0x2222222222222228ULL, 0x2222222222222228ULL, },
+ { 0x0000000000000006ULL, 0x0000000000000006ULL, },
+ { 0x12f684bda12f6852ULL, 0x2f684bda12f684c4ULL, },
+ { 0x555555555555555cULL, 0x555555555555555cULL, },
+ { 0x0000000000000007ULL, 0x0000000000000007ULL, }, /* 24 */
+ { 0x0000000000000007ULL, 0x0000000000000007ULL, },
+ { 0x1c71c71c71c71c79ULL, 0x1c71c71c71c71c79ULL, },
+ { 0xaaaaaaaaaaaaaab2ULL, 0xaaaaaaaaaaaaaab2ULL, },
+ { 0x666666666666666eULL, 0x666666666666666eULL, },
+ { 0x555555555555555dULL, 0x555555555555555dULL, },
+ { 0x5ed097b425ed0983ULL, 0xed097b425ed097bcULL, },
+ { 0x0000000000000008ULL, 0x0000000000000008ULL, },
+ { 0x333333333333333cULL, 0x333333333333333cULL, }, /* 32 */
+ { 0x333333333333333cULL, 0x333333333333333cULL, },
+ { 0xaaaaaaaaaaaaaab4ULL, 0xaaaaaaaaaaaaaab4ULL, },
+ { 0x6666666666666670ULL, 0x6666666666666670ULL, },
+ { 0x5c28f5c28f5c2900ULL, 0x5c28f5c28f5c2900ULL, },
+ { 0x99999999999999a4ULL, 0x99999999999999a4ULL, },
+ { 0x16c16c16c16c16ccULL, 0xd27d27d27d27d288ULL, },
+ { 0xccccccccccccccd8ULL, 0xccccccccccccccd8ULL, },
+ { 0x99999999999999a5ULL, 0x99999999999999a5ULL, }, /* 40 */
+ { 0x99999999999999a5ULL, 0x99999999999999a5ULL, },
+ { 0x7777777777777783ULL, 0x7777777777777783ULL, },
+ { 0x6666666666666672ULL, 0x6666666666666672ULL, },
+ { 0xa3d70a3d70a3d716ULL, 0xa3d70a3d70a3d716ULL, },
+ { 0x333333333333333fULL, 0x333333333333333fULL, },
+ { 0xd27d27d27d27d289ULL, 0xc16c16c16c16c178ULL, },
+ { 0x000000000000000cULL, 0x000000000000000cULL, },
+ { 0x1c71c71c71c71c7eULL, 0xc71c71c71c71c729ULL, }, /* 48 */
+ { 0x1c71c71c71c71c7eULL, 0xc71c71c71c71c729ULL, },
+ { 0x2f684bda12f684caULL, 0xf684bda12f684be7ULL, },
+ { 0x38e38e38e38e38f0ULL, 0x8e38e38e38e38e46ULL, },
+ { 0xb60b60b60b60b618ULL, 0xc71c71c71c71c72aULL, },
+ { 0x5555555555555562ULL, 0x5555555555555563ULL, },
+ { 0x06522c3f35ba7826ULL, 0xa781948b0fcd6eacULL, },
+ { 0x71c71c71c71c71d4ULL, 0x1c71c71c71c71c80ULL, },
+ { 0x5555555555555563ULL, 0x5555555555555564ULL, }, /* 56 */
+ { 0x5555555555555563ULL, 0x5555555555555564ULL, },
+ { 0x97b425ed097b426dULL, 0x7b425ed097b425fcULL, },
+ { 0x38e38e38e38e38f2ULL, 0x8e38e38e38e38e48ULL, },
+ { 0xeeeeeeeeeeeeeefeULL, 0x8888888888888898ULL, },
+ { 0x1c71c71c71c71c81ULL, 0xc71c71c71c71c72cULL, },
+ { 0x87e6b74f0329162fULL, 0x3c0ca4587e6b7500ULL, },
+ { 0x0000000000000010ULL, 0x0000000000000010ULL, },
+ { 0xad45be6961639010ULL, 0x3297fdea749880a0ULL, }, /* 64 */
+ { 0x9ced640a487afa10ULL, 0xeaa90809e3b1a470ULL, },
+ { 0xa5b377aa0caf5a10ULL, 0x95c9a7903bd12160ULL, },
+ { 0xa194ffe4fb27d390ULL, 0x17e6ccd3c9a1c0e0ULL, },
+ { 0x913ca585e23f3d90ULL, 0xcff7d6f338bae4b0ULL, },
+ { 0xc8ead0bee02cadd0ULL, 0x381c4d6a83a94cc0ULL, },
+ { 0x33b60e279e9989d0ULL, 0xe7f71f9b97ee3470ULL, },
+ { 0x217580abbfdd3e40ULL, 0x6779436687bc89f0ULL, },
+ { 0x2a3b944b84119e40ULL, 0x1299e2ecdfdc06e0ULL, }, /* 72 */
+ { 0x9506d1b4427e7a40ULL, 0xc274b51df420ee90ULL, },
+ { 0x1b2bb7962782ba40ULL, 0x9bf62dc42637b820ULL, },
+ { 0x91d16316b1663b40ULL, 0x3cf7c824fb128ca0ULL, },
+ { 0x8db2eb519fdeb4c0ULL, 0xbf14ed6888e32c20ULL, },
+ { 0x7b725dd5c1226930ULL, 0x3e97113378b181a0ULL, },
+ { 0xf21809564b05ea30ULL, 0xdf98ab944d8c5620ULL, },
+ { 0x3dcc402bfcefb9f4ULL, 0xf26a7a4530ab3a20ULL, },
+ { 0x81a8956a21043af4ULL, 0xe63ec4a9de07f3a0ULL, }, /* 80 */
+ { 0x14acc7eab115be94ULL, 0xa72fae300e450520ULL, },
+ { 0x4c5c3900181b6494ULL, 0xc26796e561c70ba0ULL, },
+ { 0x513451003792b1acULL, 0x5acad191d5b18fa0ULL, },
+ { 0x0daff27cb51538acULL, 0x31375ce2aea24b20ULL, },
+ { 0xbb9ebee52390b20cULL, 0xd8cfb350af547ea0ULL, },
+ { 0x4df25269204a3c0cULL, 0x07b9241bbd1b8320ULL, },
+ { 0x39b3c4d066371fb4ULL, 0x2a4dc00c264fb720ULL, },
+ { 0xf9aee458846dd0b4ULL, 0x79d838b37c524ca0ULL, }, /* 88 */
+ { 0x115f9e7f00744254ULL, 0x46ec87fe3540fa20ULL, },
+ { 0xb01458f6b0850854ULL, 0xde82246a25db24a0ULL, },
+ { 0xc18097bf5a7bb9ecULL, 0x4155f0da566748a0ULL, },
+ { 0x70c7391b1a7d90ecULL, 0x0400deec0a0cb020ULL, },
+ { 0xf7a41980bd958c4cULL, 0xedfeb14ff6d44fa0ULL, },
+ { 0x7906f19718fcf64cULL, 0x29e471752ecca820ULL, },
+ { 0xb6393967140b1974ULL, 0xbd0ed4c39361fc20ULL, },
+ { 0x74ecb57da4acfa74ULL, 0x36ea3f3dbcafcda0ULL, }, /* 96 */
+ { 0x5b14aa5e3f7c1b74ULL, 0xeb031f17fe2b7120ULL, },
+ { 0x0468573ef6087c74ULL, 0xe8ef35d2e05abea0ULL, },
+ { 0xd69cf5cf0de21d74ULL, 0x39f569701e89ae20ULL, },
+ { 0xf233f7a10f743514ULL, 0xf574fc00c1b755a0ULL, },
+ { 0x873c421a5ed469b4ULL, 0x96f393305dfcdf20ULL, },
+ { 0x17e80b0449fea354ULL, 0x2f05ddb06b40c2a0ULL, },
+ { 0x0741f67f982609f4ULL, 0x9c23f2dbc2b79820ULL, },
+ { 0x530275e3b2de7ff4ULL, 0xc6904e7f6f6c1aa0ULL, }, /* 104 */
+ { 0xf8214644bbe3f5f4ULL, 0xe44a0de01c974f20ULL, },
+ { 0xb59c90c0a8b66bf4ULL, 0x9abcf7a8e1391da0ULL, },
+ { 0xb67d543caed5e1f4ULL, 0x4ce8f72994d78e20ULL, },
+ { 0xcee67f5e9d2e224cULL, 0xba31bdf2ab48a220ULL, },
+ { 0x87acb43db40fad74ULL, 0x8a259794c40e3620ULL, },
+ { 0x45c27495332aeeccULL, 0xe81c4208ecf84a20ULL, },
+ { 0x50a99b794e1bc8f4ULL, 0x17cdf4c275d6de20ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_h.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_h.c
new file mode 100644
index 0000000000..a9ee9b328a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MADDV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MADDV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x5557555755575557ULL, 0x5557555755575557ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, },
+ { 0x3336333633363336ULL, 0x3336333633363336ULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x1c75c72071cb1c75ULL, 0xc72071cb1c75c720ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, }, /* 8 */
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x0004000400040004ULL, 0x0004000400040004ULL, },
+ { 0x555a555a555a555aULL, 0x555a555a555a555aULL, }, /* 16 */
+ { 0x555a555a555a555aULL, 0x555a555a555a555aULL, },
+ { 0x8e3e8e3e8e3e8e3eULL, 0x8e3e8e3e8e3e8e3eULL, },
+ { 0xaab0aab0aab0aab0ULL, 0xaab0aab0aab0aab0ULL, },
+ { 0x2228222822282228ULL, 0x2228222822282228ULL, },
+ { 0x0006000600060006ULL, 0x0006000600060006ULL, },
+ { 0x685284c4a1366852ULL, 0x84c4a136685284c4ULL, },
+ { 0x555c555c555c555cULL, 0x555c555c555c555cULL, },
+ { 0x0007000700070007ULL, 0x0007000700070007ULL, }, /* 24 */
+ { 0x0007000700070007ULL, 0x0007000700070007ULL, },
+ { 0x1c791c791c791c79ULL, 0x1c791c791c791c79ULL, },
+ { 0xaab2aab2aab2aab2ULL, 0xaab2aab2aab2aab2ULL, },
+ { 0x666e666e666e666eULL, 0x666e666e666e666eULL, },
+ { 0x555d555d555d555dULL, 0x555d555d555d555dULL, },
+ { 0x098397bc25f50983ULL, 0x97bc25f5098397bcULL, },
+ { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+ { 0x333c333c333c333cULL, 0x333c333c333c333cULL, }, /* 32 */
+ { 0x333c333c333c333cULL, 0x333c333c333c333cULL, },
+ { 0xaab4aab4aab4aab4ULL, 0xaab4aab4aab4aab4ULL, },
+ { 0x6670667066706670ULL, 0x6670667066706670ULL, },
+ { 0x2900290029002900ULL, 0x2900290029002900ULL, },
+ { 0x99a499a499a499a4ULL, 0x99a499a499a499a4ULL, },
+ { 0x16ccd2888e4416ccULL, 0xd2888e4416ccd288ULL, },
+ { 0xccd8ccd8ccd8ccd8ULL, 0xccd8ccd8ccd8ccd8ULL, },
+ { 0x99a599a599a599a5ULL, 0x99a599a599a599a5ULL, }, /* 40 */
+ { 0x99a599a599a599a5ULL, 0x99a599a599a599a5ULL, },
+ { 0x7783778377837783ULL, 0x7783778377837783ULL, },
+ { 0x6672667266726672ULL, 0x6672667266726672ULL, },
+ { 0xd716d716d716d716ULL, 0xd716d716d716d716ULL, },
+ { 0x333f333f333f333fULL, 0x333f333f333f333fULL, },
+ { 0xd289c178b067d289ULL, 0xc178b067d289c178ULL, },
+ { 0x000c000c000c000cULL, 0x000c000c000c000cULL, },
+ { 0x1c7ec72971d41c7eULL, 0xc72971d41c7ec729ULL, }, /* 48 */
+ { 0x1c7ec72971d41c7eULL, 0xc72971d41c7ec729ULL, },
+ { 0x84ca4be7130484caULL, 0x4be7130484ca4be7ULL, },
+ { 0x38f08e46e39c38f0ULL, 0x8e46e39c38f08e46ULL, },
+ { 0xb618c72ad83cb618ULL, 0xc72ad83cb618c72aULL, },
+ { 0x5562556355645562ULL, 0x5563556455625563ULL, },
+ { 0x78266eac81a47826ULL, 0x6eac81a478266eacULL, },
+ { 0x71d41c80c72c71d4ULL, 0x1c80c72c71d41c80ULL, },
+ { 0x5563556455655563ULL, 0x5564556555635564ULL, }, /* 56 */
+ { 0x5563556455655563ULL, 0x5564556555635564ULL, },
+ { 0x426d25fc098b426dULL, 0x25fc098b426d25fcULL, },
+ { 0x38f28e48e39e38f2ULL, 0x8e48e39e38f28e48ULL, },
+ { 0xeefe88982232eefeULL, 0x88982232eefe8898ULL, },
+ { 0x1c81c72c71d71c81ULL, 0xc72c71d71c81c72cULL, },
+ { 0x162f7500b75f162fULL, 0x7500b75f162f7500ULL, },
+ { 0x0010001000100010ULL, 0x0010001000100010ULL, },
+ { 0xcbf432a0c5949010ULL, 0x838136944f2980a0ULL, }, /* 64 */
+ { 0xf8a073846fdafa10ULL, 0x81e20820066ea470ULL, },
+ { 0x25e45efce9185a10ULL, 0xd1ca0ec2ee172160ULL, },
+ { 0x9e9a52589fdad390ULL, 0x88c19612bccdc0e0ULL, },
+ { 0xcb46933c4a203d90ULL, 0x8722679e7412e4b0ULL, },
+ { 0xec4ab9850c89add0ULL, 0x31736642d9934cc0ULL, },
+ { 0x15164543016689d0ULL, 0xd2dbe12880283470ULL, },
+ { 0xe4b8e50ad4893e40ULL, 0xb8628f18916689f0ULL, },
+ { 0x11fcd0824dc79e40ULL, 0x084a95ba790f06e0ULL, }, /* 72 */
+ { 0x3ac85c4042a47a40ULL, 0xa9b210a01fa4ee90ULL, },
+ { 0x4a6ce5241805ba40ULL, 0x2ff282a198ddb820ULL, },
+ { 0xda320a46aaa43b40ULL, 0xaa4ae1c91cf38ca0ULL, },
+ { 0x52e8fda26166b4c0ULL, 0x61416919eba92c20ULL, },
+ { 0x228a9d6934896930ULL, 0x46c81709fce781a0ULL, },
+ { 0xb250c28bc728ea30ULL, 0xc120763180fd5620ULL, },
+ { 0xeab115b4cc89b9f4ULL, 0x1e01ac71b6013a20ULL, },
+ { 0x1ffb192480fb3af4ULL, 0x7b68d8ef267cf3a0ULL, }, /* 80 */
+ { 0xf545d210101cbe94ULL, 0xdcc07635cb000520ULL, },
+ { 0x8b8730b052c06494ULL, 0x5ec03300e4000ba0ULL, },
+ { 0xaa30f5a0a980b1acULL, 0x51803b00ac008fa0ULL, },
+ { 0xa21071208c8038acULL, 0x9c00e50050004b20ULL, },
+ { 0x99f03080ba00b20cULL, 0x2000270000007ea0ULL, },
+ { 0xf850658020003c0cULL, 0x2000000000008320ULL, },
+ { 0x9900ed0040001fb4ULL, 0x400000000000b720ULL, },
+ { 0xf300c900c000d0b4ULL, 0x0000000000004ca0ULL, }, /* 88 */
+ { 0x4d00840000004254ULL, 0x000000000000fa20ULL, },
+ { 0x5f002c0000000854ULL, 0x00000000000024a0ULL, },
+ { 0xb00068000000b9ecULL, 0x00000000000048a0ULL, },
+ { 0x90004800000090ecULL, 0x000000000000b020ULL, },
+ { 0x7000200000008c4cULL, 0x0000000000004fa0ULL, },
+ { 0xd00060000000f64cULL, 0x000000000000a820ULL, },
+ { 0x0000400000001974ULL, 0x000000000000fc20ULL, },
+ { 0x000040000000fa74ULL, 0x000000000000cda0ULL, }, /* 96 */
+ { 0x0000400000001b74ULL, 0x0000000000007120ULL, },
+ { 0x0000400000007c74ULL, 0x000000000000bea0ULL, },
+ { 0x0000400000001d74ULL, 0x000000000000ae20ULL, },
+ { 0x0000000000003514ULL, 0x00000000000055a0ULL, },
+ { 0x00000000000069b4ULL, 0x000000000000df20ULL, },
+ { 0x000000000000a354ULL, 0x000000000000c2a0ULL, },
+ { 0x00000000000009f4ULL, 0x0000000000009820ULL, },
+ { 0x0000000000007ff4ULL, 0x0000000000001aa0ULL, }, /* 104 */
+ { 0x000000000000f5f4ULL, 0x0000000000004f20ULL, },
+ { 0x0000000000006bf4ULL, 0x0000000000001da0ULL, },
+ { 0x000000000000e1f4ULL, 0x0000000000008e20ULL, },
+ { 0x000000000000224cULL, 0x000000000000a220ULL, },
+ { 0x000000000000ad74ULL, 0x0000000000003620ULL, },
+ { 0x000000000000eeccULL, 0x0000000000004a20ULL, },
+ { 0x000000000000c8f4ULL, 0x000000000000de20ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_w.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_w.c
new file mode 100644
index 0000000000..bc3f5d246e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_maddv_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MADDV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MADDV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x5555555755555557ULL, 0x5555555755555557ULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, },
+ { 0x3333333633333336ULL, 0x3333333633333336ULL, },
+ { 0x0000000300000003ULL, 0x0000000300000003ULL, },
+ { 0x1c71c72071c71c75ULL, 0xc71c71cb1c71c720ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, }, /* 8 */
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x0000000400000004ULL, 0x0000000400000004ULL, },
+ { 0x5555555a5555555aULL, 0x5555555a5555555aULL, }, /* 16 */
+ { 0x5555555a5555555aULL, 0x5555555a5555555aULL, },
+ { 0x38e38e3e38e38e3eULL, 0x38e38e3e38e38e3eULL, },
+ { 0xaaaaaab0aaaaaab0ULL, 0xaaaaaab0aaaaaab0ULL, },
+ { 0x2222222822222228ULL, 0x2222222822222228ULL, },
+ { 0x0000000600000006ULL, 0x0000000600000006ULL, },
+ { 0x12f684c4a12f6852ULL, 0x84bda13612f684c4ULL, },
+ { 0x5555555c5555555cULL, 0x5555555c5555555cULL, },
+ { 0x0000000700000007ULL, 0x0000000700000007ULL, }, /* 24 */
+ { 0x0000000700000007ULL, 0x0000000700000007ULL, },
+ { 0x71c71c7971c71c79ULL, 0x71c71c7971c71c79ULL, },
+ { 0xaaaaaab2aaaaaab2ULL, 0xaaaaaab2aaaaaab2ULL, },
+ { 0x6666666e6666666eULL, 0x6666666e6666666eULL, },
+ { 0x5555555d5555555dULL, 0x5555555d5555555dULL, },
+ { 0x5ed097bc25ed0983ULL, 0x97b425f55ed097bcULL, },
+ { 0x0000000800000008ULL, 0x0000000800000008ULL, },
+ { 0x3333333c3333333cULL, 0x3333333c3333333cULL, }, /* 32 */
+ { 0x3333333c3333333cULL, 0x3333333c3333333cULL, },
+ { 0xaaaaaab4aaaaaab4ULL, 0xaaaaaab4aaaaaab4ULL, },
+ { 0x6666667066666670ULL, 0x6666667066666670ULL, },
+ { 0x8f5c29008f5c2900ULL, 0x8f5c29008f5c2900ULL, },
+ { 0x999999a4999999a4ULL, 0x999999a4999999a4ULL, },
+ { 0x7d27d288c16c16ccULL, 0x38e38e447d27d288ULL, },
+ { 0xccccccd8ccccccd8ULL, 0xccccccd8ccccccd8ULL, },
+ { 0x999999a5999999a5ULL, 0x999999a5999999a5ULL, }, /* 40 */
+ { 0x999999a5999999a5ULL, 0x999999a5999999a5ULL, },
+ { 0x7777778377777783ULL, 0x7777778377777783ULL, },
+ { 0x6666667266666672ULL, 0x6666667266666672ULL, },
+ { 0x70a3d71670a3d716ULL, 0x70a3d71670a3d716ULL, },
+ { 0x3333333f3333333fULL, 0x3333333f3333333fULL, },
+ { 0x6c16c1787d27d289ULL, 0x5b05b0676c16c178ULL, },
+ { 0x0000000c0000000cULL, 0x0000000c0000000cULL, },
+ { 0x1c71c72971c71c7eULL, 0xc71c71d41c71c729ULL, }, /* 48 */
+ { 0x1c71c72971c71c7eULL, 0xc71c71d41c71c729ULL, },
+ { 0x2f684be712f684caULL, 0x4bda13042f684be7ULL, },
+ { 0x38e38e46e38e38f0ULL, 0x8e38e39c38e38e46ULL, },
+ { 0x1c71c72a0b60b618ULL, 0x2d82d83c1c71c72aULL, },
+ { 0x5555556355555562ULL, 0x5555556455555563ULL, },
+ { 0x0fcd6eac35ba7826ULL, 0x5ba781a40fcd6eacULL, },
+ { 0x71c71c80c71c71d4ULL, 0x1c71c72c71c71c80ULL, },
+ { 0x5555556455555563ULL, 0x5555556555555564ULL, }, /* 56 */
+ { 0x5555556455555563ULL, 0x5555556555555564ULL, },
+ { 0x97b425fc097b426dULL, 0x25ed098b97b425fcULL, },
+ { 0x38e38e48e38e38f2ULL, 0x8e38e39e38e38e48ULL, },
+ { 0x88888898eeeeeefeULL, 0x2222223288888898ULL, },
+ { 0x1c71c72c71c71c81ULL, 0xc71c71d71c71c72cULL, },
+ { 0x7e6b75000329162fULL, 0x87e6b75f7e6b7500ULL, },
+ { 0x0000001000000010ULL, 0x0000001000000010ULL, },
+ { 0xb10332a061639010ULL, 0x3a253694749880a0ULL, }, /* 64 */
+ { 0xc1c27384487afa10ULL, 0xbb9c0820e3b1a470ULL, },
+ { 0x35565efc0caf5a10ULL, 0x735b0ec23bd12160ULL, },
+ { 0xe6475258fb27d390ULL, 0x49d49612c9a1c0e0ULL, },
+ { 0xf706933ce23f3d90ULL, 0xcb4b679e38bae4b0ULL, },
+ { 0xabfab985e02cadd0ULL, 0x0836664283a94cc0ULL, },
+ { 0xa33845439e9989d0ULL, 0x5b9fe12897ee3470ULL, },
+ { 0x1df3e50abfdd3e40ULL, 0x6d858f1887bc89f0ULL, },
+ { 0x9187d08284119e40ULL, 0x254495badfdc06e0ULL, }, /* 72 */
+ { 0x88c55c40427e7a40ULL, 0x78ae10a0f420ee90ULL, },
+ { 0x3f78e5242782ba40ULL, 0x93ad82a12637b820ULL, },
+ { 0x28380a46b1663b40ULL, 0x255be1c9fb128ca0ULL, },
+ { 0xd928fda29fdeb4c0ULL, 0xfbd5691988e32c20ULL, },
+ { 0x53e49d69c1226930ULL, 0x0dbb170978b181a0ULL, },
+ { 0x3ca3c28b4b05ea30ULL, 0x9f6976314d8c5620ULL, },
+ { 0x621b15b4fcefb9f4ULL, 0x7f3fac7130ab3a20ULL, },
+ { 0x81b8192421043af4ULL, 0x7180d8efde07f3a0ULL, }, /* 80 */
+ { 0xa0a1d210b115be94ULL, 0x33a676350e450520ULL, },
+ { 0xe27e30b0181b6494ULL, 0x359b330061c70ba0ULL, },
+ { 0xe0f1f5a03792b1acULL, 0xe6a63b00d5b18fa0ULL, },
+ { 0x38af7120b51538acULL, 0x7938e500aea24b20ULL, },
+ { 0x7a4830802390b20cULL, 0x4b472700af547ea0ULL, },
+ { 0xcc2f6580204a3c0cULL, 0x37510000bd1b8320ULL, },
+ { 0x9ba9ed0066371fb4ULL, 0xeba90000264fb720ULL, },
+ { 0x7400c900846dd0b4ULL, 0xb6b700007c524ca0ULL, }, /* 88 */
+ { 0x7e4e840000744254ULL, 0xf24d00003540fa20ULL, },
+ { 0x242a2c00b0850854ULL, 0xdb00000025db24a0ULL, },
+ { 0x38a168005a7bb9ecULL, 0xa3000000566748a0ULL, },
+ { 0x6cb048001a7d90ecULL, 0x7d0000000a0cb020ULL, },
+ { 0xe4dc2000bd958c4cULL, 0x2f000000f6d44fa0ULL, },
+ { 0xbcc9600018fcf64cULL, 0x000000002ecca820ULL, },
+ { 0x739b4000140b1974ULL, 0x000000009361fc20ULL, },
+ { 0x8ed24000a4acfa74ULL, 0x00000000bcafcda0ULL, }, /* 96 */
+ { 0xc3dd40003f7c1b74ULL, 0x00000000fe2b7120ULL, },
+ { 0x1fac4000f6087c74ULL, 0x00000000e05abea0ULL, },
+ { 0x9e6f40000de21d74ULL, 0x000000001e89ae20ULL, },
+ { 0x637500000f743514ULL, 0x00000000c1b755a0ULL, },
+ { 0xd9b400005ed469b4ULL, 0x000000005dfcdf20ULL, },
+ { 0x0a50000049fea354ULL, 0x000000006b40c2a0ULL, },
+ { 0x07400000982609f4ULL, 0x00000000c2b79820ULL, },
+ { 0x57c00000b2de7ff4ULL, 0x000000006f6c1aa0ULL, }, /* 104 */
+ { 0x1d400000bbe3f5f4ULL, 0x000000001c974f20ULL, },
+ { 0x09c00000a8b66bf4ULL, 0x00000000e1391da0ULL, },
+ { 0x03400000aed5e1f4ULL, 0x0000000094d78e20ULL, },
+ { 0x7d8000009d2e224cULL, 0x00000000ab48a220ULL, },
+ { 0x3d000000b40fad74ULL, 0x00000000c40e3620ULL, },
+ { 0x96000000332aeeccULL, 0x00000000ecf84a20ULL, },
+ { 0xb40000004e1bc8f4ULL, 0x0000000075d6de20ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MADDV_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_b.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_b.c
new file mode 100644
index 0000000000..808c49d050
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MSUBV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MSUBV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xa9a9a9a9a9a9a9a9ULL, 0xa9a9a9a9a9a9a9a9ULL, },
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, },
+ { 0xcacacacacacacacaULL, 0xcacacacacacacacaULL, },
+ { 0xfdfdfdfdfdfdfdfdULL, 0xfdfdfdfdfdfdfdfdULL, },
+ { 0xe08b35e08b35e08bULL, 0x35e08b35e08b35e0ULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, }, /* 8 */
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xa6a6a6a6a6a6a6a6ULL, 0xa6a6a6a6a6a6a6a6ULL, }, /* 16 */
+ { 0xa6a6a6a6a6a6a6a6ULL, 0xa6a6a6a6a6a6a6a6ULL, },
+ { 0xc2c2c2c2c2c2c2c2ULL, 0xc2c2c2c2c2c2c2c2ULL, },
+ { 0x5050505050505050ULL, 0x5050505050505050ULL, },
+ { 0xd8d8d8d8d8d8d8d8ULL, 0xd8d8d8d8d8d8d8d8ULL, },
+ { 0xfafafafafafafafaULL, 0xfafafafafafafafaULL, },
+ { 0x3caeca3caeca3caeULL, 0xca3caeca3caeca3cULL, },
+ { 0xa4a4a4a4a4a4a4a4ULL, 0xa4a4a4a4a4a4a4a4ULL, },
+ { 0xf9f9f9f9f9f9f9f9ULL, 0xf9f9f9f9f9f9f9f9ULL, }, /* 24 */
+ { 0xf9f9f9f9f9f9f9f9ULL, 0xf9f9f9f9f9f9f9f9ULL, },
+ { 0x8787878787878787ULL, 0x8787878787878787ULL, },
+ { 0x4e4e4e4e4e4e4e4eULL, 0x4e4e4e4e4e4e4e4eULL, },
+ { 0x9292929292929292ULL, 0x9292929292929292ULL, },
+ { 0xa3a3a3a3a3a3a3a3ULL, 0xa3a3a3a3a3a3a3a3ULL, },
+ { 0x447d0b447d0b447dULL, 0x0b447d0b447d0b44ULL, },
+ { 0xf8f8f8f8f8f8f8f8ULL, 0xf8f8f8f8f8f8f8f8ULL, },
+ { 0xc4c4c4c4c4c4c4c4ULL, 0xc4c4c4c4c4c4c4c4ULL, }, /* 32 */
+ { 0xc4c4c4c4c4c4c4c4ULL, 0xc4c4c4c4c4c4c4c4ULL, },
+ { 0x4c4c4c4c4c4c4c4cULL, 0x4c4c4c4c4c4c4c4cULL, },
+ { 0x9090909090909090ULL, 0x9090909090909090ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5c5c5c5c5c5c5c5cULL, 0x5c5c5c5c5c5c5c5cULL, },
+ { 0x7834bc7834bc7834ULL, 0xbc7834bc7834bc78ULL, },
+ { 0x2828282828282828ULL, 0x2828282828282828ULL, },
+ { 0x5b5b5b5b5b5b5b5bULL, 0x5b5b5b5b5b5b5b5bULL, }, /* 40 */
+ { 0x5b5b5b5b5b5b5b5bULL, 0x5b5b5b5b5b5b5b5bULL, },
+ { 0x7d7d7d7d7d7d7d7dULL, 0x7d7d7d7d7d7d7d7dULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0xeaeaeaeaeaeaeaeaULL, 0xeaeaeaeaeaeaeaeaULL, },
+ { 0xc1c1c1c1c1c1c1c1ULL, 0xc1c1c1c1c1c1c1c1ULL, },
+ { 0x8877998877998877ULL, 0x9988779988779988ULL, },
+ { 0xf4f4f4f4f4f4f4f4ULL, 0xf4f4f4f4f4f4f4f4ULL, },
+ { 0xd7822cd7822cd782ULL, 0x2cd7822cd7822cd7ULL, }, /* 48 */
+ { 0xd7822cd7822cd782ULL, 0x2cd7822cd7822cd7ULL, },
+ { 0x1936fc1936fc1936ULL, 0xfc1936fc1936fc19ULL, },
+ { 0xba1064ba1064ba10ULL, 0x64ba1064ba1064baULL, },
+ { 0xd6e8c4d6e8c4d6e8ULL, 0xc4d6e8c4d6e8c4d6ULL, },
+ { 0x9d9e9c9d9e9c9d9eULL, 0x9c9d9e9c9d9e9c9dULL, },
+ { 0x54da5c54da5c54daULL, 0x5c54da5c54da5c54ULL, },
+ { 0x802cd4802cd4802cULL, 0xd4802cd4802cd480ULL, },
+ { 0x9c9d9b9c9d9b9c9dULL, 0x9b9c9d9b9c9d9b9cULL, }, /* 56 */
+ { 0x9c9d9b9c9d9b9c9dULL, 0x9b9c9d9b9c9d9b9cULL, },
+ { 0x0493750493750493ULL, 0x7504937504937504ULL, },
+ { 0xb80e62b80e62b80eULL, 0x62b80e62b80e62b8ULL, },
+ { 0x6802ce6802ce6802ULL, 0xce6802ce6802ce68ULL, },
+ { 0xd47f29d47f29d47fULL, 0x29d47f29d47f29d4ULL, },
+ { 0x00d1a100d1a100d1ULL, 0xa100d1a100d1a100ULL, },
+ { 0xf0f0f0f0f0f0f0f0ULL, 0xf0f0f0f0f0f0f0f0ULL, },
+ { 0xb00c4c60b06cb7f0ULL, 0xf77f776cecd7f060ULL, }, /* 64 */
+ { 0x58604c7ca826a4f0ULL, 0xb11e6ee016929090ULL, },
+ { 0xf81cf804c0e87df0ULL, 0x4436ec3e6ce920a0ULL, },
+ { 0x786634a810267370ULL, 0xf53f14eebe33c020ULL, },
+ { 0x20ba34c408e06070ULL, 0xafde0b62e8ee6050ULL, },
+ { 0x07b6347bdf77af30ULL, 0x6b8d72be2f6d1c40ULL, },
+ { 0x63ea34bd3a9aa230ULL, 0xad25d0d828d84290ULL, },
+ { 0x934834f6f477f4c0ULL, 0xc39e78e84b9ade10ULL, },
+ { 0x3304e07e0c39cdc0ULL, 0x56b6f646a1f16e20ULL, }, /* 72 */
+ { 0x8f38e0c0675cc0c0ULL, 0x984e54609a5c9470ULL, },
+ { 0xff949cdcb6fb47c0ULL, 0xa70e305f61233be0ULL, },
+ { 0xbfcea8bac85c91c0ULL, 0x2cb600377e0d9160ULL, },
+ { 0x3f18e45e189a8740ULL, 0xddbf28e7d05731e0ULL, },
+ { 0x6f76e497d277d9d0ULL, 0xf338d0f7f319cd60ULL, },
+ { 0x2fb0f075e4d823d0ULL, 0x78e0a0cf100323e0ULL, },
+ { 0x2f4f0c4c60779f0cULL, 0xcfff608f7fff9fe0ULL, },
+ { 0x379944bc60e9d40cULL, 0x2a66400d7d7a4f60ULL, }, /* 80 */
+ { 0x4a0b4408801e08acULL, 0x36fc80bb3c7401e0ULL, },
+ { 0x922d0cb800dcb0acULL, 0xfc5c807628f8dc60ULL, },
+ { 0xb24a046000c05044ULL, 0x30c080e6c008a460ULL, },
+ { 0x22a66ce00040c044ULL, 0x208000724030e4e0ULL, },
+ { 0xcc726c4000808024ULL, 0xe00000de0060dc60ULL, },
+ { 0xbc5e04c000000024ULL, 0xc00000bc004010e0ULL, },
+ { 0x7c5cac000000002cULL, 0x0000001c00c0f0e0ULL, },
+ { 0x9c4424000000002cULL, 0x000000d40080f060ULL, }, /* 88 */
+ { 0xa8cc2400000000ccULL, 0x0000004c000010e0ULL, },
+ { 0xc814ac00000000ccULL, 0x000000980000c060ULL, },
+ { 0x48e8e400000000a4ULL, 0x0000005800004060ULL, },
+ { 0x08d80c00000000a4ULL, 0x00000008000040e0ULL, },
+ { 0x30880c0000000084ULL, 0x000000380000c060ULL, },
+ { 0xf0b8e40000000084ULL, 0x00000070000000e0ULL, },
+ { 0xf0f04c000000004cULL, 0x000000f0000000e0ULL, },
+ { 0x709004000000004cULL, 0x000000d000000060ULL, }, /* 96 */
+ { 0xf0f06c000000004cULL, 0x00000070000000e0ULL, },
+ { 0x709064000000004cULL, 0x0000005000000060ULL, },
+ { 0xf0f08c000000004cULL, 0x000000f0000000e0ULL, },
+ { 0xa0d08c00000000ecULL, 0x0000009000000060ULL, },
+ { 0xc0708c000000008cULL, 0x000000f0000000e0ULL, },
+ { 0x80508c000000002cULL, 0x0000009000000060ULL, },
+ { 0x00f08c00000000ccULL, 0x000000f0000000e0ULL, },
+ { 0x00906400000000ccULL, 0x000000e000000060ULL, }, /* 104 */
+ { 0x00f06c00000000ccULL, 0x000000c0000000e0ULL, },
+ { 0x00900400000000ccULL, 0x0000008000000060ULL, },
+ { 0x00f04c00000000ccULL, 0x00000000000000e0ULL, },
+ { 0x00e0c400000000a4ULL, 0x00000000000000e0ULL, },
+ { 0x00c0ec00000000acULL, 0x00000000000000e0ULL, },
+ { 0x0080a40000000044ULL, 0x00000000000000e0ULL, },
+ { 0x00008c000000008cULL, 0x00000000000000e0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_d.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_d.c
new file mode 100644
index 0000000000..9722dbd99f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MSUBV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MSUBV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaa9ULL, 0xaaaaaaaaaaaaaaa9ULL, },
+ { 0xfffffffffffffffeULL, 0xfffffffffffffffeULL, },
+ { 0xcccccccccccccccaULL, 0xcccccccccccccccaULL, },
+ { 0xfffffffffffffffdULL, 0xfffffffffffffffdULL, },
+ { 0xe38e38e38e38e38bULL, 0x38e38e38e38e38e0ULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, }, /* 8 */
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xfffffffffffffffcULL, 0xfffffffffffffffcULL, },
+ { 0xaaaaaaaaaaaaaaa6ULL, 0xaaaaaaaaaaaaaaa6ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaa6ULL, 0xaaaaaaaaaaaaaaa6ULL, },
+ { 0x71c71c71c71c71c2ULL, 0x71c71c71c71c71c2ULL, },
+ { 0x5555555555555550ULL, 0x5555555555555550ULL, },
+ { 0xddddddddddddddd8ULL, 0xddddddddddddddd8ULL, },
+ { 0xfffffffffffffffaULL, 0xfffffffffffffffaULL, },
+ { 0xed097b425ed097aeULL, 0xd097b425ed097b3cULL, },
+ { 0xaaaaaaaaaaaaaaa4ULL, 0xaaaaaaaaaaaaaaa4ULL, },
+ { 0xfffffffffffffff9ULL, 0xfffffffffffffff9ULL, }, /* 24 */
+ { 0xfffffffffffffff9ULL, 0xfffffffffffffff9ULL, },
+ { 0xe38e38e38e38e387ULL, 0xe38e38e38e38e387ULL, },
+ { 0x555555555555554eULL, 0x555555555555554eULL, },
+ { 0x9999999999999992ULL, 0x9999999999999992ULL, },
+ { 0xaaaaaaaaaaaaaaa3ULL, 0xaaaaaaaaaaaaaaa3ULL, },
+ { 0xa12f684bda12f67dULL, 0x12f684bda12f6844ULL, },
+ { 0xfffffffffffffff8ULL, 0xfffffffffffffff8ULL, },
+ { 0xccccccccccccccc4ULL, 0xccccccccccccccc4ULL, }, /* 32 */
+ { 0xccccccccccccccc4ULL, 0xccccccccccccccc4ULL, },
+ { 0x555555555555554cULL, 0x555555555555554cULL, },
+ { 0x9999999999999990ULL, 0x9999999999999990ULL, },
+ { 0xa3d70a3d70a3d700ULL, 0xa3d70a3d70a3d700ULL, },
+ { 0x666666666666665cULL, 0x666666666666665cULL, },
+ { 0xe93e93e93e93e934ULL, 0x2d82d82d82d82d78ULL, },
+ { 0x3333333333333328ULL, 0x3333333333333328ULL, },
+ { 0x666666666666665bULL, 0x666666666666665bULL, }, /* 40 */
+ { 0x666666666666665bULL, 0x666666666666665bULL, },
+ { 0x888888888888887dULL, 0x888888888888887dULL, },
+ { 0x999999999999998eULL, 0x999999999999998eULL, },
+ { 0x5c28f5c28f5c28eaULL, 0x5c28f5c28f5c28eaULL, },
+ { 0xccccccccccccccc1ULL, 0xccccccccccccccc1ULL, },
+ { 0x2d82d82d82d82d77ULL, 0x3e93e93e93e93e88ULL, },
+ { 0xfffffffffffffff4ULL, 0xfffffffffffffff4ULL, },
+ { 0xe38e38e38e38e382ULL, 0x38e38e38e38e38d7ULL, }, /* 48 */
+ { 0xe38e38e38e38e382ULL, 0x38e38e38e38e38d7ULL, },
+ { 0xd097b425ed097b36ULL, 0x097b425ed097b419ULL, },
+ { 0xc71c71c71c71c710ULL, 0x71c71c71c71c71baULL, },
+ { 0x49f49f49f49f49e8ULL, 0x38e38e38e38e38d6ULL, },
+ { 0xaaaaaaaaaaaaaa9eULL, 0xaaaaaaaaaaaaaa9dULL, },
+ { 0xf9add3c0ca4587daULL, 0x587e6b74f0329154ULL, },
+ { 0x8e38e38e38e38e2cULL, 0xe38e38e38e38e380ULL, },
+ { 0xaaaaaaaaaaaaaa9dULL, 0xaaaaaaaaaaaaaa9cULL, }, /* 56 */
+ { 0xaaaaaaaaaaaaaa9dULL, 0xaaaaaaaaaaaaaa9cULL, },
+ { 0x684bda12f684bd93ULL, 0x84bda12f684bda04ULL, },
+ { 0xc71c71c71c71c70eULL, 0x71c71c71c71c71b8ULL, },
+ { 0x1111111111111102ULL, 0x7777777777777768ULL, },
+ { 0xe38e38e38e38e37fULL, 0x38e38e38e38e38d4ULL, },
+ { 0x781948b0fcd6e9d1ULL, 0xc3f35ba781948b00ULL, },
+ { 0xfffffffffffffff0ULL, 0xfffffffffffffff0ULL, },
+ { 0x52ba41969e9c6ff0ULL, 0xcd6802158b677f60ULL, }, /* 64 */
+ { 0x63129bf5b78505f0ULL, 0x1556f7f61c4e5b90ULL, },
+ { 0x5a4c8855f350a5f0ULL, 0x6a36586fc42edea0ULL, },
+ { 0x5e6b001b04d82c70ULL, 0xe819332c365e3f20ULL, },
+ { 0x6ec35a7a1dc0c270ULL, 0x3008290cc7451b50ULL, },
+ { 0x37152f411fd35230ULL, 0xc7e3b2957c56b340ULL, },
+ { 0xcc49f1d861667630ULL, 0x1808e0646811cb90ULL, },
+ { 0xde8a7f544022c1c0ULL, 0x9886bc9978437610ULL, },
+ { 0xd5c46bb47bee61c0ULL, 0xed661d132023f920ULL, }, /* 72 */
+ { 0x6af92e4bbd8185c0ULL, 0x3d8b4ae20bdf1170ULL, },
+ { 0xe4d44869d87d45c0ULL, 0x6409d23bd9c847e0ULL, },
+ { 0x6e2e9ce94e99c4c0ULL, 0xc30837db04ed7360ULL, },
+ { 0x724d14ae60214b40ULL, 0x40eb1297771cd3e0ULL, },
+ { 0x848da22a3edd96d0ULL, 0xc168eecc874e7e60ULL, },
+ { 0x0de7f6a9b4fa15d0ULL, 0x2067546bb273a9e0ULL, },
+ { 0xc233bfd40310460cULL, 0x0d9585bacf54c5e0ULL, },
+ { 0x061015122724c70cULL, 0x0169d01f7cb17f60ULL, }, /* 80 */
+ { 0x23dacc726f603aacULL, 0xf3ea8c4eaa8b5ce0ULL, },
+ { 0xd82df953c25380acULL, 0xba87b7f0f99bbb60ULL, },
+ { 0x546cb94a0c5e7444ULL, 0x3818c320ce1bdf60ULL, },
+ { 0xa38f9428761ecf44ULL, 0x63113b9e681b66e0ULL, },
+ { 0x7dc23fbe59fe7924ULL, 0x156ddd68750e6260ULL, },
+ { 0x8a17717d36df5b24ULL, 0x36b1f5939596d2e0ULL, },
+ { 0x7e854cd9a677ce2cULL, 0xf2b6202eb36946e0ULL, },
+ { 0x246d8d067437a72cULL, 0x04c6347e9c1ff460ULL, }, /* 88 */
+ { 0xc48a013a554339ccULL, 0xcb81fd31acc4a5e0ULL, },
+ { 0xb971282c0b508fccULL, 0x20d62d6344ce5060ULL, },
+ { 0x835f812f0bc6a7a4ULL, 0x17bd6b5a08275460ULL, },
+ { 0xc0ee1b9557ab4aa4ULL, 0x170471a9d22d5fe0ULL, },
+ { 0xc6f66d89431f7984ULL, 0x5c6f5a646cad3f60ULL, },
+ { 0x5ae0b289f6ac0b84ULL, 0x6f9f6bc81fdb6be0ULL, },
+ { 0x2f584ee03fd2014cULL, 0xa7e34ccbd1bc3fe0ULL, },
+ { 0x5947927731cb724cULL, 0xf76af1f9a05f4160ULL, }, /* 96 */
+ { 0x68112ad490e3a34cULL, 0x7f944a22f5d630e0ULL, },
+ { 0x1cf6705c5faa944cULL, 0x801292d47291e660ULL, },
+ { 0x5519f2782cb0454cULL, 0x3d691c2dd53919e0ULL, },
+ { 0xe5c979861aac06ecULL, 0x585247d6e899e160ULL, },
+ { 0x2450b27896665b8cULL, 0x8276d8ad504f46e0ULL, },
+ { 0x2716d456a4a5ab2cULL, 0x46e1f3460c71c260ULL, },
+ { 0x5751460331251dccULL, 0xdc1dc7a4a693abe0ULL, },
+ { 0x3bf387b7f37473ccULL, 0x8efb4ff7cc92de60ULL, }, /* 104 */
+ { 0xc3103a3df066c9ccULL, 0x7d3b07351cd59ee0ULL, },
+ { 0x0d612554557c1fccULL, 0x5dbabfc2ac8ed560ULL, },
+ { 0x1cd018ef103475ccULL, 0xca277277956f49e0ULL, },
+ { 0x15d520225c2e79a4ULL, 0x08f2025804e95de0ULL, },
+ { 0x820f9c65be3ea1acULL, 0x37094edbda6ef1e0ULL, },
+ { 0x0f18515c62838744ULL, 0xcfbd4b5627d005e0ULL, },
+ { 0x11d549f26502488cULL, 0x8de999d53cdc99e0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_h.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_h.c
new file mode 100644
index 0000000000..6c059c779c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MSUBV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MSUBV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaa9aaa9aaa9aaa9ULL, 0xaaa9aaa9aaa9aaa9ULL, },
+ { 0xfffefffefffefffeULL, 0xfffefffefffefffeULL, },
+ { 0xcccacccacccacccaULL, 0xcccacccacccacccaULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xe38b38e08e35e38bULL, 0x38e08e35e38b38e0ULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, }, /* 8 */
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xaaa6aaa6aaa6aaa6ULL, 0xaaa6aaa6aaa6aaa6ULL, }, /* 16 */
+ { 0xaaa6aaa6aaa6aaa6ULL, 0xaaa6aaa6aaa6aaa6ULL, },
+ { 0x71c271c271c271c2ULL, 0x71c271c271c271c2ULL, },
+ { 0x5550555055505550ULL, 0x5550555055505550ULL, },
+ { 0xddd8ddd8ddd8ddd8ULL, 0xddd8ddd8ddd8ddd8ULL, },
+ { 0xfffafffafffafffaULL, 0xfffafffafffafffaULL, },
+ { 0x97ae7b3c5eca97aeULL, 0x7b3c5eca97ae7b3cULL, },
+ { 0xaaa4aaa4aaa4aaa4ULL, 0xaaa4aaa4aaa4aaa4ULL, },
+ { 0xfff9fff9fff9fff9ULL, 0xfff9fff9fff9fff9ULL, }, /* 24 */
+ { 0xfff9fff9fff9fff9ULL, 0xfff9fff9fff9fff9ULL, },
+ { 0xe387e387e387e387ULL, 0xe387e387e387e387ULL, },
+ { 0x554e554e554e554eULL, 0x554e554e554e554eULL, },
+ { 0x9992999299929992ULL, 0x9992999299929992ULL, },
+ { 0xaaa3aaa3aaa3aaa3ULL, 0xaaa3aaa3aaa3aaa3ULL, },
+ { 0xf67d6844da0bf67dULL, 0x6844da0bf67d6844ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xccc4ccc4ccc4ccc4ULL, 0xccc4ccc4ccc4ccc4ULL, }, /* 32 */
+ { 0xccc4ccc4ccc4ccc4ULL, 0xccc4ccc4ccc4ccc4ULL, },
+ { 0x554c554c554c554cULL, 0x554c554c554c554cULL, },
+ { 0x9990999099909990ULL, 0x9990999099909990ULL, },
+ { 0xd700d700d700d700ULL, 0xd700d700d700d700ULL, },
+ { 0x665c665c665c665cULL, 0x665c665c665c665cULL, },
+ { 0xe9342d7871bce934ULL, 0x2d7871bce9342d78ULL, },
+ { 0x3328332833283328ULL, 0x3328332833283328ULL, },
+ { 0x665b665b665b665bULL, 0x665b665b665b665bULL, }, /* 40 */
+ { 0x665b665b665b665bULL, 0x665b665b665b665bULL, },
+ { 0x887d887d887d887dULL, 0x887d887d887d887dULL, },
+ { 0x998e998e998e998eULL, 0x998e998e998e998eULL, },
+ { 0x28ea28ea28ea28eaULL, 0x28ea28ea28ea28eaULL, },
+ { 0xccc1ccc1ccc1ccc1ULL, 0xccc1ccc1ccc1ccc1ULL, },
+ { 0x2d773e884f992d77ULL, 0x3e884f992d773e88ULL, },
+ { 0xfff4fff4fff4fff4ULL, 0xfff4fff4fff4fff4ULL, },
+ { 0xe38238d78e2ce382ULL, 0x38d78e2ce38238d7ULL, }, /* 48 */
+ { 0xe38238d78e2ce382ULL, 0x38d78e2ce38238d7ULL, },
+ { 0x7b36b419ecfc7b36ULL, 0xb419ecfc7b36b419ULL, },
+ { 0xc71071ba1c64c710ULL, 0x71ba1c64c71071baULL, },
+ { 0x49e838d627c449e8ULL, 0x38d627c449e838d6ULL, },
+ { 0xaa9eaa9daa9caa9eULL, 0xaa9daa9caa9eaa9dULL, },
+ { 0x87da91547e5c87daULL, 0x91547e5c87da9154ULL, },
+ { 0x8e2ce38038d48e2cULL, 0xe38038d48e2ce380ULL, },
+ { 0xaa9daa9caa9baa9dULL, 0xaa9caa9baa9daa9cULL, }, /* 56 */
+ { 0xaa9daa9caa9baa9dULL, 0xaa9caa9baa9daa9cULL, },
+ { 0xbd93da04f675bd93ULL, 0xda04f675bd93da04ULL, },
+ { 0xc70e71b81c62c70eULL, 0x71b81c62c70e71b8ULL, },
+ { 0x11027768ddce1102ULL, 0x7768ddce11027768ULL, },
+ { 0xe37f38d48e29e37fULL, 0x38d48e29e37f38d4ULL, },
+ { 0xe9d18b0048a1e9d1ULL, 0x8b0048a1e9d18b00ULL, },
+ { 0xfff0fff0fff0fff0ULL, 0xfff0fff0fff0fff0ULL, },
+ { 0x340ccd603a6c6ff0ULL, 0x7c7fc96cb0d77f60ULL, }, /* 64 */
+ { 0x07608c7c902605f0ULL, 0x7e1ef7e0f9925b90ULL, },
+ { 0xda1ca10416e8a5f0ULL, 0x2e36f13e11e9dea0ULL, },
+ { 0x6166ada860262c70ULL, 0x773f69ee43333f20ULL, },
+ { 0x34ba6cc4b5e0c270ULL, 0x78de98628bee1b50ULL, },
+ { 0x13b6467bf3775230ULL, 0xce8d99be266db340ULL, },
+ { 0xeaeababdfe9a7630ULL, 0x2d251ed87fd8cb90ULL, },
+ { 0x1b481af62b77c1c0ULL, 0x479e70e86e9a7610ULL, },
+ { 0xee042f7eb23961c0ULL, 0xf7b66a4686f1f920ULL, }, /* 72 */
+ { 0xc538a3c0bd5c85c0ULL, 0x564eef60e05c1170ULL, },
+ { 0xb5941adce7fb45c0ULL, 0xd00e7d5f672347e0ULL, },
+ { 0x25cef5ba555cc4c0ULL, 0x55b61e37e30d7360ULL, },
+ { 0xad18025e9e9a4b40ULL, 0x9ebf96e71457d3e0ULL, },
+ { 0xdd766297cb7796d0ULL, 0xb938e8f703197e60ULL, },
+ { 0x4db03d7538d815d0ULL, 0x3ee089cf7f03a9e0ULL, },
+ { 0x154fea4c3377460cULL, 0xe1ff538f49ffc5e0ULL, },
+ { 0x4a99edbce7e9c70cULL, 0x3f66800dba7a7f60ULL, }, /* 80 */
+ { 0xea0bfe08a81e3aacULL, 0xe7fcffbbd4745ce0ULL, },
+ { 0x3e2ddcb809dc80acULL, 0xc75ca276a8f8bb60ULL, },
+ { 0x5e4aa9605ec07444ULL, 0x6dc0dee66108df60ULL, },
+ { 0x03a670e01940cf44ULL, 0x05802472d23066e0ULL, },
+ { 0x8c72ca4059807924ULL, 0xb7002ade28606260ULL, },
+ { 0x945efbc07b005b24ULL, 0x4f00c3bc4040d2e0ULL, },
+ { 0xab5cc300f000ce2cULL, 0xf000bd1c6fc046e0ULL, },
+ { 0xd7445f001000a72cULL, 0x600018d43e80f460ULL, }, /* 88 */
+ { 0x66cca200e00039ccULL, 0xc000b74c5d00a5e0ULL, },
+ { 0x33140e00c0008fccULL, 0xc0005a98be005060ULL, },
+ { 0xafe8d8000000a7a4ULL, 0x00002a58c2005460ULL, },
+ { 0x99d8b80000004aa4ULL, 0x0000d6088c005fe0ULL, },
+ { 0xa388900000007984ULL, 0x0000413818003f60ULL, },
+ { 0xc5b8f00000000b84ULL, 0x0000fa7010006be0ULL, },
+ { 0x41f0c0000000014cULL, 0x00002bf0f0003fe0ULL, },
+ { 0x7490c0000000724cULL, 0x0000b9d0a0004160ULL, }, /* 96 */
+ { 0xb0f0c0000000a34cULL, 0x00008f70c00030e0ULL, },
+ { 0xed90c0000000944cULL, 0x000014508000e660ULL, },
+ { 0x0ff0c0000000454cULL, 0x00002ef0000019e0ULL, },
+ { 0xebd08000000006ecULL, 0x00001a900000e160ULL, },
+ { 0xf770000000005b8cULL, 0x000037f0000046e0ULL, },
+ { 0x825000000000ab2cULL, 0x000039900000c260ULL, },
+ { 0x5af0000000001dccULL, 0x000030f00000abe0ULL, },
+ { 0x22900000000073ccULL, 0x0000d1e00000de60ULL, }, /* 104 */
+ { 0x3bf000000000c9ccULL, 0x000083c000009ee0ULL, },
+ { 0xe990000000001fccULL, 0x0000c7800000d560ULL, },
+ { 0x0cf00000000075ccULL, 0x00000f00000049e0ULL, },
+ { 0x0ee00000000079a4ULL, 0x0000670000005de0ULL, },
+ { 0x77c000000000a1acULL, 0x00007f000000f1e0ULL, },
+ { 0x8380000000008744ULL, 0x00005700000005e0ULL, },
+ { 0xef0000000000488cULL, 0x0000ef00000099e0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_w.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_w.c
new file mode 100644
index 0000000000..0a83db4787
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_msubv_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction MSUBV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MSUBV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaa9aaaaaaa9ULL, 0xaaaaaaa9aaaaaaa9ULL, },
+ { 0xfffffffefffffffeULL, 0xfffffffefffffffeULL, },
+ { 0xcccccccacccccccaULL, 0xcccccccacccccccaULL, },
+ { 0xfffffffdfffffffdULL, 0xfffffffdfffffffdULL, },
+ { 0xe38e38e08e38e38bULL, 0x38e38e35e38e38e0ULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, }, /* 8 */
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xfffffffcfffffffcULL, 0xfffffffcfffffffcULL, },
+ { 0xaaaaaaa6aaaaaaa6ULL, 0xaaaaaaa6aaaaaaa6ULL, }, /* 16 */
+ { 0xaaaaaaa6aaaaaaa6ULL, 0xaaaaaaa6aaaaaaa6ULL, },
+ { 0xc71c71c2c71c71c2ULL, 0xc71c71c2c71c71c2ULL, },
+ { 0x5555555055555550ULL, 0x5555555055555550ULL, },
+ { 0xddddddd8ddddddd8ULL, 0xddddddd8ddddddd8ULL, },
+ { 0xfffffffafffffffaULL, 0xfffffffafffffffaULL, },
+ { 0xed097b3c5ed097aeULL, 0x7b425ecaed097b3cULL, },
+ { 0xaaaaaaa4aaaaaaa4ULL, 0xaaaaaaa4aaaaaaa4ULL, },
+ { 0xfffffff9fffffff9ULL, 0xfffffff9fffffff9ULL, }, /* 24 */
+ { 0xfffffff9fffffff9ULL, 0xfffffff9fffffff9ULL, },
+ { 0x8e38e3878e38e387ULL, 0x8e38e3878e38e387ULL, },
+ { 0x5555554e5555554eULL, 0x5555554e5555554eULL, },
+ { 0x9999999299999992ULL, 0x9999999299999992ULL, },
+ { 0xaaaaaaa3aaaaaaa3ULL, 0xaaaaaaa3aaaaaaa3ULL, },
+ { 0xa12f6844da12f67dULL, 0x684bda0ba12f6844ULL, },
+ { 0xfffffff8fffffff8ULL, 0xfffffff8fffffff8ULL, },
+ { 0xccccccc4ccccccc4ULL, 0xccccccc4ccccccc4ULL, }, /* 32 */
+ { 0xccccccc4ccccccc4ULL, 0xccccccc4ccccccc4ULL, },
+ { 0x5555554c5555554cULL, 0x5555554c5555554cULL, },
+ { 0x9999999099999990ULL, 0x9999999099999990ULL, },
+ { 0x70a3d70070a3d700ULL, 0x70a3d70070a3d700ULL, },
+ { 0x6666665c6666665cULL, 0x6666665c6666665cULL, },
+ { 0x82d82d783e93e934ULL, 0xc71c71bc82d82d78ULL, },
+ { 0x3333332833333328ULL, 0x3333332833333328ULL, },
+ { 0x6666665b6666665bULL, 0x6666665b6666665bULL, }, /* 40 */
+ { 0x6666665b6666665bULL, 0x6666665b6666665bULL, },
+ { 0x8888887d8888887dULL, 0x8888887d8888887dULL, },
+ { 0x9999998e9999998eULL, 0x9999998e9999998eULL, },
+ { 0x8f5c28ea8f5c28eaULL, 0x8f5c28ea8f5c28eaULL, },
+ { 0xccccccc1ccccccc1ULL, 0xccccccc1ccccccc1ULL, },
+ { 0x93e93e8882d82d77ULL, 0xa4fa4f9993e93e88ULL, },
+ { 0xfffffff4fffffff4ULL, 0xfffffff4fffffff4ULL, },
+ { 0xe38e38d78e38e382ULL, 0x38e38e2ce38e38d7ULL, }, /* 48 */
+ { 0xe38e38d78e38e382ULL, 0x38e38e2ce38e38d7ULL, },
+ { 0xd097b419ed097b36ULL, 0xb425ecfcd097b419ULL, },
+ { 0xc71c71ba1c71c710ULL, 0x71c71c64c71c71baULL, },
+ { 0xe38e38d6f49f49e8ULL, 0xd27d27c4e38e38d6ULL, },
+ { 0xaaaaaa9daaaaaa9eULL, 0xaaaaaa9caaaaaa9dULL, },
+ { 0xf0329154ca4587daULL, 0xa4587e5cf0329154ULL, },
+ { 0x8e38e38038e38e2cULL, 0xe38e38d48e38e380ULL, },
+ { 0xaaaaaa9caaaaaa9dULL, 0xaaaaaa9baaaaaa9cULL, }, /* 56 */
+ { 0xaaaaaa9caaaaaa9dULL, 0xaaaaaa9baaaaaa9cULL, },
+ { 0x684bda04f684bd93ULL, 0xda12f675684bda04ULL, },
+ { 0xc71c71b81c71c70eULL, 0x71c71c62c71c71b8ULL, },
+ { 0x7777776811111102ULL, 0xddddddce77777768ULL, },
+ { 0xe38e38d48e38e37fULL, 0x38e38e29e38e38d4ULL, },
+ { 0x81948b00fcd6e9d1ULL, 0x781948a181948b00ULL, },
+ { 0xfffffff0fffffff0ULL, 0xfffffff0fffffff0ULL, },
+ { 0x4efccd609e9c6ff0ULL, 0xc5dac96c8b677f60ULL, }, /* 64 */
+ { 0x3e3d8c7cb78505f0ULL, 0x4463f7e01c4e5b90ULL, },
+ { 0xcaa9a104f350a5f0ULL, 0x8ca4f13ec42edea0ULL, },
+ { 0x19b8ada804d82c70ULL, 0xb62b69ee365e3f20ULL, },
+ { 0x08f96cc41dc0c270ULL, 0x34b49862c7451b50ULL, },
+ { 0x5405467b1fd35230ULL, 0xf7c999be7c56b340ULL, },
+ { 0x5cc7babd61667630ULL, 0xa4601ed86811cb90ULL, },
+ { 0xe20c1af64022c1c0ULL, 0x927a70e878437610ULL, },
+ { 0x6e782f7e7bee61c0ULL, 0xdabb6a462023f920ULL, }, /* 72 */
+ { 0x773aa3c0bd8185c0ULL, 0x8751ef600bdf1170ULL, },
+ { 0xc0871adcd87d45c0ULL, 0x6c527d5fd9c847e0ULL, },
+ { 0xd7c7f5ba4e99c4c0ULL, 0xdaa41e3704ed7360ULL, },
+ { 0x26d7025e60214b40ULL, 0x042a96e7771cd3e0ULL, },
+ { 0xac1b62973edd96d0ULL, 0xf244e8f7874e7e60ULL, },
+ { 0xc35c3d75b4fa15d0ULL, 0x609689cfb273a9e0ULL, },
+ { 0x9de4ea4c0310460cULL, 0x80c0538fcf54c5e0ULL, },
+ { 0xbd81edbc2724c70cULL, 0x7301800d7cb17f60ULL, }, /* 80 */
+ { 0xaebafe086f603aacULL, 0x35c5ffbbaa8b5ce0ULL, },
+ { 0xdf14dcb8c25380acULL, 0x3ef9a276f99bbb60ULL, },
+ { 0x5e0ea9600c5e7444ULL, 0x8ef3dee6ce1bdf60ULL, },
+ { 0x1c7370e0761ecf44ULL, 0x864a2472681b66e0ULL, },
+ { 0xb58eca4059fe7924ULL, 0x8c252ade750e6260ULL, },
+ { 0xfcc4fbc036df5b24ULL, 0x36a7c3bc9596d2e0ULL, },
+ { 0x57a2c300a677ce2cULL, 0x2922bd1cb36946e0ULL, },
+ { 0x88bd5f007437a72cULL, 0x45fd18d49c1ff460ULL, }, /* 88 */
+ { 0x2581a200554339ccULL, 0x6c99b74cacc4a5e0ULL, },
+ { 0x2d500e000b508fccULL, 0x1f975a9844ce5060ULL, },
+ { 0x5907d8000bc6a7a4ULL, 0x0eaa2a5808275460ULL, },
+ { 0xeab7b80057ab4aa4ULL, 0x8af4d608d22d5fe0ULL, },
+ { 0x95ab9000431f7984ULL, 0x840741386cad3f60ULL, },
+ { 0xf5ddf000f6ac0b84ULL, 0xd51bfa701fdb6be0ULL, },
+ { 0xdf7cc0003fd2014cULL, 0xb5052bf0d1bc3fe0ULL, },
+ { 0x3393c00031cb724cULL, 0x06abb9d0a05f4160ULL, }, /* 96 */
+ { 0xdb56c00090e3a34cULL, 0x7ff18f70f5d630e0ULL, },
+ { 0xa1b5c0005faa944cULL, 0x9e0514507291e660ULL, },
+ { 0xfa60c0002cb0454cULL, 0xc4182ef0d53919e0ULL, },
+ { 0xa6f680001aac06ecULL, 0x05ca1a90e899e160ULL, },
+ { 0x15a3000096665b8cULL, 0x0cec37f0504f46e0ULL, },
+ { 0xb79a0000a4a5ab2cULL, 0x578239900c71c260ULL, },
+ { 0xb70c000031251dccULL, 0xaa4c30f0a693abe0ULL, },
+ { 0x01140000f37473ccULL, 0x400dd1e0cc92de60ULL, }, /* 104 */
+ { 0xb1cc0000f066c9ccULL, 0x8cf683c01cd59ee0ULL, },
+ { 0xf8540000557c1fccULL, 0x0f82c780ac8ed560ULL, },
+ { 0xf88c0000103475ccULL, 0xa1f10f00956f49e0ULL, },
+ { 0x2e7000005c2e79a4ULL, 0xcf94670004e95de0ULL, },
+ { 0x96c00000be3ea1acULL, 0xdca57f00da6ef1e0ULL, },
+ { 0xbf00000062838744ULL, 0x368a570027d005e0ULL, },
+ { 0x4c0000006502488cULL, 0xcc98ef003cdc99e0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MSUBV_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c
new file mode 100644
index 0000000000..de1046820c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MULV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MULV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe4e4e4e4e4e4e4e4ULL, 0xe4e4e4e4e4e4e4e4ULL, },
+ { 0x7272727272727272ULL, 0x7272727272727272ULL, },
+ { 0x7878787878787878ULL, 0x7878787878787878ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0xbe4c30be4c30be4cULL, 0x30be4c30be4c30beULL, },
+ { 0x980a26980a26980aULL, 0x26980a26980a2698ULL, },
+ { 0xababababababababULL, 0xababababababababULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7272727272727272ULL, 0x7272727272727272ULL, },
+ { 0x3939393939393939ULL, 0x3939393939393939ULL, },
+ { 0xbcbcbcbcbcbcbcbcULL, 0xbcbcbcbcbcbcbcbcULL, },
+ { 0xefefefefefefefefULL, 0xefefefefefefefefULL, },
+ { 0x5f26985f26985f26ULL, 0x985f26985f26985fULL, },
+ { 0x4c85134c85134c85ULL, 0x134c85134c85134cULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7878787878787878ULL, 0x7878787878787878ULL, },
+ { 0xbcbcbcbcbcbcbcbcULL, 0xbcbcbcbcbcbcbcbcULL, },
+ { 0x9090909090909090ULL, 0x9090909090909090ULL, },
+ { 0xa4a4a4a4a4a4a4a4ULL, 0xa4a4a4a4a4a4a4a4ULL, },
+ { 0xe428a0e428a0e428ULL, 0xa0e428a0e428a0e4ULL, },
+ { 0x500c94500c94500cULL, 0x94500c94500c9450ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0xefefefefefefefefULL, 0xefefefefefefefefULL, },
+ { 0xa4a4a4a4a4a4a4a4ULL, 0xa4a4a4a4a4a4a4a4ULL, },
+ { 0x2929292929292929ULL, 0x2929292929292929ULL, },
+ { 0x394a28394a28394aULL, 0x28394a28394a2839ULL, },
+ { 0x9483a59483a59483ULL, 0xa59483a59483a594ULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xbe4c30be4c30be4cULL, 0x30be4c30be4c30beULL, },
+ { 0x5f26985f26985f26ULL, 0x985f26985f26985fULL, },
+ { 0xe428a0e428a0e428ULL, 0xa0e428a0e428a0e4ULL, },
+ { 0x394a28394a28394aULL, 0x28394a28394a2839ULL, },
+ { 0x49c44049c44049c4ULL, 0x4049c44049c44049ULL, },
+ { 0xd4ae88d4ae88d4aeULL, 0x88d4ae88d4ae88d4ULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x980a26980a26980aULL, 0x26980a26980a2698ULL, },
+ { 0x4c85134c85134c85ULL, 0x134c85134c85134cULL, },
+ { 0x500c94500c94500cULL, 0x94500c94500c9450ULL, },
+ { 0x9483a59483a59483ULL, 0xa59483a59483a594ULL, },
+ { 0xd4ae88d4ae88d4aeULL, 0x88d4ae88d4ae88d4ULL, },
+ { 0x10e1b110e1b110e1ULL, 0xb110e1b110e1b110ULL, },
+ { 0x40e4a49040843900ULL, 0xf971798404190090ULL, }, /* 64 */
+ { 0x58ac00e408461300ULL, 0x4661098cd64560d0ULL, },
+ { 0x60445478e83e2700ULL, 0x6de882a2aaa970f0ULL, },
+ { 0x80b6c45cb0c20a80ULL, 0x4ff7d850aeb66080ULL, },
+ { 0x58ac00e408461300ULL, 0x4661098cd64560d0ULL, },
+ { 0x190400492969b140ULL, 0x445199a4b9814410ULL, },
+ { 0xa4cc00bea5dd0d00ULL, 0xbe68a2e60795dab0ULL, },
+ { 0xd0a200c74623ae70ULL, 0xea8758f0dd3e6480ULL, },
+ { 0x60445478e83e2700ULL, 0x6de882a2aaa970f0ULL, }, /* 72 */
+ { 0xa4cc00bea5dd0d00ULL, 0xbe68a2e60795dab0ULL, },
+ { 0x90a444e4b1617900ULL, 0xf140240139395990ULL, },
+ { 0x40c6f422ee9fb600ULL, 0x7b583028e316aa80ULL, },
+ { 0x80b6c45cb0c20a80ULL, 0x4ff7d850aeb66080ULL, },
+ { 0xd0a200c74623ae70ULL, 0xea8758f0dd3e6480ULL, },
+ { 0x40c6f422ee9fb600ULL, 0x7b583028e316aa80ULL, },
+ { 0x0061e429846184c4ULL, 0xa9e1404091048400ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c
new file mode 100644
index 0000000000..ae2ebef559
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MULV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MULV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x7777777777777778ULL, 0x7777777777777778ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x12f684bda12f684cULL, 0x2f684bda12f684beULL, },
+ { 0x425ed097b425ed0aULL, 0x25ed097b425ed098ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xbbbbbbbbbbbbbbbcULL, 0xbbbbbbbbbbbbbbbcULL, },
+ { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, },
+ { 0x097b425ed097b426ULL, 0x97b425ed097b425fULL, },
+ { 0xa12f684bda12f685ULL, 0x12f684bda12f684cULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777778ULL, 0x7777777777777778ULL, },
+ { 0xbbbbbbbbbbbbbbbcULL, 0xbbbbbbbbbbbbbbbcULL, },
+ { 0xf5c28f5c28f5c290ULL, 0xf5c28f5c28f5c290ULL, },
+ { 0x3d70a3d70a3d70a4ULL, 0x3d70a3d70a3d70a4ULL, },
+ { 0x7d27d27d27d27d28ULL, 0x38e38e38e38e38e4ULL, },
+ { 0xb60b60b60b60b60cULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0xeeeeeeeeeeeeeeefULL, 0xeeeeeeeeeeeeeeefULL, },
+ { 0x3d70a3d70a3d70a4ULL, 0x3d70a3d70a3d70a4ULL, },
+ { 0x8f5c28f5c28f5c29ULL, 0x8f5c28f5c28f5c29ULL, },
+ { 0x9f49f49f49f49f4aULL, 0x8e38e38e38e38e39ULL, },
+ { 0x2d82d82d82d82d83ULL, 0x3e93e93e93e93e94ULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x12f684bda12f684cULL, 0x2f684bda12f684beULL, },
+ { 0x097b425ed097b426ULL, 0x97b425ed097b425fULL, },
+ { 0x7d27d27d27d27d28ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x9f49f49f49f49f4aULL, 0x8e38e38e38e38e39ULL, },
+ { 0xb0fcd6e9e06522c4ULL, 0x522c3f35ba781949ULL, },
+ { 0x6b74f0329161f9aeULL, 0x74f0329161f9add4ULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x425ed097b425ed0aULL, 0x25ed097b425ed098ULL, },
+ { 0xa12f684bda12f685ULL, 0x12f684bda12f684cULL, },
+ { 0xb60b60b60b60b60cULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0x2d82d82d82d82d83ULL, 0x3e93e93e93e93e94ULL, },
+ { 0x6b74f0329161f9aeULL, 0x74f0329161f9add4ULL, },
+ { 0x781948b0fcd6e9e1ULL, 0xc3f35ba781948b10ULL, },
+ { 0xad45be6961639000ULL, 0x3297fdea74988090ULL, }, /* 64 */
+ { 0xefa7a5a0e7176a00ULL, 0xb8110a1f6f1923d0ULL, },
+ { 0x08c6139fc4346000ULL, 0xab209f86581f7cf0ULL, },
+ { 0xfbe1883aee787980ULL, 0x821d25438dd09f80ULL, },
+ { 0xefa7a5a0e7176a00ULL, 0xb8110a1f6f1923d0ULL, },
+ { 0x37ae2b38fded7040ULL, 0x682476774aee6810ULL, },
+ { 0x6acb3d68be6cdc00ULL, 0xafdad2311444e7b0ULL, },
+ { 0xedbf72842143b470ULL, 0x7f8223caefce5580ULL, },
+ { 0x08c6139fc4346000ULL, 0xab209f86581f7cf0ULL, }, /* 72 */
+ { 0x6acb3d68be6cdc00ULL, 0xafdad2311444e7b0ULL, },
+ { 0x8624e5e1e5044000ULL, 0xd98178a63216c990ULL, },
+ { 0x76a5ab8089e38100ULL, 0xa1019a60d4dad480ULL, },
+ { 0xfbe1883aee787980ULL, 0x821d25438dd09f80ULL, },
+ { 0xedbf72842143b470ULL, 0x7f8223caefce5580ULL, },
+ { 0x76a5ab8089e38100ULL, 0xa1019a60d4dad480ULL, },
+ { 0x4bb436d5b1e9cfc4ULL, 0x12d1ceb0e31ee400ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c
new file mode 100644
index 0000000000..27479a82c5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MULV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MULV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e438e438e438e4ULL, 0x38e438e438e438e4ULL, },
+ { 0x1c721c721c721c72ULL, 0x1c721c721c721c72ULL, },
+ { 0x7778777877787778ULL, 0x7778777877787778ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x684c84bea130684cULL, 0x84bea130684c84beULL, },
+ { 0xed0ad098b426ed0aULL, 0xd098b426ed0ad098ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c721c721c721c72ULL, 0x1c721c721c721c72ULL, },
+ { 0x8e398e398e398e39ULL, 0x8e398e398e398e39ULL, },
+ { 0xbbbcbbbcbbbcbbbcULL, 0xbbbcbbbcbbbcbbbcULL, },
+ { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, },
+ { 0xb426425fd098b426ULL, 0x425fd098b426425fULL, },
+ { 0xf685684cda13f685ULL, 0x684cda13f685684cULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7778777877787778ULL, 0x7778777877787778ULL, },
+ { 0xbbbcbbbcbbbcbbbcULL, 0xbbbcbbbcbbbcbbbcULL, },
+ { 0xc290c290c290c290ULL, 0xc290c290c290c290ULL, },
+ { 0x70a470a470a470a4ULL, 0x70a470a470a470a4ULL, },
+ { 0x7d2838e4f4a07d28ULL, 0x38e4f4a07d2838e4ULL, },
+ { 0xb60cfa503e94b60cULL, 0xfa503e94b60cfa50ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0xeeefeeefeeefeeefULL, 0xeeefeeefeeefeeefULL, },
+ { 0x70a470a470a470a4ULL, 0x70a470a470a470a4ULL, },
+ { 0x5c295c295c295c29ULL, 0x5c295c295c295c29ULL, },
+ { 0x9f4a8e397d289f4aULL, 0x8e397d289f4a8e39ULL, },
+ { 0x2d833e944fa52d83ULL, 0x3e944fa52d833e94ULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x684c84bea130684cULL, 0x84bea130684c84beULL, },
+ { 0xb426425fd098b426ULL, 0x425fd098b426425fULL, },
+ { 0x7d2838e4f4a07d28ULL, 0x38e4f4a07d2838e4ULL, },
+ { 0x9f4a8e397d289f4aULL, 0x8e397d289f4a8e39ULL, },
+ { 0x22c419492c4022c4ULL, 0x19492c4022c41949ULL, },
+ { 0xf9aeadd44588f9aeULL, 0xadd44588f9aeadd4ULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xed0ad098b426ed0aULL, 0xd098b426ed0ad098ULL, },
+ { 0xf685684cda13f685ULL, 0x684cda13f685684cULL, },
+ { 0xb60cfa503e94b60cULL, 0xfa503e94b60cfa50ULL, },
+ { 0x2d833e944fa52d83ULL, 0x3e944fa52d833e94ULL, },
+ { 0xf9aeadd44588f9aeULL, 0xadd44588f9aeadd4ULL, },
+ { 0xe9e18b1048b1e9e1ULL, 0x8b1048b1e9e18b10ULL, },
+ { 0xcbe43290c5849000ULL, 0x837136844f198090ULL, }, /* 64 */
+ { 0x2cac40e4aa466a00ULL, 0xfe61d18cb74523d0ULL, },
+ { 0x2d44eb78793e6000ULL, 0x4fe806a2e7a97cf0ULL, },
+ { 0x78b6f35cb6c27980ULL, 0xb6f78750ceb69f80ULL, },
+ { 0x2cac40e4aa466a00ULL, 0xfe61d18cb74523d0ULL, },
+ { 0x21042649c2697040ULL, 0xaa51fea465816810ULL, },
+ { 0x28cc8bbef4dddc00ULL, 0xa1687ae6a695e7b0ULL, },
+ { 0xcfa29fc7d323b470ULL, 0xe587adf0113e5580ULL, },
+ { 0x2d44eb78793e6000ULL, 0x4fe806a2e7a97cf0ULL, }, /* 72 */
+ { 0x28cc8bbef4dddc00ULL, 0xa1687ae6a695e7b0ULL, },
+ { 0x0fa488e4d5614000ULL, 0x864072017939c990ULL, },
+ { 0x8fc62522929f8100ULL, 0x7a585f288416d480ULL, },
+ { 0x78b6f35cb6c27980ULL, 0xb6f78750ceb69f80ULL, },
+ { 0xcfa29fc7d323b470ULL, 0xe587adf0113e5580ULL, },
+ { 0x8fc62522929f8100ULL, 0x7a585f288416d480ULL, },
+ { 0x386153290561cfc4ULL, 0x5ce136403504e400ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c
new file mode 100644
index 0000000000..adeb1bfa98
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-multiply/test_msa_mulv_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction MULV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Multiply";
+ char *instruction_name = "MULV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e4e38e38e4ULL, 0xe38e38e4e38e38e4ULL, },
+ { 0x71c71c7271c71c72ULL, 0x71c71c7271c71c72ULL, },
+ { 0x7777777877777778ULL, 0x7777777877777778ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x12f684bea12f684cULL, 0x84bda13012f684beULL, },
+ { 0x425ed098b425ed0aULL, 0xd097b426425ed098ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x71c71c7271c71c72ULL, 0x71c71c7271c71c72ULL, },
+ { 0x38e38e3938e38e39ULL, 0x38e38e3938e38e39ULL, },
+ { 0xbbbbbbbcbbbbbbbcULL, 0xbbbbbbbcbbbbbbbcULL, },
+ { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, },
+ { 0x097b425fd097b426ULL, 0x425ed098097b425fULL, },
+ { 0xa12f684cda12f685ULL, 0x684bda13a12f684cULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777877777778ULL, 0x7777777877777778ULL, },
+ { 0xbbbbbbbcbbbbbbbcULL, 0xbbbbbbbcbbbbbbbcULL, },
+ { 0x28f5c29028f5c290ULL, 0x28f5c29028f5c290ULL, },
+ { 0x0a3d70a40a3d70a4ULL, 0x0a3d70a40a3d70a4ULL, },
+ { 0xe38e38e427d27d28ULL, 0x9f49f4a0e38e38e4ULL, },
+ { 0x4fa4fa500b60b60cULL, 0x93e93e944fa4fa50ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0xeeeeeeefeeeeeeefULL, 0xeeeeeeefeeeeeeefULL, },
+ { 0x0a3d70a40a3d70a4ULL, 0x0a3d70a40a3d70a4ULL, },
+ { 0xc28f5c29c28f5c29ULL, 0xc28f5c29c28f5c29ULL, },
+ { 0x38e38e3949f49f4aULL, 0x27d27d2838e38e39ULL, },
+ { 0x93e93e9482d82d83ULL, 0xa4fa4fa593e93e94ULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x12f684bea12f684cULL, 0x84bda13012f684beULL, },
+ { 0x097b425fd097b426ULL, 0x425ed098097b425fULL, },
+ { 0xe38e38e427d27d28ULL, 0x9f49f4a0e38e38e4ULL, },
+ { 0x38e38e3949f49f4aULL, 0x27d27d2838e38e39ULL, },
+ { 0xba781949e06522c4ULL, 0x06522c40ba781949ULL, },
+ { 0x61f9add49161f9aeULL, 0xc0ca458861f9add4ULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x425ed098b425ed0aULL, 0xd097b426425ed098ULL, },
+ { 0xa12f684cda12f685ULL, 0x684bda13a12f684cULL, },
+ { 0x4fa4fa500b60b60cULL, 0x93e93e944fa4fa50ULL, },
+ { 0x93e93e9482d82d83ULL, 0xa4fa4fa593e93e94ULL, },
+ { 0x61f9add49161f9aeULL, 0xc0ca458861f9add4ULL, },
+ { 0x81948b10fcd6e9e1ULL, 0x781948b181948b10ULL, },
+ { 0xb103329061639000ULL, 0x3a25368474988090ULL, }, /* 64 */
+ { 0x10bf40e4e7176a00ULL, 0x8176d18c6f1923d0ULL, },
+ { 0x7393eb78c4346000ULL, 0xb7bf06a2581f7cf0ULL, },
+ { 0xb0f0f35cee787980ULL, 0xd67987508dd09f80ULL, },
+ { 0x10bf40e4e7176a00ULL, 0x8176d18c6f1923d0ULL, },
+ { 0xb4f42649fded7040ULL, 0x3ceafea44aee6810ULL, },
+ { 0xf73d8bbebe6cdc00ULL, 0x53697ae61444e7b0ULL, },
+ { 0x7abb9fc72143b470ULL, 0x11e5adf0efce5580ULL, },
+ { 0x7393eb78c4346000ULL, 0xb7bf06a2581f7cf0ULL, }, /* 72 */
+ { 0xf73d8bbebe6cdc00ULL, 0x53697ae61444e7b0ULL, },
+ { 0xb6b388e4e5044000ULL, 0x1aff72013216c990ULL, },
+ { 0xe8bf252289e38100ULL, 0x91ae5f28d4dad480ULL, },
+ { 0xb0f0f35cee787980ULL, 0xd67987508dd09f80ULL, },
+ { 0x7abb9fc72143b470ULL, 0x11e5adf0efce5580ULL, },
+ { 0xe8bf252289e38100ULL, 0x91ae5f28d4dad480ULL, },
+ { 0x25775329b1e9cfc4ULL, 0xdfd63640e31ee400ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_MULV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c
new file mode 100644
index 0000000000..a3ab83b76c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x391c8e391c8e391cULL, 0x8e391c8e391c8e39ULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0x391c8e391c8e391cULL, 0x8e391c8e391c8e39ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x173e6c173e6c173eULL, 0x6c173e6c173e6c17ULL, },
+ { 0x50a50550a50550a5ULL, 0x0550a50550a50550ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x50a50550a50550a5ULL, 0x0550a50550a50550ULL, },
+ { 0x173e6c173e6c173eULL, 0x6c173e6c173e6c17ULL, },
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, }, /* 48 */
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, },
+ { 0x391c8e391c8e391cULL, 0x8e391c8e391c8e39ULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0x173e6c173e6c173eULL, 0x6c173e6c173e6c17ULL, },
+ { 0x50a50550a50550a5ULL, 0x0550a50550a50550ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x39e37139e37139e3ULL, 0x7139e37139e37139ULL, },
+ { 0x1d72381d72381d72ULL, 0x381d72381d72381dULL, }, /* 56 */
+ { 0x1c71391c71391c71ULL, 0x391c71391c71391cULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0x391c8e391c8e391cULL, 0x8e391c8e391c8e39ULL, },
+ { 0x50a50550a50550a5ULL, 0x0550a50550a50550ULL, },
+ { 0x173e6c173e6c173eULL, 0x6c173e6c173e6c17ULL, },
+ { 0x39e37139e37139e3ULL, 0x7139e37139e37139ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x73ac1a9725cf8e38ULL, 0x39705044173ca210ULL, },
+ { 0x241038226f93cac0ULL, 0x248f455f53507508ULL, },
+ { 0xe81b30813631730eULL, 0xbe7683865539326cULL, },
+ { 0x73ac1a9725cf8e38ULL, 0x39705044173ca210ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f9c52b9943c3c88ULL, 0x151f0b1b6a142d18ULL, },
+ { 0x75911616119e1b46ULL, 0x850633426c03705cULL, },
+ { 0x241038226f93cac0ULL, 0x248f455f53507508ULL, }, /* 72 */
+ { 0x4f9c52b9943c3c88ULL, 0x151f0b1b6a142d18ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc40b68a3a56257ceULL, 0x9a193e2702174374ULL, },
+ { 0xe81b30813631730eULL, 0xbe7683865539326cULL, },
+ { 0x75911616119e1b46ULL, 0x850633426c03705cULL, },
+ { 0xc40b68a3a56257ceULL, 0x9a193e2702174374ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_d.c
new file mode 100644
index 0000000000..ee46ffadf1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, }, /* 48 */
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x38e38e38e38e38e4ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x73531997253171c8ULL, 0x386f5044e93c5d10ULL, },
+ { 0x23efc7de916d3640ULL, 0x238e445f53508af8ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0xbd7582865538cd6cULL, },
+ { 0x73531997253171c8ULL, 0x386f5044e93c5d10ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0x14e10be595ebd218ULL, },
+ { 0x749115ea109e1b46ULL, 0x850632416bfc705cULL, },
+ { 0x23efc7de916d3640ULL, 0x238e445f53508af8ULL, }, /* 72 */
+ { 0x4f6351b893c43b88ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc3f467a2a46256ceULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0xbd7582865538cd6cULL, },
+ { 0x749115ea109e1b46ULL, 0x850632416bfc705cULL, },
+ { 0xc3f467a2a46256ceULL, 0x99e73e2701e84274ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_h.c
new file mode 100644
index 0000000000..3262365907
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x38e48e391c7238e4ULL, 0x8e391c7238e48e39ULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0x38e48e391c7238e4ULL, 0x8e391c7238e48e39ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x16c26c173e9416c2ULL, 0x6c173e9416c26c17ULL, },
+ { 0x4fa505b0a4fb4fa5ULL, 0x05b0a4fb4fa505b0ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa505b0a4fb4fa5ULL, 0x05b0a4fb4fa505b0ULL, },
+ { 0x16c26c173e9416c2ULL, 0x6c173e9416c26c17ULL, },
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, }, /* 48 */
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, },
+ { 0x38e48e391c7238e4ULL, 0x8e391c7238e48e39ULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0x16c26c173e9416c2ULL, 0x6c173e9416c26c17ULL, },
+ { 0x4fa505b0a4fb4fa5ULL, 0x05b0a4fb4fa505b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e371c7e38f38e3ULL, 0x71c7e38f38e371c7ULL, },
+ { 0x1c7238e371c81c72ULL, 0x38e371c81c7238e3ULL, }, /* 56 */
+ { 0x1c7138e471c71c71ULL, 0x38e471c71c7138e4ULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0x38e48e391c7238e4ULL, 0x8e391c7238e48e39ULL, },
+ { 0x4fa505b0a4fb4fa5ULL, 0x05b0a4fb4fa505b0ULL, },
+ { 0x16c26c173e9416c2ULL, 0x6c173e9416c26c17ULL, },
+ { 0x38e371c7e38f38e3ULL, 0x71c7e38f38e371c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x7354199725318e38ULL, 0x3870504416c4a2f0ULL, },
+ { 0x23f038226e93c9c0ULL, 0x238f445f53507508ULL, },
+ { 0xe7e52f8135cf72f2ULL, 0xbd76828655393294ULL, },
+ { 0x7354199725318e38ULL, 0x3870504416c4a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6451b993c43b88ULL, 0x14e10be56a142de8ULL, },
+ { 0x749115ea109e1b46ULL, 0x850632426bfd705cULL, },
+ { 0x23f038226e93c9c0ULL, 0x238f445f53507508ULL, }, /* 72 */
+ { 0x4f6451b993c43b88ULL, 0x14e10be56a142de8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc3f567a3a46256ceULL, 0x99e73e2701e94274ULL, },
+ { 0xe7e52f8135cf72f2ULL, 0xbd76828655393294ULL, },
+ { 0x749115ea109e1b46ULL, 0x850632426bfd705cULL, },
+ { 0xc3f567a3a46256ceULL, 0x99e73e2701e94274ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c
new file mode 100644
index 0000000000..51f9a69413
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x38e38e391c71c71cULL, 0x8e38e38e38e38e39ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0x38e38e391c71c71cULL, 0x8e38e38e38e38e39ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x16c16c173e93e93eULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x05b05b054fa4fa50ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x05b05b054fa4fa50ULL, },
+ { 0x16c16c173e93e93eULL, 0x6c16c16c16c16c17ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, }, /* 48 */
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, },
+ { 0x38e38e391c71c71cULL, 0x8e38e38e38e38e39ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0x16c16c173e93e93eULL, 0x6c16c16c16c16c17ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x05b05b054fa4fa50ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x38e38e39e38e38e3ULL, 0x71c71c7138e38e39ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x38e38e381c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x38e38e391c71c71cULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0x38e38e391c71c71cULL, 0x8e38e38e38e38e39ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x05b05b054fa4fa50ULL, },
+ { 0x16c16c173e93e93eULL, 0x6c16c16c16c16c17ULL, },
+ { 0x38e38e39e38e38e3ULL, 0x71c71c7138e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x73531997253171c8ULL, 0x386f504416c3a2f0ULL, },
+ { 0x23efc7de6e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0xbd7582865538cd6cULL, },
+ { 0x73531997253171c8ULL, 0x386f504416c3a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b993c43b88ULL, 0x14e10be56a142de8ULL, },
+ { 0x749115ea109e1b46ULL, 0x850632426bfc705cULL, },
+ { 0x23efc7de6e92c9c0ULL, 0x238e445f53508af8ULL, }, /* 72 */
+ { 0x4f6351b993c43b88ULL, 0x14e10be56a142de8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc3f467a3a46256ceULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0xbd7582865538cd6cULL, },
+ { 0x749115ea109e1b46ULL, 0x850632426bfc705cULL, },
+ { 0xc3f467a3a46256ceULL, 0x99e73e2701e84274ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_b.c
new file mode 100644
index 0000000000..e086214ef8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x391c72391c72391cULL, 0x72391c72391c7239ULL, },
+ { 0x8e391d8e391d8e39ULL, 0x1d8e391d8e391d8eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8e391d8e391d8e39ULL, 0x1d8e391d8e391d8eULL, },
+ { 0x391c72391c72391cULL, 0x72391c72391c7239ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x173e94173e94173eULL, 0x94173e94173e9417ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x173e94173e94173eULL, 0x94173e94173e9417ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x391c72391c72391cULL, 0x72391c72391c7239ULL, },
+ { 0x8e391d8e391d8e39ULL, 0x1d8e391d8e391d8eULL, },
+ { 0x173e94173e94173eULL, 0x94173e94173e9417ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d8fc71d8fc71dULL, 0x8fc71d8fc71d8fc7ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x8e391d8e391d8e39ULL, 0x1d8e391d8e391d8eULL, },
+ { 0x391c72391c72391cULL, 0x72391c72391c7239ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x173e94173e94173eULL, 0x94173e94173e9417ULL, },
+ { 0xc71d8fc71d8fc71dULL, 0x8fc71d8fc71d8fc7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x7354e66925317238ULL, 0x3990b044e93c5ef0ULL, },
+ { 0x24103822916d3640ULL, 0x2471bba153508b08ULL, },
+ { 0x181bd07f36318d0eULL, 0x428a7d7a55393294ULL, },
+ { 0x7354e66925317238ULL, 0x3990b044e93c5ef0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f64ae476c3c3c78ULL, 0x151f0be596142de8ULL, },
+ { 0x8b6f161611621b46ULL, 0x7b0633be9403905cULL, },
+ { 0x24103822916d3640ULL, 0x2471bba153508b08ULL, }, /* 72 */
+ { 0x4f64ae476c3c3c78ULL, 0x151f0be596142de8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9e5732ULL, 0x66193e270217bd8cULL, },
+ { 0x181bd07f36318d0eULL, 0x428a7d7a55393294ULL, },
+ { 0x8b6f161611621b46ULL, 0x7b0633be9403905cULL, },
+ { 0x3c0b985d5b9e5732ULL, 0x66193e270217bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_d.c
new file mode 100644
index 0000000000..5640b65007
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x93e93e93e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x93e93e93e93e93e9ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x93e93e93e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x8e38e38e38e38e39ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x71c71c71c71c71c7ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x93e93e93e93e93e9ULL, },
+ { 0xc71c71c71c71c71dULL, 0x8e38e38e38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x73531997253171c8ULL, 0x386f5044e93c5d10ULL, },
+ { 0x23efc7de916d3640ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07eca3072f2ULL, 0x428a7d79aac73294ULL, },
+ { 0x73531997253171c8ULL, 0x386f5044e93c5d10ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0x14e10be595ebd218ULL, },
+ { 0x8b6eea15ef61e4baULL, 0x7af9cdbe94038fa4ULL, },
+ { 0x23efc7de916d3640ULL, 0x238e445f53508af8ULL, }, /* 72 */
+ { 0x4f6351b893c43b88ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x6618c1d8fe17bd8cULL, },
+ { 0x181bd07eca3072f2ULL, 0x428a7d79aac73294ULL, },
+ { 0x8b6eea15ef61e4baULL, 0x7af9cdbe94038fa4ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x6618c1d8fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c
new file mode 100644
index 0000000000..a5bf2d2054
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x38e471c71c7238e4ULL, 0x71c71c7238e471c7ULL, },
+ { 0x8e391c7238e38e39ULL, 0x1c7238e38e391c72ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8e391c7238e38e39ULL, 0x1c7238e38e391c72ULL, },
+ { 0x38e471c71c7238e4ULL, 0x71c71c7238e471c7ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x16c293e93e9416c2ULL, 0x93e93e9416c293e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c293e93e9416c2ULL, 0x93e93e9416c293e9ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e471c71c7238e4ULL, 0x71c71c7238e471c7ULL, },
+ { 0x8e391c7238e38e39ULL, 0x1c7238e38e391c72ULL, },
+ { 0x16c293e93e9416c2ULL, 0x93e93e9416c293e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d8e391c71c71dULL, 0x8e391c71c71d8e39ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x8e391c7238e38e39ULL, 0x1c7238e38e391c72ULL, },
+ { 0x38e471c71c7238e4ULL, 0x71c71c7238e471c7ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c293e93e9416c2ULL, 0x93e93e9416c293e9ULL, },
+ { 0xc71d8e391c71c71dULL, 0x8e391c71c71d8e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x7354e669253171c8ULL, 0x3870afbce93c5d10ULL, },
+ { 0x23f03822916d3640ULL, 0x238fbba153508af8ULL, },
+ { 0x181bd07f35cf8d0eULL, 0x428a7d7a55393294ULL, },
+ { 0x7354e669253171c8ULL, 0x3870afbce93c5d10ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f64ae476c3c3b88ULL, 0x14e10be595ec2de8ULL, },
+ { 0x8b6f15ea109e1b46ULL, 0x7afa324294038fa4ULL, },
+ { 0x23f03822916d3640ULL, 0x238fbba153508af8ULL, }, /* 72 */
+ { 0x4f64ae476c3c3b88ULL, 0x14e10be595ec2de8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9e56ceULL, 0x66193e2701e9bd8cULL, },
+ { 0x181bd07f35cf8d0eULL, 0x428a7d7a55393294ULL, },
+ { 0x8b6f15ea109e1b46ULL, 0x7afa324294038fa4ULL, },
+ { 0x3c0b985d5b9e56ceULL, 0x66193e2701e9bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_w.c
new file mode 100644
index 0000000000..772e90eedb
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_asub_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction ASUB_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "ASUB_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x38e38e391c71c71cULL, 0x71c71c7238e38e39ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71d8e38e38eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71d8e38e38eULL, },
+ { 0x38e38e391c71c71cULL, 0x71c71c7238e38e39ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x16c16c173e93e93eULL, 0x93e93e9416c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c16c173e93e93eULL, 0x93e93e9416c16c17ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e391c71c71cULL, 0x71c71c7238e38e39ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71d8e38e38eULL, },
+ { 0x16c16c173e93e93eULL, 0x93e93e9416c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x8e38e38fc71c71c7ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x8e38e38e38e38e39ULL, 0x1c71c71d8e38e38eULL, },
+ { 0x38e38e391c71c71cULL, 0x71c71c7238e38e39ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x16c16c173e93e93eULL, 0x93e93e9416c16c17ULL, },
+ { 0xc71c71c71c71c71dULL, 0x8e38e38fc71c71c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x73531997253171c8ULL, 0x386f5044e93c5d10ULL, },
+ { 0x23efc7de916d3640ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07f35cf8d0eULL, 0x428a7d7a5538cd6cULL, },
+ { 0x73531997253171c8ULL, 0x386f5044e93c5d10ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b96c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x8b6eea16109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0x23efc7de916d3640ULL, 0x238e445f53508af8ULL, }, /* 72 */
+ { 0x4f6351b96c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x6618c1d901e84274ULL, },
+ { 0x181bd07f35cf8d0eULL, 0x428a7d7a5538cd6cULL, },
+ { 0x8b6eea16109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x6618c1d901e84274ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ASUB_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_d.c
new file mode 100644
index 0000000000..66137f5856
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HSUB_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "HSUB_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xffffffff8e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000055555556ULL, 0x0000000055555556ULL, },
+ { 0xffffffffaaaaaaabULL, 0xffffffffaaaaaaabULL, },
+ { 0x0000000033333334ULL, 0x0000000033333334ULL, },
+ { 0xffffffffcccccccdULL, 0xffffffffcccccccdULL, },
+ { 0x0000000071c71c72ULL, 0x000000001c71c71dULL, },
+ { 0xffffffff8e38e38fULL, 0xffffffffe38e38e4ULL, },
+ { 0xffffffffaaaaaaabULL, 0xffffffffaaaaaaabULL, }, /* 16 */
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff55555555ULL, 0xffffffff55555555ULL, },
+ { 0xffffffffdddddddeULL, 0xffffffffdddddddeULL, },
+ { 0xffffffff77777777ULL, 0xffffffff77777777ULL, },
+ { 0x000000001c71c71cULL, 0xffffffffc71c71c7ULL, },
+ { 0xffffffff38e38e39ULL, 0xffffffff8e38e38eULL, },
+ { 0x0000000055555556ULL, 0x0000000055555556ULL, }, /* 24 */
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000aaaaaaabULL, 0x00000000aaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000088888889ULL, 0x0000000088888889ULL, },
+ { 0x0000000022222222ULL, 0x0000000022222222ULL, },
+ { 0x00000000c71c71c7ULL, 0x0000000071c71c72ULL, },
+ { 0xffffffffe38e38e4ULL, 0x0000000038e38e39ULL, },
+ { 0xffffffffcccccccdULL, 0xffffffffcccccccdULL, }, /* 32 */
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0x0000000022222222ULL, 0x0000000022222222ULL, },
+ { 0xffffffff77777777ULL, 0xffffffff77777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff99999999ULL, 0xffffffff99999999ULL, },
+ { 0x000000003e93e93eULL, 0xffffffffe93e93e9ULL, },
+ { 0xffffffff5b05b05bULL, 0xffffffffb05b05b0ULL, },
+ { 0x0000000033333334ULL, 0x0000000033333334ULL, }, /* 40 */
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x0000000088888889ULL, 0x0000000088888889ULL, },
+ { 0xffffffffdddddddeULL, 0xffffffffdddddddeULL, },
+ { 0x0000000066666667ULL, 0x0000000066666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000a4fa4fa5ULL, 0x000000004fa4fa50ULL, },
+ { 0xffffffffc16c16c2ULL, 0x0000000016c16c17ULL, },
+ { 0xffffffffe38e38e4ULL, 0x0000000038e38e39ULL, }, /* 48 */
+ { 0xffffffffe38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0x0000000038e38e39ULL, 0x000000008e38e38eULL, },
+ { 0xffffffff8e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0x0000000016c16c17ULL, 0x000000006c16c16cULL, },
+ { 0xffffffffb05b05b0ULL, 0x0000000005b05b05ULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0xffffffff71c71c72ULL, 0x000000001c71c71cULL, },
+ { 0x000000001c71c71dULL, 0xffffffffc71c71c8ULL, }, /* 56 */
+ { 0x000000001c71c71cULL, 0xffffffffc71c71c7ULL, },
+ { 0x0000000071c71c72ULL, 0x000000001c71c71dULL, },
+ { 0xffffffffc71c71c7ULL, 0xffffffff71c71c72ULL, },
+ { 0x000000004fa4fa50ULL, 0xfffffffffa4fa4fbULL, },
+ { 0xffffffffe93e93e9ULL, 0xffffffff93e93e94ULL, },
+ { 0x000000008e38e38eULL, 0xffffffffe38e38e4ULL, },
+ { 0xffffffffaaaaaaabULL, 0xffffffffaaaaaaabULL, },
+ { 0xffffffff6008918cULL, 0x000000004ceb5b52ULL, }, /* 64 */
+ { 0xffffffff3ad71fc4ULL, 0x000000003627b862ULL, },
+ { 0xffffffffce9b5b4cULL, 0x00000000a03be64aULL, },
+ { 0xffffffff2a39047eULL, 0x00000000a22428beULL, },
+ { 0xffffffffd35bab23ULL, 0x00000000147c0b0eULL, },
+ { 0xffffffffae2a395bULL, 0xfffffffffdb8681eULL, },
+ { 0x0000000041ee74e3ULL, 0x0000000067cc9606ULL, },
+ { 0xffffffff9d8c1e15ULL, 0x0000000069b4d87aULL, },
+ { 0xffffffff83f8596aULL, 0x00000000295d16f3ULL, }, /* 72 */
+ { 0xffffffff5ec6e7a2ULL, 0x0000000012997403ULL, },
+ { 0xfffffffff28b232aULL, 0x000000007cada1ebULL, },
+ { 0xffffffff4e28cc5cULL, 0x000000007e95e45fULL, },
+ { 0x0000000047ecc10dULL, 0xffffffff8f75d8ccULL, },
+ { 0x0000000022bb4f45ULL, 0xffffffff78b235dcULL, },
+ { 0x00000000b67f8acdULL, 0xffffffffe2c663c4ULL, },
+ { 0x00000000121d33ffULL, 0xffffffffe4aea638ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_h.c
new file mode 100644
index 0000000000..e66261b821
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HSUB_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "HSUB_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0x0071001cffc70071ULL, 0x001cffc70071001cULL, },
+ { 0xff8effe30038ff8eULL, 0xffe30038ff8effe3ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0056005600560056ULL, 0x0056005600560056ULL, },
+ { 0xffabffabffabffabULL, 0xffabffabffabffabULL, },
+ { 0x0034003400340034ULL, 0x0034003400340034ULL, },
+ { 0xffcdffcdffcdffcdULL, 0xffcdffcdffcdffcdULL, },
+ { 0x0072001dffc80072ULL, 0x001dffc80072001dULL, },
+ { 0xff8fffe40039ff8fULL, 0xffe40039ff8fffe4ULL, },
+ { 0xffabffabffabffabULL, 0xffabffabffabffabULL, }, /* 16 */
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff55ff55ff55ff55ULL, 0xff55ff55ff55ff55ULL, },
+ { 0xffdeffdeffdeffdeULL, 0xffdeffdeffdeffdeULL, },
+ { 0xff77ff77ff77ff77ULL, 0xff77ff77ff77ff77ULL, },
+ { 0x001cffc7ff72001cULL, 0xffc7ff72001cffc7ULL, },
+ { 0xff39ff8effe3ff39ULL, 0xff8effe3ff39ff8eULL, },
+ { 0x0056005600560056ULL, 0x0056005600560056ULL, }, /* 24 */
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00ab00ab00ab00abULL, 0x00ab00ab00ab00abULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0089008900890089ULL, 0x0089008900890089ULL, },
+ { 0x0022002200220022ULL, 0x0022002200220022ULL, },
+ { 0x00c70072001d00c7ULL, 0x0072001d00c70072ULL, },
+ { 0xffe40039008effe4ULL, 0x0039008effe40039ULL, },
+ { 0xffcdffcdffcdffcdULL, 0xffcdffcdffcdffcdULL, }, /* 32 */
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0x0022002200220022ULL, 0x0022002200220022ULL, },
+ { 0xff77ff77ff77ff77ULL, 0xff77ff77ff77ff77ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff99ff99ff99ff99ULL, 0xff99ff99ff99ff99ULL, },
+ { 0x003effe9ff94003eULL, 0xffe9ff94003effe9ULL, },
+ { 0xff5bffb00005ff5bULL, 0xffb00005ff5bffb0ULL, },
+ { 0x0034003400340034ULL, 0x0034003400340034ULL, }, /* 40 */
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x0089008900890089ULL, 0x0089008900890089ULL, },
+ { 0xffdeffdeffdeffdeULL, 0xffdeffdeffdeffdeULL, },
+ { 0x0067006700670067ULL, 0x0067006700670067ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00a50050fffb00a5ULL, 0x0050fffb00a50050ULL, },
+ { 0xffc20017006cffc2ULL, 0x0017006cffc20017ULL, },
+ { 0xffe40039ff8fffe4ULL, 0x0039ff8fffe40039ULL, }, /* 48 */
+ { 0xffe30038ff8effe3ULL, 0x0038ff8effe30038ULL, },
+ { 0x0039008effe40039ULL, 0x008effe40039008eULL, },
+ { 0xff8effe3ff39ff8eULL, 0xffe3ff39ff8effe3ULL, },
+ { 0x0017006cffc20017ULL, 0x006cffc20017006cULL, },
+ { 0xffb00005ff5bffb0ULL, 0x0005ff5bffb00005ULL, },
+ { 0x00550055ff560055ULL, 0x0055ff5600550055ULL, },
+ { 0xff72001cffc7ff72ULL, 0x001cffc7ff72001cULL, },
+ { 0x001dffc80072001dULL, 0xffc80072001dffc8ULL, }, /* 56 */
+ { 0x001cffc70071001cULL, 0xffc70071001cffc7ULL, },
+ { 0x0072001d00c70072ULL, 0x001d00c70072001dULL, },
+ { 0xffc7ff72001cffc7ULL, 0xff72001cffc7ff72ULL, },
+ { 0x0050fffb00a50050ULL, 0xfffb00a50050fffbULL, },
+ { 0xffe9ff94003effe9ULL, 0xff94003effe9ff94ULL, },
+ { 0x008effe40039008eULL, 0xffe40039008effe4ULL, },
+ { 0xffabffab00aaffabULL, 0xffab00aaffabffabULL, },
+ { 0xff1e001affc60015ULL, 0xffe4ffadff83ffa4ULL, }, /* 64 */
+ { 0xffcaff830095004dULL, 0x0054fff1ffbfffb4ULL, },
+ { 0xff2e003c005900d5ULL, 0x0073000cffd3ff9cULL, },
+ { 0xff39ff99fff70007ULL, 0x005a0033ffbc0010ULL, },
+ { 0xff910034ffebff87ULL, 0xffabff5dff9a0046ULL, },
+ { 0x003dff9d00baffbfULL, 0x001bffa1ffd60056ULL, },
+ { 0xffa10056007e0047ULL, 0x003affbcffea003eULL, },
+ { 0xffacffb3001cff79ULL, 0x0021ffe3ffd300b2ULL, },
+ { 0xff42ffe2ff57ff4bULL, 0xffc0ff68ff300019ULL, }, /* 72 */
+ { 0xffeeff4b0026ff83ULL, 0x0030ffacff6c0029ULL, },
+ { 0xff520004ffea000bULL, 0x004fffc7ff800011ULL, },
+ { 0xff5dff61ff88ff3dULL, 0x0036ffeeff690085ULL, },
+ { 0x0006004afffcffa2ULL, 0xff26ff2aff2effd6ULL, },
+ { 0x00b2ffb300cbffdaULL, 0xff96ff6eff6affe6ULL, },
+ { 0x0016006c008f0062ULL, 0xffb5ff89ff7effceULL, },
+ { 0x0021ffc9002dff94ULL, 0xff9cffb0ff670042ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c
new file mode 100644
index 0000000000..6d97abfe3c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HSUB_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "HSUB_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0xffffc71c00001c71ULL, 0x000071c7ffffc71cULL, },
+ { 0x000038e3ffffe38eULL, 0xffff8e38000038e3ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000555600005556ULL, 0x0000555600005556ULL, },
+ { 0xffffaaabffffaaabULL, 0xffffaaabffffaaabULL, },
+ { 0x0000333400003334ULL, 0x0000333400003334ULL, },
+ { 0xffffcccdffffcccdULL, 0xffffcccdffffcccdULL, },
+ { 0xffffc71d00001c72ULL, 0x000071c8ffffc71dULL, },
+ { 0x000038e4ffffe38fULL, 0xffff8e39000038e4ULL, },
+ { 0xffffaaabffffaaabULL, 0xffffaaabffffaaabULL, }, /* 16 */
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff5555ffff5555ULL, 0xffff5555ffff5555ULL, },
+ { 0xffffdddeffffdddeULL, 0xffffdddeffffdddeULL, },
+ { 0xffff7777ffff7777ULL, 0xffff7777ffff7777ULL, },
+ { 0xffff71c7ffffc71cULL, 0x00001c72ffff71c7ULL, },
+ { 0xffffe38effff8e39ULL, 0xffff38e3ffffe38eULL, },
+ { 0x0000555600005556ULL, 0x0000555600005556ULL, }, /* 24 */
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000aaab0000aaabULL, 0x0000aaab0000aaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000888900008889ULL, 0x0000888900008889ULL, },
+ { 0x0000222200002222ULL, 0x0000222200002222ULL, },
+ { 0x00001c72000071c7ULL, 0x0000c71d00001c72ULL, },
+ { 0x00008e39000038e4ULL, 0xffffe38e00008e39ULL, },
+ { 0xffffcccdffffcccdULL, 0xffffcccdffffcccdULL, }, /* 32 */
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0x0000222200002222ULL, 0x0000222200002222ULL, },
+ { 0xffff7777ffff7777ULL, 0xffff7777ffff7777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff9999ffff9999ULL, 0xffff9999ffff9999ULL, },
+ { 0xffff93e9ffffe93eULL, 0x00003e94ffff93e9ULL, },
+ { 0x000005b0ffffb05bULL, 0xffff5b05000005b0ULL, },
+ { 0x0000333400003334ULL, 0x0000333400003334ULL, }, /* 40 */
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x0000888900008889ULL, 0x0000888900008889ULL, },
+ { 0xffffdddeffffdddeULL, 0xffffdddeffffdddeULL, },
+ { 0x0000666700006667ULL, 0x0000666700006667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xfffffa5000004fa5ULL, 0x0000a4fbfffffa50ULL, },
+ { 0x00006c17000016c2ULL, 0xffffc16c00006c17ULL, },
+ { 0xffffe38fffff8e39ULL, 0x000038e4ffffe38fULL, }, /* 48 */
+ { 0xffffe38effff8e38ULL, 0x000038e3ffffe38eULL, },
+ { 0x000038e4ffffe38eULL, 0x00008e39000038e4ULL, },
+ { 0xffff8e39ffff38e3ULL, 0xffffe38effff8e39ULL, },
+ { 0x000016c2ffffc16cULL, 0x00006c17000016c2ULL, },
+ { 0xffffb05bffff5b05ULL, 0x000005b0ffffb05bULL, },
+ { 0xffffaaabffffaaaaULL, 0x0000aaabffffaaabULL, },
+ { 0x00001c72ffff71c7ULL, 0xffffc71c00001c72ULL, },
+ { 0x00001c72000071c8ULL, 0xffffc71d00001c72ULL, }, /* 56 */
+ { 0x00001c71000071c7ULL, 0xffffc71c00001c71ULL, },
+ { 0x000071c70000c71dULL, 0x00001c72000071c7ULL, },
+ { 0xffffc71c00001c72ULL, 0xffff71c7ffffc71cULL, },
+ { 0x00004fa50000a4fbULL, 0xfffffa5000004fa5ULL, },
+ { 0xffffe93e00003e94ULL, 0xffff93e9ffffe93eULL, },
+ { 0xffffe38e00008e39ULL, 0x000038e4ffffe38eULL, },
+ { 0x0000555500005556ULL, 0xffff555500005555ULL, },
+ { 0xffffa19effffd322ULL, 0x0000400900004e6fULL, }, /* 64 */
+ { 0xffff88070000615aULL, 0x0000904dffffab7fULL, },
+ { 0xffffd9c000009ce2ULL, 0x00008468ffffd967ULL, },
+ { 0xffff721d00004614ULL, 0x0000c28f00001bdbULL, },
+ { 0x000014f2fffff853ULL, 0x0000079900006533ULL, },
+ { 0xfffffb5b0000868bULL, 0x000057ddffffc243ULL, },
+ { 0x00004d140000c213ULL, 0x00004bf8fffff02bULL, },
+ { 0xffffe57100006b45ULL, 0x00008a1f0000329fULL, },
+ { 0xffffc58effff648fULL, 0x00001c7afffffb1fULL, }, /* 72 */
+ { 0xffffabf7fffff2c7ULL, 0x00006cbeffff582fULL, },
+ { 0xfffffdb000002e4fULL, 0x000060d9ffff8617ULL, },
+ { 0xffff960dffffd781ULL, 0x00009f00ffffc88bULL, },
+ { 0x00008983000008f1ULL, 0xffff8293fffff936ULL, },
+ { 0x00006fec00009729ULL, 0xffffd2d7ffff5646ULL, },
+ { 0x0000c1a50000d2b1ULL, 0xffffc6f2ffff842eULL, },
+ { 0x00005a0200007be3ULL, 0x00000519ffffc6a2ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c
new file mode 100644
index 0000000000..8f39a4525b
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HSUB_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "HSUB_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0x000000008e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0xffffffff00000001ULL, 0xffffffff00000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff55555556ULL, 0xffffffff55555556ULL, },
+ { 0xffffffffaaaaaaabULL, 0xffffffffaaaaaaabULL, },
+ { 0xffffffff33333334ULL, 0xffffffff33333334ULL, },
+ { 0xffffffffcccccccdULL, 0xffffffffcccccccdULL, },
+ { 0xffffffff71c71c72ULL, 0xffffffff1c71c71dULL, },
+ { 0xffffffff8e38e38fULL, 0xffffffffe38e38e4ULL, },
+ { 0xffffffffaaaaaaabULL, 0xffffffffaaaaaaabULL, }, /* 16 */
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0xffffffffdddddddeULL, 0xffffffffdddddddeULL, },
+ { 0x0000000077777777ULL, 0x0000000077777777ULL, },
+ { 0x000000001c71c71cULL, 0xffffffffc71c71c7ULL, },
+ { 0x0000000038e38e39ULL, 0x000000008e38e38eULL, },
+ { 0xffffffff55555556ULL, 0xffffffff55555556ULL, }, /* 24 */
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0xffffffffaaaaaaabULL, 0xffffffffaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff88888889ULL, 0xffffffff88888889ULL, },
+ { 0x0000000022222222ULL, 0x0000000022222222ULL, },
+ { 0xffffffffc71c71c7ULL, 0xffffffff71c71c72ULL, },
+ { 0xffffffffe38e38e4ULL, 0x0000000038e38e39ULL, },
+ { 0xffffffffcccccccdULL, 0xffffffffcccccccdULL, }, /* 32 */
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000022222222ULL, 0x0000000022222222ULL, },
+ { 0x0000000077777777ULL, 0x0000000077777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000099999999ULL, 0x0000000099999999ULL, },
+ { 0x000000003e93e93eULL, 0xffffffffe93e93e9ULL, },
+ { 0x000000005b05b05bULL, 0x00000000b05b05b0ULL, },
+ { 0xffffffff33333334ULL, 0xffffffff33333334ULL, }, /* 40 */
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0xffffffff88888889ULL, 0xffffffff88888889ULL, },
+ { 0xffffffffdddddddeULL, 0xffffffffdddddddeULL, },
+ { 0xffffffff66666667ULL, 0xffffffff66666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffa4fa4fa5ULL, 0xffffffff4fa4fa50ULL, },
+ { 0xffffffffc16c16c2ULL, 0x0000000016c16c17ULL, },
+ { 0xffffffffe38e38e4ULL, 0xffffffff38e38e39ULL, }, /* 48 */
+ { 0x00000000e38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0x0000000038e38e39ULL, 0xffffffff8e38e38eULL, },
+ { 0x000000008e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0x0000000016c16c17ULL, 0xffffffff6c16c16cULL, },
+ { 0x00000000b05b05b0ULL, 0x0000000005b05b05ULL, },
+ { 0x0000000055555555ULL, 0xffffffff55555555ULL, },
+ { 0x0000000071c71c72ULL, 0x000000001c71c71cULL, },
+ { 0xffffffff1c71c71dULL, 0xffffffffc71c71c8ULL, }, /* 56 */
+ { 0x000000001c71c71cULL, 0x00000000c71c71c7ULL, },
+ { 0xffffffff71c71c72ULL, 0x000000001c71c71dULL, },
+ { 0xffffffffc71c71c7ULL, 0x0000000071c71c72ULL, },
+ { 0xffffffff4fa4fa50ULL, 0xfffffffffa4fa4fbULL, },
+ { 0xffffffffe93e93e9ULL, 0x0000000093e93e94ULL, },
+ { 0xffffffff8e38e38eULL, 0xffffffffe38e38e4ULL, },
+ { 0xffffffffaaaaaaabULL, 0x00000000aaaaaaabULL, },
+ { 0x000000006008918cULL, 0xffffffff4ceb5b52ULL, }, /* 64 */
+ { 0x000000003ad71fc4ULL, 0x000000003627b862ULL, },
+ { 0xffffffffce9b5b4cULL, 0xffffffffa03be64aULL, },
+ { 0x000000002a39047eULL, 0xffffffffa22428beULL, },
+ { 0x00000000d35bab23ULL, 0xffffffff147c0b0eULL, },
+ { 0x00000000ae2a395bULL, 0xfffffffffdb8681eULL, },
+ { 0x0000000041ee74e3ULL, 0xffffffff67cc9606ULL, },
+ { 0x000000009d8c1e15ULL, 0xffffffff69b4d87aULL, },
+ { 0x0000000083f8596aULL, 0xffffffff295d16f3ULL, }, /* 72 */
+ { 0x000000005ec6e7a2ULL, 0x0000000012997403ULL, },
+ { 0xfffffffff28b232aULL, 0xffffffff7cada1ebULL, },
+ { 0x000000004e28cc5cULL, 0xffffffff7e95e45fULL, },
+ { 0x0000000047ecc10dULL, 0xffffffff8f75d8ccULL, },
+ { 0x0000000022bb4f45ULL, 0x0000000078b235dcULL, },
+ { 0xffffffffb67f8acdULL, 0xffffffffe2c663c4ULL, },
+ { 0x00000000121d33ffULL, 0xffffffffe4aea638ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_h.c
new file mode 100644
index 0000000000..6cc82fce29
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HSUB_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "HSUB_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0071001c00c70071ULL, 0x001c00c70071001cULL, },
+ { 0x008e00e30038008eULL, 0x00e30038008e00e3ULL, },
+ { 0xff01ff01ff01ff01ULL, 0xff01ff01ff01ff01ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff56ff56ff56ff56ULL, 0xff56ff56ff56ff56ULL, },
+ { 0xffabffabffabffabULL, 0xffabffabffabffabULL, },
+ { 0xff34ff34ff34ff34ULL, 0xff34ff34ff34ff34ULL, },
+ { 0xffcdffcdffcdffcdULL, 0xffcdffcdffcdffcdULL, },
+ { 0xff72ff1dffc8ff72ULL, 0xff1dffc8ff72ff1dULL, },
+ { 0xff8fffe4ff39ff8fULL, 0xffe4ff39ff8fffe4ULL, },
+ { 0xffabffabffabffabULL, 0xffabffabffabffabULL, }, /* 16 */
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0xffdeffdeffdeffdeULL, 0xffdeffdeffdeffdeULL, },
+ { 0x0077007700770077ULL, 0x0077007700770077ULL, },
+ { 0x001cffc70072001cULL, 0xffc70072001cffc7ULL, },
+ { 0x0039008effe30039ULL, 0x008effe30039008eULL, },
+ { 0xff56ff56ff56ff56ULL, 0xff56ff56ff56ff56ULL, }, /* 24 */
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0xffabffabffabffabULL, 0xffabffabffabffabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xff89ff89ff89ff89ULL, 0xff89ff89ff89ff89ULL, },
+ { 0x0022002200220022ULL, 0x0022002200220022ULL, },
+ { 0xffc7ff72001dffc7ULL, 0xff72001dffc7ff72ULL, },
+ { 0xffe40039ff8effe4ULL, 0x0039ff8effe40039ULL, },
+ { 0xffcdffcdffcdffcdULL, 0xffcdffcdffcdffcdULL, }, /* 32 */
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0022002200220022ULL, 0x0022002200220022ULL, },
+ { 0x0077007700770077ULL, 0x0077007700770077ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0099009900990099ULL, 0x0099009900990099ULL, },
+ { 0x003effe90094003eULL, 0xffe90094003effe9ULL, },
+ { 0x005b00b00005005bULL, 0x00b00005005b00b0ULL, },
+ { 0xff34ff34ff34ff34ULL, 0xff34ff34ff34ff34ULL, }, /* 40 */
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0xff89ff89ff89ff89ULL, 0xff89ff89ff89ff89ULL, },
+ { 0xffdeffdeffdeffdeULL, 0xffdeffdeffdeffdeULL, },
+ { 0xff67ff67ff67ff67ULL, 0xff67ff67ff67ff67ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffa5ff50fffbffa5ULL, 0xff50fffbffa5ff50ULL, },
+ { 0xffc20017ff6cffc2ULL, 0x0017ff6cffc20017ULL, },
+ { 0xffe4ff39ff8fffe4ULL, 0xff39ff8fffe4ff39ULL, }, /* 48 */
+ { 0x00e30038008e00e3ULL, 0x0038008e00e30038ULL, },
+ { 0x0039ff8effe40039ULL, 0xff8effe40039ff8eULL, },
+ { 0x008effe30039008eULL, 0xffe30039008effe3ULL, },
+ { 0x0017ff6cffc20017ULL, 0xff6cffc20017ff6cULL, },
+ { 0x00b00005005b00b0ULL, 0x0005005b00b00005ULL, },
+ { 0x0055ff5500560055ULL, 0xff5500560055ff55ULL, },
+ { 0x0072001cffc70072ULL, 0x001cffc70072001cULL, },
+ { 0xff1dffc8ff72ff1dULL, 0xffc8ff72ff1dffc8ULL, }, /* 56 */
+ { 0x001c00c70071001cULL, 0x00c70071001c00c7ULL, },
+ { 0xff72001dffc7ff72ULL, 0x001dffc7ff72001dULL, },
+ { 0xffc70072001cffc7ULL, 0x0072001cffc70072ULL, },
+ { 0xff50fffbffa5ff50ULL, 0xfffbffa5ff50fffbULL, },
+ { 0xffe90094003effe9ULL, 0x0094003effe90094ULL, },
+ { 0xff8effe40039ff8eULL, 0xffe40039ff8effe4ULL, },
+ { 0xffab00abffaaffabULL, 0x00abffaaffab00abULL, },
+ { 0x001e001affc60015ULL, 0xffe4ffad008300a4ULL, }, /* 64 */
+ { 0xffca0083ff95004dULL, 0xff54fff100bfffb4ULL, },
+ { 0x002e003cff59ffd5ULL, 0xff73ff0c00d3009cULL, },
+ { 0x00390099fff70007ULL, 0xff5aff3300bc0010ULL, },
+ { 0x0091ff34ffeb0087ULL, 0xffab005dff9a0046ULL, },
+ { 0x003dff9dffba00bfULL, 0xff1b00a1ffd6ff56ULL, },
+ { 0x00a1ff56ff7e0047ULL, 0xff3affbcffea003eULL, },
+ { 0x00acffb3001c0079ULL, 0xff21ffe3ffd3ffb2ULL, },
+ { 0x0042ffe20057004bULL, 0xffc0006800300019ULL, }, /* 72 */
+ { 0xffee004b00260083ULL, 0xff3000ac006cff29ULL, },
+ { 0x00520004ffea000bULL, 0xff4fffc700800011ULL, },
+ { 0x005d00610088003dULL, 0xff36ffee0069ff85ULL, },
+ { 0x0006ff4afffc00a2ULL, 0x0026002a002e00d6ULL, },
+ { 0xffb2ffb3ffcb00daULL, 0xff96006e006affe6ULL, },
+ { 0x0016ff6cff8f0062ULL, 0xffb5ff89007e00ceULL, },
+ { 0x0021ffc9002d0094ULL, 0xff9cffb000670042ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_w.c
new file mode 100644
index 0000000000..b427e87a3a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_hsub_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction HSUB_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "HSUB_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000c71c00001c71ULL, 0x000071c70000c71cULL, },
+ { 0x000038e30000e38eULL, 0x00008e38000038e3ULL, },
+ { 0xffff0001ffff0001ULL, 0xffff0001ffff0001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff5556ffff5556ULL, 0xffff5556ffff5556ULL, },
+ { 0xffffaaabffffaaabULL, 0xffffaaabffffaaabULL, },
+ { 0xffff3334ffff3334ULL, 0xffff3334ffff3334ULL, },
+ { 0xffffcccdffffcccdULL, 0xffffcccdffffcccdULL, },
+ { 0xffffc71dffff1c72ULL, 0xffff71c8ffffc71dULL, },
+ { 0xffff38e4ffffe38fULL, 0xffff8e39ffff38e4ULL, },
+ { 0xffffaaabffffaaabULL, 0xffffaaabffffaaabULL, }, /* 16 */
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0xffffdddeffffdddeULL, 0xffffdddeffffdddeULL, },
+ { 0x0000777700007777ULL, 0x0000777700007777ULL, },
+ { 0x000071c7ffffc71cULL, 0x00001c72000071c7ULL, },
+ { 0xffffe38e00008e39ULL, 0x000038e3ffffe38eULL, },
+ { 0xffff5556ffff5556ULL, 0xffff5556ffff5556ULL, }, /* 24 */
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0xffffaaabffffaaabULL, 0xffffaaabffffaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffff8889ffff8889ULL, 0xffff8889ffff8889ULL, },
+ { 0x0000222200002222ULL, 0x0000222200002222ULL, },
+ { 0x00001c72ffff71c7ULL, 0xffffc71d00001c72ULL, },
+ { 0xffff8e39000038e4ULL, 0xffffe38effff8e39ULL, },
+ { 0xffffcccdffffcccdULL, 0xffffcccdffffcccdULL, }, /* 32 */
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000222200002222ULL, 0x0000222200002222ULL, },
+ { 0x0000777700007777ULL, 0x0000777700007777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000999900009999ULL, 0x0000999900009999ULL, },
+ { 0x000093e9ffffe93eULL, 0x00003e94000093e9ULL, },
+ { 0x000005b00000b05bULL, 0x00005b05000005b0ULL, },
+ { 0xffff3334ffff3334ULL, 0xffff3334ffff3334ULL, }, /* 40 */
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0xffff8889ffff8889ULL, 0xffff8889ffff8889ULL, },
+ { 0xffffdddeffffdddeULL, 0xffffdddeffffdddeULL, },
+ { 0xffff6667ffff6667ULL, 0xffff6667ffff6667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xfffffa50ffff4fa5ULL, 0xffffa4fbfffffa50ULL, },
+ { 0xffff6c17000016c2ULL, 0xffffc16cffff6c17ULL, },
+ { 0xffffe38fffff8e39ULL, 0xffff38e4ffffe38fULL, }, /* 48 */
+ { 0x0000e38e00008e38ULL, 0x000038e30000e38eULL, },
+ { 0x000038e4ffffe38eULL, 0xffff8e39000038e4ULL, },
+ { 0x00008e39000038e3ULL, 0xffffe38e00008e39ULL, },
+ { 0x000016c2ffffc16cULL, 0xffff6c17000016c2ULL, },
+ { 0x0000b05b00005b05ULL, 0x000005b00000b05bULL, },
+ { 0x0000aaabffffaaaaULL, 0xffffaaab0000aaabULL, },
+ { 0x00001c72000071c7ULL, 0xffffc71c00001c72ULL, },
+ { 0xffff1c72ffff71c8ULL, 0xffffc71dffff1c72ULL, }, /* 56 */
+ { 0x00001c71000071c7ULL, 0x0000c71c00001c71ULL, },
+ { 0xffff71c7ffffc71dULL, 0x00001c72ffff71c7ULL, },
+ { 0xffffc71c00001c72ULL, 0x000071c7ffffc71cULL, },
+ { 0xffff4fa5ffffa4fbULL, 0xfffffa50ffff4fa5ULL, },
+ { 0xffffe93e00003e94ULL, 0x000093e9ffffe93eULL, },
+ { 0xffffe38effff8e39ULL, 0x000038e4ffffe38eULL, },
+ { 0xffff555500005556ULL, 0x00005555ffff5555ULL, },
+ { 0xffffa19effffd322ULL, 0x0000400900004e6fULL, }, /* 64 */
+ { 0x00008807ffff615aULL, 0xffff904d0000ab7fULL, },
+ { 0xffffd9c0ffff9ce2ULL, 0xffff84680000d967ULL, },
+ { 0x0000721dffff4614ULL, 0xffffc28f00001bdbULL, },
+ { 0x000014f2fffff853ULL, 0x00000799ffff6533ULL, },
+ { 0x0000fb5bffff868bULL, 0xffff57ddffffc243ULL, },
+ { 0x00004d14ffffc213ULL, 0xffff4bf8fffff02bULL, },
+ { 0x0000e571ffff6b45ULL, 0xffff8a1fffff329fULL, },
+ { 0xffffc58e0000648fULL, 0x00001c7afffffb1fULL, }, /* 72 */
+ { 0x0000abf7fffff2c7ULL, 0xffff6cbe0000582fULL, },
+ { 0xfffffdb000002e4fULL, 0xffff60d900008617ULL, },
+ { 0x0000960dffffd781ULL, 0xffff9f00ffffc88bULL, },
+ { 0xffff8983000008f1ULL, 0x00008293fffff936ULL, },
+ { 0x00006fecffff9729ULL, 0xffffd2d700005646ULL, },
+ { 0xffffc1a5ffffd2b1ULL, 0xffffc6f20000842eULL, },
+ { 0x00005a02ffff7be3ULL, 0x00000519ffffc6a2ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_HSUB_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c
new file mode 100644
index 0000000000..5c1f810d66
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, },
+ { 0xababababababababULL, 0xababababababababULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xc71c80c71c80c71cULL, 0x80c71c80c71c80c7ULL, },
+ { 0x8e80e38e80e38e80ULL, 0xe38e80e38e80e38eULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x727f1d727f1d727fULL, 0x1d727f1d727f1d72ULL, },
+ { 0x39e47f39e47f39e4ULL, 0x7f39e47f39e47f39ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, },
+ { 0xb08005b08005b080ULL, 0x05b08005b08005b0ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x507ffb507ffb507fULL, 0xfb507ffb507ffb50ULL, },
+ { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x39e47f39e47f39e4ULL, 0x7f39e47f39e47f39ULL, },
+ { 0x8e80e38e80e38e80ULL, 0xe38e80e38e80e38eULL, },
+ { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, },
+ { 0xb08005b08005b080ULL, 0x05b08005b08005b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc78071c78071c780ULL, 0x71c78071c78071c7ULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x727f1d727f1d727fULL, 0x1d727f1d727f1d72ULL, },
+ { 0xc71c80c71c80c71cULL, 0x80c71c80c71c80c7ULL, },
+ { 0x507ffb507ffb507fULL, 0xfb507ffb507ffb50ULL, },
+ { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, },
+ { 0x397f8f397f8f397fULL, 0x8f397f8f397f8f39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8d7fe680db7f7f38ULL, 0x39705044e93c8010ULL, },
+ { 0xdc1038226f7f7f7fULL, 0x247f455f53508bf8ULL, },
+ { 0x801bd080ca3173f2ULL, 0x7f767f7f5539ce6cULL, },
+ { 0x73801a7f258080c8ULL, 0xc790b0bc17c47ff0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f80527f7fc43c7fULL, 0xeb1ff51b6a142de8ULL, },
+ { 0x8b80ea16ef80e5baULL, 0x7f0633426cfd705cULL, },
+ { 0x24f0c8de91808080ULL, 0xdc80bba1adb07508ULL, }, /* 72 */
+ { 0xb17fae80803cc480ULL, 0x15e10be596ecd318ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x800b9880809ea980ULL, 0x7fe73e2702e94374ULL, },
+ { 0x7fe5307f36cf8d0eULL, 0x808a8080abc73294ULL, },
+ { 0x757f16ea117f1b46ULL, 0x80facdbe940390a4ULL, },
+ { 0x7ff5687f7f62577fULL, 0x8019c2d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c
new file mode 100644
index 0000000000..546c24c5c2
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x8000000000000000ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x7fffffffffffffffULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x7fffffffffffffffULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0x8000000000000000ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0x8000000000000000ULL, 0x7fffffffffffffffULL, },
+ { 0x73531997253171c8ULL, 0xc790afbb16c3a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0xeb1ef41a6a142de8ULL, },
+ { 0x8b6eea15ef61e4baULL, 0x7fffffffffffffffULL, },
+ { 0x23efc7de916d3640ULL, 0xdc71bba0acaf7508ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000000000000ULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x8000000000000000ULL, },
+ { 0x749115ea109e1b46ULL, 0x8000000000000000ULL, },
+ { 0x7fffffffffffffffULL, 0x8000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c
new file mode 100644
index 0000000000..24ddc826c3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xc71c80001c72c71cULL, 0x80001c72c71c8000ULL, },
+ { 0x8e39e38e80008e39ULL, 0xe38e80008e39e38eULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c727fff71c7ULL, 0x1c727fff71c71c72ULL, },
+ { 0x38e47fffe38e38e4ULL, 0x7fffe38e38e47fffULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0xb05b05b08000b05bULL, 0x05b08000b05b05b0ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa5fa507fff4fa5ULL, 0xfa507fff4fa5fa50ULL, },
+ { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e47fffe38e38e4ULL, 0x7fffe38e38e47fffULL, },
+ { 0x8e39e38e80008e39ULL, 0xe38e80008e39e38eULL, },
+ { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, },
+ { 0xb05b05b08000b05bULL, 0x05b08000b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d71c78000c71dULL, 0x71c78000c71d71c7ULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c727fff71c7ULL, 0x1c727fff71c71c72ULL, },
+ { 0xc71c80001c72c71cULL, 0x80001c72c71c8000ULL, },
+ { 0x4fa5fa507fff4fa5ULL, 0xfa507fff4fa5fa50ULL, },
+ { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0x38e38e397fff38e3ULL, 0x8e397fff38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace669dacf7fffULL, 0x38705044e93c8000ULL, },
+ { 0xdc1038226e937fffULL, 0x238f445f53508af8ULL, },
+ { 0x8000d07fca3172f2ULL, 0x7fff7fff5539cd6cULL, },
+ { 0x7354199725318000ULL, 0xc790afbc16c47fffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6451b97fff3b88ULL, 0xeb1ff41b6a142de8ULL, },
+ { 0x8b6fea16ef62e4baULL, 0x7fff32426bfd705cULL, },
+ { 0x23f0c7de916d8000ULL, 0xdc71bba1acb07508ULL, }, /* 72 */
+ { 0xb09cae478000c478ULL, 0x14e10be595ecd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000985d8000a932ULL, 0x7fff3e2701e94274ULL, },
+ { 0x7fff2f8135cf8d0eULL, 0x80008000aac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x8000cdbe94038fa4ULL, },
+ { 0x7fff67a37fff56ceULL, 0x8000c1d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c
new file mode 100644
index 0000000000..f6109a5331
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x80000000c71c71c7ULL, },
+ { 0x8e38e38e80000000ULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c727fffffffULL, 0x1c71c71d71c71c72ULL, },
+ { 0x38e38e39e38e38e4ULL, 0x7fffffff38e38e39ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0xb05b05b080000000ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa507fffffffULL, 0xfa4fa4fb4fa4fa50ULL, },
+ { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e39e38e38e4ULL, 0x7fffffff38e38e39ULL, },
+ { 0x8e38e38e80000000ULL, 0xe38e38e38e38e38eULL, },
+ { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xb05b05b080000000ULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c780000000ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c727fffffffULL, 0x1c71c71d71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0x80000000c71c71c7ULL, },
+ { 0x4fa4fa507fffffffULL, 0xfa4fa4fb4fa4fa50ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0x38e38e397fffffffULL, 0x8e38e38f38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace669dace8e38ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038226e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0x80000000ca3072f2ULL, 0x7fffffff5538cd6cULL, },
+ { 0x73531997253171c8ULL, 0xc790afbc16c3a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b97fffffffULL, 0xeb1ef41b6a142de8ULL, },
+ { 0x8b6eea16ef61e4baULL, 0x7fffffff6bfc705cULL, },
+ { 0x23efc7de916d3640ULL, 0xdc71bba1acaf7508ULL, }, /* 72 */
+ { 0xb09cae4780000000ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000080000000ULL, 0x7fffffff01e84274ULL, },
+ { 0x7fffffff35cf8d0eULL, 0x80000000aac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x8000000094038fa4ULL, },
+ { 0x7fffffff7fffffffULL, 0x80000000fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c
new file mode 100644
index 0000000000..f170912348
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x001c72001c72001cULL, 0x72001c72001c7200ULL, },
+ { 0x8e39008e39008e39ULL, 0x008e39008e39008eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x00001d00001d0000ULL, 0x1d00001d00001d00ULL, },
+ { 0x3900003900003900ULL, 0x0039000039000039ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x003e94003e94003eULL, 0x94003e94003e9400ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1700001700001700ULL, 0x0017000017000017ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3900003900003900ULL, 0x0039000039000039ULL, },
+ { 0x8e39008e39008e39ULL, 0x008e39008e39008eULL, },
+ { 0x1700001700001700ULL, 0x0017000017000017ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d00c71d00c71dULL, 0x00c71d00c71d00c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00001d00001d0000ULL, 0x1d00001d00001d00ULL, },
+ { 0x001c72001c72001cULL, 0x72001c72001c7200ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x003e94003e94003eULL, 0x94003e94003e9400ULL, },
+ { 0x00008f00008f0000ULL, 0x8f00008f00008f00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x0000e66900000038ULL, 0x39000044e93c5e00ULL, },
+ { 0x0010382200000000ULL, 0x2400000053508b00ULL, },
+ { 0x181bd07f00310000ULL, 0x0000000055390000ULL, },
+ { 0x7354000025317200ULL, 0x0090b000000000f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f64000000003c00ULL, 0x001f000000142de8ULL, },
+ { 0x8b6f001600620000ULL, 0x000633000000005cULL, },
+ { 0x24000000916d3640ULL, 0x0071bba100000008ULL, }, /* 72 */
+ { 0x0000ae476c3c0078ULL, 0x15000be596000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9e0032ULL, 0x00003e2702000000ULL, },
+ { 0x0000000036008d0eULL, 0x428a7d7a00003294ULL, },
+ { 0x0000160011001b46ULL, 0x7b0000be94039000ULL, },
+ { 0x0000000000005700ULL, 0x661900000017bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c
new file mode 100644
index 0000000000..bf647db221
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x0000000000000000ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x0000000000000000ULL, 0x93e93e93e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x0000000000000000ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x0000000000000000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x0000000000000000ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x93e93e93e93e93e9ULL, },
+ { 0x0000000000000000ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x386f5044e93c5d10ULL, },
+ { 0x0000000000000000ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07eca3072f2ULL, 0x0000000000000000ULL, },
+ { 0x73531997253171c8ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0x0000000000000000ULL, },
+ { 0x8b6eea15ef61e4baULL, 0x0000000000000000ULL, },
+ { 0x23efc7de916d3640ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x428a7d79aac73294ULL, },
+ { 0x0000000000000000ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0x0000000000000000ULL, 0x6618c1d8fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c
new file mode 100644
index 0000000000..c4616be3e9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x000071c71c720000ULL, 0x71c71c72000071c7ULL, },
+ { 0x8e39000038e38e39ULL, 0x000038e38e390000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x00001c7200000000ULL, 0x1c72000000001c72ULL, },
+ { 0x38e40000000038e4ULL, 0x0000000038e40000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x000093e93e940000ULL, 0x93e93e94000093e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x16c20000000016c2ULL, 0x0000000016c20000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e40000000038e4ULL, 0x0000000038e40000ULL, },
+ { 0x8e39000038e38e39ULL, 0x000038e38e390000ULL, },
+ { 0x16c20000000016c2ULL, 0x0000000016c20000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d00001c71c71dULL, 0x00001c71c71d0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00001c7200000000ULL, 0x1c72000000001c72ULL, },
+ { 0x000071c71c720000ULL, 0x71c71c72000071c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000093e93e940000ULL, 0x93e93e94000093e9ULL, },
+ { 0x00008e3900000000ULL, 0x8e39000000008e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x0000e66900000000ULL, 0x38700000e93c5d10ULL, },
+ { 0x0000382200000000ULL, 0x238f000053508af8ULL, },
+ { 0x181bd07f00000000ULL, 0x0000000055390000ULL, },
+ { 0x73540000253171c8ULL, 0x0000afbc00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f64000000003b88ULL, 0x0000000000002de8ULL, },
+ { 0x8b6f000000000000ULL, 0x0000324200000000ULL, },
+ { 0x23f00000916d3640ULL, 0x0000bba100000000ULL, }, /* 72 */
+ { 0x0000ae476c3c0000ULL, 0x14e10be595ec0000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9e0000ULL, 0x00003e2701e90000ULL, },
+ { 0x0000000035cf8d0eULL, 0x428a7d7a00003294ULL, },
+ { 0x000015ea109e1b46ULL, 0x7afa000094038fa4ULL, },
+ { 0x00000000000056ceULL, 0x661900000000bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c
new file mode 100644
index 0000000000..61052672ca
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBS_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBS_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x000000001c71c71cULL, 0x71c71c7200000000ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x000000008e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x0000000000000000ULL, 0x1c71c71d00000000ULL, },
+ { 0x38e38e3900000000ULL, 0x0000000038e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x000000003e93e93eULL, 0x93e93e9400000000ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x16c16c1700000000ULL, 0x0000000016c16c17ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e3900000000ULL, 0x0000000038e38e39ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x000000008e38e38eULL, },
+ { 0x16c16c1700000000ULL, 0x0000000016c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x00000000c71c71c7ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x1c71c71d00000000ULL, },
+ { 0x000000001c71c71cULL, 0x71c71c7200000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x000000003e93e93eULL, 0x93e93e9400000000ULL, },
+ { 0x0000000000000000ULL, 0x8e38e38f00000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x386f5044e93c5d10ULL, },
+ { 0x0000000000000000ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07f00000000ULL, 0x000000005538cd6cULL, },
+ { 0x73531997253171c8ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b900000000ULL, 0x0000000000000000ULL, },
+ { 0x8b6eea1600000000ULL, 0x0000000000000000ULL, },
+ { 0x23efc7de916d3640ULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0x000000006c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x0000000001e84274ULL, },
+ { 0x0000000035cf8d0eULL, 0x428a7d7a00000000ULL, },
+ { 0x00000000109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0x0000000000000000ULL, 0x6618c1d900000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBS_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c
new file mode 100644
index 0000000000..71ea14fa2d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUS_U.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUS_U.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffc7ffffc7ffffULL, 0xc7ffffc7ffffc7ffULL, },
+ { 0xe38effe38effe38eULL, 0xffe38effe38effe3ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1d72001d72001d72ULL, 0x001d72001d72001dULL, },
+ { 0x0000390000390000ULL, 0x3900003900003900ULL, },
+ { 0xababababababababULL, 0xababababababababULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc7ff72c7ff72c7ffULL, 0x72c7ff72c7ff72c7ULL, },
+ { 0x8e39e38e39e38e39ULL, 0xe38e39e38e39e38eULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0x39008e39008e3900ULL, 0x8e39008e39008e39ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe9ff94e9ff94e9ffULL, 0x94e9ff94e9ff94e9ULL, },
+ { 0xb05bffb05bffb05bULL, 0xffb05bffb05bffb0ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x50a50050a50050a5ULL, 0x0050a50050a50050ULL, },
+ { 0x17006c17006c1700ULL, 0x6c17006c17006c17ULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffe48effe48effe4ULL, 0x8effe48effe48effULL, },
+ { 0x8e39008e39008e39ULL, 0x008e39008e39008eULL, },
+ { 0xffc26cffc26cffc2ULL, 0x6cffc26cffc26cffULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, },
+ { 0xc71d71c71d71c71dULL, 0x71c71d71c71d71c7ULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x72c7ff72c7ff72c7ULL, 0xff72c7ff72c7ff72ULL, },
+ { 0x001c72001c72001cULL, 0x72001c72001c7200ULL, },
+ { 0x50a5fb50a5fb50a5ULL, 0xfb50a5fb50a5fb50ULL, },
+ { 0x003e94003e94003eULL, 0x94003e94003e9400ULL, },
+ { 0x39e38f39e38f39e3ULL, 0x8f39e38f39e38f39ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0xff00ffff00000000ULL, 0x00000000ff00ff00ULL, }, /* 64 */
+ { 0x8dace66900cf8e38ULL, 0x39705044e93c5e10ULL, },
+ { 0xdc10ffff6f93cac0ULL, 0x248f455fff508b00ULL, },
+ { 0x181bd07f00317300ULL, 0xbe768386ff39ce6cULL, },
+ { 0xff541a9725317200ULL, 0x0090b0001700a2f0ULL, },
+ { 0xffff000000ffff00ULL, 0x00ffff00000000ffULL, },
+ { 0xff6452b994c4ff88ULL, 0x00fff51b6a142de8ULL, },
+ { 0x8b6f00160062e500ULL, 0x85ffff426c0070ffULL, },
+ { 0xff00c8de916d3640ULL, 0x0071bba1ad007508ULL, }, /* 72 */
+ { 0xb19cae476cffc478ULL, 0x15e1ffe596000018ULL, },
+ { 0xff00ffffffffffffULL, 0x00ffffffff000000ULL, },
+ { 0x3c0b985d5b9ea932ULL, 0x9ae7ffffff004374ULL, },
+ { 0xe800308136008d0eULL, 0x428a7d7aab00ff94ULL, },
+ { 0x75911600119eff46ULL, 0x7bfacdbe940390a4ULL, },
+ { 0xc40068a3a562ffceULL, 0x66ffc2d9fe17bd8cULL, },
+ { 0x000000000000ff00ULL, 0xffffffffff00ffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c
new file mode 100644
index 0000000000..070c457c44
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUS_U.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUS_U.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c72ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e4ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0x0000000000000000ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0x8e38e38e38e38e39ULL, },
+ { 0x8e38e38e38e38e39ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x6c16c16c16c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c71c71c71c7ULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x71c71c71c71c71c7ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0x0000000000000000ULL, 0x93e93e93e93e93e9ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07eca3072f2ULL, 0xbd7582865538cd6cULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x8b6eea15ef61e4baULL, 0x850632416bfc705cULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0x428a7d79aac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0xc3f467a2a46256ceULL, 0x6618c1d8fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c
new file mode 100644
index 0000000000..f98d010436
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUS_U.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUS_U.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffc71cffffffffULL, 0xc71cffffffffc71cULL, },
+ { 0xe38effff8e38e38eULL, 0xffff8e38e38effffULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c72000071c81c72ULL, 0x000071c81c720000ULL, },
+ { 0x000038e400000000ULL, 0x38e40000000038e4ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c7ffffc71cULL, 0x71c7ffffc71c71c7ULL, },
+ { 0x8e39e38e38e38e39ULL, 0xe38e38e38e39e38eULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0x38e48e39000038e4ULL, 0x8e39000038e48e39ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e9ffffe93eULL, 0x93e9ffffe93e93e9ULL, },
+ { 0xb05bffff5b05b05bULL, 0xffff5b05b05bffffULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa50000a4fb4fa5ULL, 0x0000a4fb4fa50000ULL, },
+ { 0x16c26c17000016c2ULL, 0x6c17000016c26c17ULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffff8e39e38effffULL, 0x8e39e38effff8e39ULL, },
+ { 0x8e39000038e38e39ULL, 0x000038e38e390000ULL, },
+ { 0xffff6c17c16cffffULL, 0x6c17c16cffff6c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0xc71d71c71c71c71dULL, 0x71c71c71c71d71c7ULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c7ffffc71d71c7ULL, 0xffffc71d71c7ffffULL, },
+ { 0x000071c71c720000ULL, 0x71c71c72000071c7ULL, },
+ { 0x4fa5fa50a4fb4fa5ULL, 0xfa50a4fb4fa5fa50ULL, },
+ { 0x000093e93e940000ULL, 0x93e93e94000093e9ULL, },
+ { 0x38e38e39e38f38e3ULL, 0x8e39e38f38e38e39ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, }, /* 64 */
+ { 0x8cace66900008e38ULL, 0x38705044e93c5d10ULL, },
+ { 0xdc10ffff6e93c9c0ULL, 0x238f445fffff8af8ULL, },
+ { 0x181bd07f000072f2ULL, 0xbd768286ffffcd6cULL, },
+ { 0xffff1997253171c8ULL, 0x0000afbc16c4a2f0ULL, },
+ { 0xffff00000000ffffULL, 0x0000ffff00000000ULL, },
+ { 0xffff51b993c4ffffULL, 0x0000f41b6a142de8ULL, },
+ { 0x8b6f00000000e4baULL, 0x8506ffff6bfd705cULL, },
+ { 0xffffc7de916d3640ULL, 0x0000bba1acb07508ULL, }, /* 72 */
+ { 0xb09cae476c3cc478ULL, 0x14e1ffff95ec0000ULL, },
+ { 0xffffffffffffffffULL, 0x0000ffffffff0000ULL, },
+ { 0x3c0b985d5b9ea932ULL, 0x99e7ffffffff4274ULL, },
+ { 0xe7e52f8135cf8d0eULL, 0x428a7d7aaac7ffffULL, },
+ { 0x749115ea109effffULL, 0x7afacdbe94038fa4ULL, },
+ { 0xc3f567a3a462ffffULL, 0x6619c1d9fe17bd8cULL, },
+ { 0x000000000000ffffULL, 0xffffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c
new file mode 100644
index 0000000000..d325c19217
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUS_U.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUS_U.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c7ffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71d71c71c72ULL, 0x000000001c71c71dULL, },
+ { 0x0000000000000000ULL, 0x38e38e3900000000ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c7ffffffffULL, 0x71c71c72c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0x38e38e3900000000ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e9ffffffffULL, 0x93e93e94e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0xffffffffb05b05b0ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0x000000004fa4fa50ULL, },
+ { 0x16c16c1700000000ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffe38e38e4ULL, 0x8e38e38effffffffULL, },
+ { 0x8e38e38e38e38e39ULL, 0x000000008e38e38eULL, },
+ { 0xffffffffc16c16c2ULL, 0x6c16c16cffffffffULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c72c71c71c7ULL, 0xffffffff71c71c72ULL, },
+ { 0x000000001c71c71cULL, 0x71c71c7200000000ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0xfa4fa4fb4fa4fa50ULL, },
+ { 0x000000003e93e93eULL, 0x93e93e9400000000ULL, },
+ { 0x38e38e39e38e38e3ULL, 0x8e38e38f38e38e39ULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffff00000000ULL, 0x00000000ffffffffULL, }, /* 64 */
+ { 0x8cace66900000000ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038226e92c9c0ULL, 0x238e445fffffffffULL, },
+ { 0x181bd07f00000000ULL, 0xbd758286ffffffffULL, },
+ { 0xffffffff253171c8ULL, 0x0000000016c3a2f0ULL, },
+ { 0xffffffff00000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffff93c43b88ULL, 0x000000006a142de8ULL, },
+ { 0x8b6eea1600000000ULL, 0x850632426bfc705cULL, },
+ { 0xffffffff916d3640ULL, 0x00000000acaf7508ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, },
+ { 0x3c0b985d5b9da932ULL, 0x99e73e27ffffffffULL, },
+ { 0xe7e42f8135cf8d0eULL, 0x428a7d7aaac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0xc3f467a3a46256ceULL, 0x6618c1d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUS_U_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c
new file mode 100644
index 0000000000..66012b5894
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUU_S.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUU_S.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x1c717f1c717f1c71ULL, 0x7f1c717f1c717f1cULL, },
+ { 0x7f7f387f7f387f7fULL, 0x387f7f387f7f387fULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, },
+ { 0x8080c88080c88080ULL, 0xc88080c88080c880ULL, },
+ { 0xe48f80e48f80e48fULL, 0x80e48f80e48f80e4ULL, },
+ { 0xababababababababULL, 0xababababababababULL, }, /* 16 */
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, },
+ { 0x7f39e37f39e37f39ULL, 0xe37f39e37f39e37fULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x80c71d80c71d80c7ULL, 0x1d80c71d80c71d80ULL, },
+ { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7f7f7f7f7f7f7f7fULL, 0x7f7f7f7f7f7f7f7fULL, },
+ { 0xe93e7fe93e7fe93eULL, 0x7fe93e7fe93e7fe9ULL, },
+ { 0x7f5b057f5b057f5bULL, 0x057f5b057f5b057fULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x80a5fb80a5fb80a5ULL, 0xfb80a5fb80a5fb80ULL, },
+ { 0x17c28017c28017c2ULL, 0x8017c28017c28017ULL, },
+ { 0xe48f80e48f80e48fULL, 0x80e48f80e48f80e4ULL, }, /* 48 */
+ { 0x7f7f387f7f387f7fULL, 0x387f7f387f7f387fULL, },
+ { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, },
+ { 0x7f39e37f39e37f39ULL, 0xe37f39e37f39e37fULL, },
+ { 0x17c28017c28017c2ULL, 0x8017c28017c28017ULL, },
+ { 0x7f5b057f5b057f5bULL, 0x057f5b057f5b057fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7f1d807f1d807f1dULL, 0x807f1d807f1d807fULL, },
+ { 0x8080c88080c88080ULL, 0xc88080c88080c880ULL, }, /* 56 */
+ { 0x1c717f1c717f1c71ULL, 0x7f1c717f1c717f1cULL, },
+ { 0x80c71d80c71d80c7ULL, 0x1d80c71d80c71d80ULL, },
+ { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, },
+ { 0x80a5fb80a5fb80a5ULL, 0xfb80a5fb80a5fb80ULL, },
+ { 0xe93e7fe93e7fe93eULL, 0x7fe93e7fe93e7fe9ULL, },
+ { 0x80e37f80e37f80e3ULL, 0x7f80e37f80e37f80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8dac7f69dbcf8e38ULL, 0x398080447f3c5e80ULL, },
+ { 0xdc1038228093cac0ULL, 0x248f808053507ff8ULL, },
+ { 0x181b7f7fca3180f2ULL, 0xbe8083865539ce80ULL, },
+ { 0x73548097253172c8ULL, 0xc77f7fbc80c4a27fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6480b994c43c88ULL, 0xeb1ff58080142d7fULL, },
+ { 0x7f6fea16ef62e5baULL, 0x8506338080fd805cULL, },
+ { 0x24f0c8de7f6d3640ULL, 0xdc717f7fadb08008ULL, }, /* 72 */
+ { 0xb19c7f476c3cc478ULL, 0x15e10b7f7fecd380ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b7f5d5b7fa932ULL, 0x9ae73e2702e98080ULL, },
+ { 0xe8e5808136cf7f0eULL, 0x427f7d7aabc7327fULL, },
+ { 0x809116ea119e1b46ULL, 0x7bfacd7f7f037fa4ULL, },
+ { 0xc4f580a3a58057ceULL, 0x6619c2d9fe177f7fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c
new file mode 100644
index 0000000000..344a373055
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUU_S.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUU_S.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, },
+ { 0x8000000000000000ULL, 0xc71c71c71c71c71dULL, },
+ { 0xe38e38e38e38e38fULL, 0x8000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x7fffffffffffffffULL, 0xe38e38e38e38e38eULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8000000000000000ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fffffffffffffffULL, 0x7fffffffffffffffULL, },
+ { 0xe93e93e93e93e93eULL, 0x7fffffffffffffffULL, },
+ { 0x7fffffffffffffffULL, 0x05b05b05b05b05b0ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000000000000ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x8000000000000000ULL, },
+ { 0xe38e38e38e38e38fULL, 0x8000000000000000ULL, }, /* 48 */
+ { 0x7fffffffffffffffULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x7fffffffffffffffULL, 0xe38e38e38e38e38eULL, },
+ { 0x16c16c16c16c16c2ULL, 0x8000000000000000ULL, },
+ { 0x7fffffffffffffffULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fffffffffffffffULL, 0x8000000000000000ULL, },
+ { 0x8000000000000000ULL, 0xc71c71c71c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x7fffffffffffffffULL, },
+ { 0x8000000000000000ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x8000000000000000ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0xe93e93e93e93e93eULL, 0x7fffffffffffffffULL, },
+ { 0x8000000000000000ULL, 0x7fffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07eca3072f2ULL, 0xbd7582865538cd6cULL, },
+ { 0x73531997253171c8ULL, 0xc790afbb16c3a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0xeb1ef41a6a142de8ULL, },
+ { 0x7fffffffffffffffULL, 0x850632416bfc705cULL, },
+ { 0x23efc7de916d3640ULL, 0xdc71bba0acaf7508ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0x428a7d79aac73294ULL, },
+ { 0x8000000000000000ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0xc3f467a2a46256ceULL, 0x6618c1d8fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c
new file mode 100644
index 0000000000..1cacb26395
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUU_S.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUU_S.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x1c717fff71c71c71ULL, 0x7fff71c71c717fffULL, },
+ { 0x7fff38e37fff7fffULL, 0x38e37fff7fff38e3ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, },
+ { 0x8000c71d80008000ULL, 0xc71d80008000c71dULL, },
+ { 0xe38f80008e39e38fULL, 0x80008e39e38f8000ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x7fffe38e38e37fffULL, 0xe38e38e37fffe38eULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x80001c72c71d8000ULL, 0x1c72c71d80001c72ULL, },
+ { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fff7fff7fff7fffULL, 0x7fff7fff7fff7fffULL, },
+ { 0xe93e7fff3e94e93eULL, 0x7fff3e94e93e7fffULL, },
+ { 0x7fff05b05b057fffULL, 0x05b05b057fff05b0ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000fa50a4fb8000ULL, 0xfa50a4fb8000fa50ULL, },
+ { 0x16c28000c16c16c2ULL, 0x8000c16c16c28000ULL, },
+ { 0xe38f80008e39e38fULL, 0x80008e39e38f8000ULL, }, /* 48 */
+ { 0x7fff38e37fff7fffULL, 0x38e37fff7fff38e3ULL, },
+ { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, },
+ { 0x7fffe38e38e37fffULL, 0xe38e38e37fffe38eULL, },
+ { 0x16c28000c16c16c2ULL, 0x8000c16c16c28000ULL, },
+ { 0x7fff05b05b057fffULL, 0x05b05b057fff05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fff80001c717fffULL, 0x80001c717fff8000ULL, },
+ { 0x8000c71d80008000ULL, 0xc71d80008000c71dULL, }, /* 56 */
+ { 0x1c717fff71c71c71ULL, 0x7fff71c71c717fffULL, },
+ { 0x80001c72c71d8000ULL, 0x1c72c71d80001c72ULL, },
+ { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x8000fa50a4fb8000ULL, 0xfa50a4fb8000fa50ULL, },
+ { 0xe93e7fff3e94e93eULL, 0x7fff3e94e93e7fffULL, },
+ { 0x80007fffe38f8000ULL, 0x7fffe38f80007fffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cac7fffdacf8e38ULL, 0x387080007fff5d10ULL, },
+ { 0xdc1038228000c9c0ULL, 0x238f800053507fffULL, },
+ { 0x181b7fffca318000ULL, 0xbd7682865539cd6cULL, },
+ { 0x73548000253171c8ULL, 0xc7907fff8000a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f64800093c43b88ULL, 0xeb1ff41b80002de8ULL, },
+ { 0x7fffea16ef62e4baULL, 0x8506324280008000ULL, },
+ { 0x23f0c7de7fff3640ULL, 0xdc717fffacb08000ULL, }, /* 72 */
+ { 0xb09c7fff6c3cc478ULL, 0x14e10be57fffd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b7fff5b9ea932ULL, 0x99e73e2701e98000ULL, },
+ { 0xe7e5800035cf7fffULL, 0x428a7d7aaac73294ULL, },
+ { 0x800015ea109e1b46ULL, 0x7afacdbe7fff7fffULL, },
+ { 0xc3f58000a46256ceULL, 0x6619c1d9fe177fffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c
new file mode 100644
index 0000000000..42f3ee56f6
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBSUU_S.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBSUU_S.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0x7fffffff1c71c71cULL, },
+ { 0x7fffffff7fffffffULL, 0x38e38e387fffffffULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, },
+ { 0x8000000080000000ULL, 0xc71c71c880000000ULL, },
+ { 0xe38e38e48e38e38fULL, 0x80000000e38e38e4ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x7fffffff38e38e39ULL, 0xe38e38e37fffffffULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x80000000c71c71c7ULL, 0x1c71c71d80000000ULL, },
+ { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fffffff7fffffffULL, 0x7fffffff7fffffffULL, },
+ { 0xe93e93e93e93e93eULL, 0x7fffffffe93e93e9ULL, },
+ { 0x7fffffff5b05b05bULL, 0x05b05b057fffffffULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x80000000a4fa4fa5ULL, 0xfa4fa4fb80000000ULL, },
+ { 0x16c16c17c16c16c2ULL, 0x8000000016c16c17ULL, },
+ { 0xe38e38e48e38e38fULL, 0x80000000e38e38e4ULL, }, /* 48 */
+ { 0x7fffffff7fffffffULL, 0x38e38e387fffffffULL, },
+ { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x7fffffff38e38e39ULL, 0xe38e38e37fffffffULL, },
+ { 0x16c16c17c16c16c2ULL, 0x8000000016c16c17ULL, },
+ { 0x7fffffff5b05b05bULL, 0x05b05b057fffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x7fffffff1c71c71dULL, 0x800000007fffffffULL, },
+ { 0x8000000080000000ULL, 0xc71c71c880000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0x7fffffff1c71c71cULL, },
+ { 0x80000000c71c71c7ULL, 0x1c71c71d80000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x80000000a4fa4fa5ULL, 0xfa4fa4fb80000000ULL, },
+ { 0xe93e93e93e93e93eULL, 0x7fffffffe93e93e9ULL, },
+ { 0x80000000e38e38e3ULL, 0x7fffffff80000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace669dace8e38ULL, 0x386f50447fffffffULL, },
+ { 0xdc10382280000000ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07fca3072f2ULL, 0xbd7582865538cd6cULL, },
+ { 0x73531997253171c8ULL, 0xc790afbc80000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b993c43b88ULL, 0xeb1ef41b80000000ULL, },
+ { 0x7fffffffef61e4baULL, 0x8506324280000000ULL, },
+ { 0x23efc7de7fffffffULL, 0xdc71bba1acaf7508ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be57fffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0x428a7d7aaac73294ULL, },
+ { 0x80000000109e1b46ULL, 0x7af9cdbe7fffffffULL, },
+ { 0xc3f467a3a46256ceULL, 0x6618c1d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBSUU_S_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c
new file mode 100644
index 0000000000..b8bd085516
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_b.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, },
+ { 0xababababababababULL, 0xababababababababULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, },
+ { 0x8e39e38e39e38e39ULL, 0xe38e39e38e39e38eULL, },
+ { 0x5656565656565656ULL, 0x5656565656565656ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xababababababababULL, 0xababababababababULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, },
+ { 0xcdcdcdcdcdcdcdcdULL, 0xcdcdcdcdcdcdcdcdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3434343434343434ULL, 0x3434343434343434ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8989898989898989ULL, 0x8989898989898989ULL, },
+ { 0xdedededededededeULL, 0xdedededededededeULL, },
+ { 0x6767676767676767ULL, 0x6767676767676767ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x50a5fb50a5fb50a5ULL, 0xfb50a5fb50a5fb50ULL, },
+ { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, },
+ { 0xe48f39e48f39e48fULL, 0x39e48f39e48f39e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x39e48e39e48e39e4ULL, 0x8e39e48e39e48e39ULL, },
+ { 0x8e39e38e39e38e39ULL, 0xe38e39e38e39e38eULL, },
+ { 0x17c26c17c26c17c2ULL, 0x6c17c26c17c26c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d71c71d71c71dULL, 0x71c71d71c71d71c7ULL, },
+ { 0x1d72c81d72c81d72ULL, 0xc81d72c81d72c81dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x72c71d72c71d72c7ULL, 0x1d72c71d72c71d72ULL, },
+ { 0xc71c72c71c72c71cULL, 0x72c71c72c71c72c7ULL, },
+ { 0x50a5fb50a5fb50a5ULL, 0xfb50a5fb50a5fb50ULL, },
+ { 0xe93e94e93e94e93eULL, 0x94e93e94e93e94e9ULL, },
+ { 0x39e38f39e38f39e3ULL, 0x8f39e38f39e38f39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8dace669dbcf8e38ULL, 0x39705044e93c5e10ULL, },
+ { 0xdc1038226f93cac0ULL, 0x248f455f53508bf8ULL, },
+ { 0x181bd07fca3173f2ULL, 0xbe7683865539ce6cULL, },
+ { 0x73541a97253172c8ULL, 0xc790b0bc17c4a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6452b994c43c88ULL, 0xeb1ff51b6a142de8ULL, },
+ { 0x8b6fea16ef62e5baULL, 0x850633426cfd705cULL, },
+ { 0x24f0c8de916d3640ULL, 0xdc71bba1adb07508ULL, }, /* 72 */
+ { 0xb19cae476c3cc478ULL, 0x15e10be596ecd318ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9ea932ULL, 0x9ae73e2702e94374ULL, },
+ { 0xe8e5308136cf8d0eULL, 0x428a7d7aabc73294ULL, },
+ { 0x759116ea119e1b46ULL, 0x7bfacdbe940390a4ULL, },
+ { 0xc4f568a3a56257ceULL, 0x6619c2d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c
new file mode 100644
index 0000000000..f532e4a69d
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_d.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555556ULL, 0x5555555555555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaabULL, 0xaaaaaaaaaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xcccccccccccccccdULL, 0xcccccccccccccccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3333333333333334ULL, 0x3333333333333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888888888889ULL, 0x8888888888888889ULL, },
+ { 0xdddddddddddddddeULL, 0xdddddddddddddddeULL, },
+ { 0x6666666666666667ULL, 0x6666666666666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xe38e38e38e38e38fULL, 0x38e38e38e38e38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x16c16c16c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71c71c71c72ULL, 0xc71c71c71c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c71c71c71c7ULL, 0x1c71c71c71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c71c71c71c7ULL, },
+ { 0x4fa4fa4fa4fa4fa5ULL, 0xfa4fa4fa4fa4fa50ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e93e93e93e9ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace668dace8e38ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038216e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07eca3072f2ULL, 0xbd7582865538cd6cULL, },
+ { 0x73531997253171c8ULL, 0xc790afbb16c3a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b893c43b88ULL, 0xeb1ef41a6a142de8ULL, },
+ { 0x8b6eea15ef61e4baULL, 0x850632416bfc705cULL, },
+ { 0x23efc7de916d3640ULL, 0xdc71bba0acaf7508ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0x428a7d79aac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0xc3f467a2a46256ceULL, 0x6618c1d8fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c
new file mode 100644
index 0000000000..ac7f8ee6b5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_h.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x8e39e38e38e38e39ULL, 0xe38e38e38e39e38eULL, },
+ { 0x5556555655565556ULL, 0x5556555655565556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaabaaabaaabaaabULL, 0xaaabaaabaaabaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, },
+ { 0xcccdcccdcccdcccdULL, 0xcccdcccdcccdcccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3334333433343334ULL, 0x3334333433343334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8889888988898889ULL, 0x8889888988898889ULL, },
+ { 0xdddedddedddedddeULL, 0xdddedddedddedddeULL, },
+ { 0x6667666766676667ULL, 0x6667666766676667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa5fa50a4fb4fa5ULL, 0xfa50a4fb4fa5fa50ULL, },
+ { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, },
+ { 0xe38f38e48e39e38fULL, 0x38e48e39e38f38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e48e39e38e38e4ULL, 0x8e39e38e38e48e39ULL, },
+ { 0x8e39e38e38e38e39ULL, 0xe38e38e38e39e38eULL, },
+ { 0x16c26c17c16c16c2ULL, 0x6c17c16c16c26c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71d71c71c71c71dULL, 0x71c71c71c71d71c7ULL, },
+ { 0x1c72c71d71c81c72ULL, 0xc71d71c81c72c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c72c71d71c7ULL, 0x1c72c71d71c71c72ULL, },
+ { 0xc71c71c71c72c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x4fa5fa50a4fb4fa5ULL, 0xfa50a4fb4fa5fa50ULL, },
+ { 0xe93e93e93e94e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0x38e38e39e38f38e3ULL, 0x8e39e38f38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace669dacf8e38ULL, 0x38705044e93c5d10ULL, },
+ { 0xdc1038226e93c9c0ULL, 0x238f445f53508af8ULL, },
+ { 0x181bd07fca3172f2ULL, 0xbd7682865539cd6cULL, },
+ { 0x73541997253171c8ULL, 0xc790afbc16c4a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6451b993c43b88ULL, 0xeb1ff41b6a142de8ULL, },
+ { 0x8b6fea16ef62e4baULL, 0x850632426bfd705cULL, },
+ { 0x23f0c7de916d3640ULL, 0xdc71bba1acb07508ULL, }, /* 72 */
+ { 0xb09cae476c3cc478ULL, 0x14e10be595ecd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9ea932ULL, 0x99e73e2701e94274ULL, },
+ { 0xe7e52f8135cf8d0eULL, 0x428a7d7aaac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x7afacdbe94038fa4ULL, },
+ { 0xc3f567a3a46256ceULL, 0x6619c1d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c
new file mode 100644
index 0000000000..93eeaecc7c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/int-subtract/test_msa_subv_w.c
@@ -0,0 +1,160 @@
+/*
+ * Test program for MSA instruction SUBV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ * Copyright (C) 2019 RT-RK Computer Based Systems LLC
+ * Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Int Subtract";
+ char *instruction_name = "SUBV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555655555556ULL, 0x5555555655555556ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaabaaaaaaabULL, 0xaaaaaaabaaaaaaabULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0xcccccccdcccccccdULL, 0xcccccccdcccccccdULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x3333333433333334ULL, 0x3333333433333334ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8888888988888889ULL, 0x8888888988888889ULL, },
+ { 0xdddddddedddddddeULL, 0xdddddddedddddddeULL, },
+ { 0x6666666766666667ULL, 0x6666666766666667ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0xfa4fa4fb4fa4fa50ULL, },
+ { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xe38e38e48e38e38fULL, 0x38e38e39e38e38e4ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e39e38e38e4ULL, 0x8e38e38e38e38e39ULL, },
+ { 0x8e38e38e38e38e39ULL, 0xe38e38e38e38e38eULL, },
+ { 0x16c16c17c16c16c2ULL, 0x6c16c16c16c16c17ULL, },
+ { 0xb05b05b05b05b05bULL, 0x05b05b05b05b05b0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71dULL, 0x71c71c71c71c71c7ULL, },
+ { 0x1c71c71d71c71c72ULL, 0xc71c71c81c71c71dULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x71c71c72c71c71c7ULL, 0x1c71c71d71c71c72ULL, },
+ { 0xc71c71c71c71c71cULL, 0x71c71c72c71c71c7ULL, },
+ { 0x4fa4fa50a4fa4fa5ULL, 0xfa4fa4fb4fa4fa50ULL, },
+ { 0xe93e93e93e93e93eULL, 0x93e93e94e93e93e9ULL, },
+ { 0x38e38e39e38e38e3ULL, 0x8e38e38f38e38e39ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x8cace669dace8e38ULL, 0x386f5044e93c5d10ULL, },
+ { 0xdc1038226e92c9c0ULL, 0x238e445f53508af8ULL, },
+ { 0x181bd07fca3072f2ULL, 0xbd7582865538cd6cULL, },
+ { 0x73531997253171c8ULL, 0xc790afbc16c3a2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4f6351b993c43b88ULL, 0xeb1ef41b6a142de8ULL, },
+ { 0x8b6eea16ef61e4baULL, 0x850632426bfc705cULL, },
+ { 0x23efc7de916d3640ULL, 0xdc71bba1acaf7508ULL, }, /* 72 */
+ { 0xb09cae476c3bc478ULL, 0x14e10be595ebd218ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3c0b985d5b9da932ULL, 0x99e73e2701e84274ULL, },
+ { 0xe7e42f8135cf8d0eULL, 0x428a7d7aaac73294ULL, },
+ { 0x749115ea109e1b46ULL, 0x7af9cdbe94038fa4ULL, },
+ { 0xc3f467a3a46256ceULL, 0x6618c1d9fe17bd8cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+};
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SUBV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c
new file mode 100644
index 0000000000..3506202cd9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVEV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVEV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xff00ff00ff00ff00ULL, 0xff00ff00ff00ff00ULL, },
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0xff55ff55ff55ff55ULL, 0xff55ff55ff55ff55ULL, },
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0xff33ff33ff33ff33ULL, 0xff33ff33ff33ff33ULL, },
+ { 0xff8effe3ff38ff8eULL, 0xffe3ff38ff8effe3ULL, },
+ { 0xff71ff1cffc7ff71ULL, 0xff1cffc7ff71ff1cULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x008e00e30038008eULL, 0x00e30038008e00e3ULL, },
+ { 0x0071001c00c70071ULL, 0x001c00c70071001cULL, },
+ { 0xaaffaaffaaffaaffULL, 0xaaffaaffaaffaaffULL, }, /* 16 */
+ { 0xaa00aa00aa00aa00ULL, 0xaa00aa00aa00aa00ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa55aa55aa55aa55ULL, 0xaa55aa55aa55aa55ULL, },
+ { 0xaaccaaccaaccaaccULL, 0xaaccaaccaaccaaccULL, },
+ { 0xaa33aa33aa33aa33ULL, 0xaa33aa33aa33aa33ULL, },
+ { 0xaa8eaae3aa38aa8eULL, 0xaae3aa38aa8eaae3ULL, },
+ { 0xaa71aa1caac7aa71ULL, 0xaa1caac7aa71aa1cULL, },
+ { 0x55ff55ff55ff55ffULL, 0x55ff55ff55ff55ffULL, }, /* 24 */
+ { 0x5500550055005500ULL, 0x5500550055005500ULL, },
+ { 0x55aa55aa55aa55aaULL, 0x55aa55aa55aa55aaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55cc55cc55cc55ccULL, 0x55cc55cc55cc55ccULL, },
+ { 0x5533553355335533ULL, 0x5533553355335533ULL, },
+ { 0x558e55e35538558eULL, 0x55e35538558e55e3ULL, },
+ { 0x5571551c55c75571ULL, 0x551c55c75571551cULL, },
+ { 0xccffccffccffccffULL, 0xccffccffccffccffULL, }, /* 32 */
+ { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
+ { 0xccaaccaaccaaccaaULL, 0xccaaccaaccaaccaaULL, },
+ { 0xcc55cc55cc55cc55ULL, 0xcc55cc55cc55cc55ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcc33cc33cc33cc33ULL, 0xcc33cc33cc33cc33ULL, },
+ { 0xcc8ecce3cc38cc8eULL, 0xcce3cc38cc8ecce3ULL, },
+ { 0xcc71cc1cccc7cc71ULL, 0xcc1cccc7cc71cc1cULL, },
+ { 0x33ff33ff33ff33ffULL, 0x33ff33ff33ff33ffULL, }, /* 40 */
+ { 0x3300330033003300ULL, 0x3300330033003300ULL, },
+ { 0x33aa33aa33aa33aaULL, 0x33aa33aa33aa33aaULL, },
+ { 0x3355335533553355ULL, 0x3355335533553355ULL, },
+ { 0x33cc33cc33cc33ccULL, 0x33cc33cc33cc33ccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x338e33e33338338eULL, 0x33e33338338e33e3ULL, },
+ { 0x3371331c33c73371ULL, 0x331c33c73371331cULL, },
+ { 0x8effe3ff38ff8effULL, 0xe3ff38ff8effe3ffULL, }, /* 48 */
+ { 0x8e00e30038008e00ULL, 0xe30038008e00e300ULL, },
+ { 0x8eaae3aa38aa8eaaULL, 0xe3aa38aa8eaae3aaULL, },
+ { 0x8e55e35538558e55ULL, 0xe35538558e55e355ULL, },
+ { 0x8ecce3cc38cc8eccULL, 0xe3cc38cc8ecce3ccULL, },
+ { 0x8e33e33338338e33ULL, 0xe33338338e33e333ULL, },
+ { 0x8e8ee3e338388e8eULL, 0xe3e338388e8ee3e3ULL, },
+ { 0x8e71e31c38c78e71ULL, 0xe31c38c78e71e31cULL, },
+ { 0x71ff1cffc7ff71ffULL, 0x1cffc7ff71ff1cffULL, }, /* 56 */
+ { 0x71001c00c7007100ULL, 0x1c00c70071001c00ULL, },
+ { 0x71aa1caac7aa71aaULL, 0x1caac7aa71aa1caaULL, },
+ { 0x71551c55c7557155ULL, 0x1c55c75571551c55ULL, },
+ { 0x71cc1cccc7cc71ccULL, 0x1cccc7cc71cc1cccULL, },
+ { 0x71331c33c7337133ULL, 0x1c33c73371331c33ULL, },
+ { 0x718e1ce3c738718eULL, 0x1ce3c738718e1ce3ULL, },
+ { 0x71711c1cc7c77171ULL, 0x1c1cc7c771711c1cULL, },
+ { 0x6a6acccc62624040ULL, 0x67675e5e7b7b0c0cULL, }, /* 64 */
+ { 0x6abecc6362934008ULL, 0x67f75e1a7b3f0cfcULL, },
+ { 0x6a5accaa62cf4080ULL, 0x67d85eff7b2b0c14ULL, },
+ { 0x6a4fcc4d6231404eULL, 0x67f15ed87b420ca0ULL, },
+ { 0xbe6a63cc93620840ULL, 0xf7671a5e3f7bfc0cULL, },
+ { 0xbebe636393930808ULL, 0xf7f71a1a3f3ffcfcULL, },
+ { 0xbe5a63aa93cf0880ULL, 0xf7d81aff3f2bfc14ULL, },
+ { 0xbe4f634d9331084eULL, 0xf7f11ad83f42fca0ULL, },
+ { 0x5a6aaacccf628040ULL, 0xd867ff5e2b7b140cULL, }, /* 72 */
+ { 0x5abeaa63cf938008ULL, 0xd8f7ff1a2b3f14fcULL, },
+ { 0x5a5aaaaacfcf8080ULL, 0xd8d8ffff2b2b1414ULL, },
+ { 0x5a4faa4dcf31804eULL, 0xd8f1ffd82b4214a0ULL, },
+ { 0x4f6a4dcc31624e40ULL, 0xf167d85e427ba00cULL, },
+ { 0x4fbe4d6331934e08ULL, 0xf1f7d81a423fa0fcULL, },
+ { 0x4f5a4daa31cf4e80ULL, 0xf1d8d8ff422ba014ULL, },
+ { 0x4f4f4d4d31314e4eULL, 0xf1f1d8d84242a0a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c
new file mode 100644
index 0000000000..896b11dce0
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVEV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVEV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e38e38e38eULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0xe38e38e38e38e38eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555555ULL, 0xe38e38e38e38e38eULL, },
+ { 0xccccccccccccccccULL, 0xe38e38e38e38e38eULL, },
+ { 0x3333333333333333ULL, 0xe38e38e38e38e38eULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x1c71c71c71c71c71ULL, 0xe38e38e38e38e38eULL, },
+ { 0xffffffffffffffffULL, 0x1c71c71c71c71c71ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x1c71c71c71c71c71ULL, },
+ { 0x5555555555555555ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xccccccccccccccccULL, 0x1c71c71c71c71c71ULL, },
+ { 0x3333333333333333ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe38e38e38e38e38eULL, 0x1c71c71c71c71c71ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x886ae6cc28625540ULL, },
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, },
+ { 0x886ae6cc28625540ULL, 0xfbbe00634d93c708ULL, },
+ { 0xfbbe00634d93c708ULL, 0xfbbe00634d93c708ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x886ae6cc28625540ULL, 0xac5aaeaab9cf8b80ULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, },
+ { 0xfbbe00634d93c708ULL, 0x704f164d5e31e24eULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x704f164d5e31e24eULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c
new file mode 100644
index 0000000000..a68fea643f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVEV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVEV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffff0000ffff0000ULL, 0xffff0000ffff0000ULL, },
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0xffff5555ffff5555ULL, 0xffff5555ffff5555ULL, },
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0xffff3333ffff3333ULL, 0xffff3333ffff3333ULL, },
+ { 0xffff38e3ffffe38eULL, 0xffff8e38ffff38e3ULL, },
+ { 0xffffc71cffff1c71ULL, 0xffff71c7ffffc71cULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x000038e30000e38eULL, 0x00008e38000038e3ULL, },
+ { 0x0000c71c00001c71ULL, 0x000071c70000c71cULL, },
+ { 0xaaaaffffaaaaffffULL, 0xaaaaffffaaaaffffULL, }, /* 16 */
+ { 0xaaaa0000aaaa0000ULL, 0xaaaa0000aaaa0000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaa5555aaaa5555ULL, 0xaaaa5555aaaa5555ULL, },
+ { 0xaaaaccccaaaaccccULL, 0xaaaaccccaaaaccccULL, },
+ { 0xaaaa3333aaaa3333ULL, 0xaaaa3333aaaa3333ULL, },
+ { 0xaaaa38e3aaaae38eULL, 0xaaaa8e38aaaa38e3ULL, },
+ { 0xaaaac71caaaa1c71ULL, 0xaaaa71c7aaaac71cULL, },
+ { 0x5555ffff5555ffffULL, 0x5555ffff5555ffffULL, }, /* 24 */
+ { 0x5555000055550000ULL, 0x5555000055550000ULL, },
+ { 0x5555aaaa5555aaaaULL, 0x5555aaaa5555aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555cccc5555ccccULL, 0x5555cccc5555ccccULL, },
+ { 0x5555333355553333ULL, 0x5555333355553333ULL, },
+ { 0x555538e35555e38eULL, 0x55558e38555538e3ULL, },
+ { 0x5555c71c55551c71ULL, 0x555571c75555c71cULL, },
+ { 0xccccffffccccffffULL, 0xccccffffccccffffULL, }, /* 32 */
+ { 0xcccc0000cccc0000ULL, 0xcccc0000cccc0000ULL, },
+ { 0xccccaaaaccccaaaaULL, 0xccccaaaaccccaaaaULL, },
+ { 0xcccc5555cccc5555ULL, 0xcccc5555cccc5555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccc3333cccc3333ULL, 0xcccc3333cccc3333ULL, },
+ { 0xcccc38e3cccce38eULL, 0xcccc8e38cccc38e3ULL, },
+ { 0xccccc71ccccc1c71ULL, 0xcccc71c7ccccc71cULL, },
+ { 0x3333ffff3333ffffULL, 0x3333ffff3333ffffULL, }, /* 40 */
+ { 0x3333000033330000ULL, 0x3333000033330000ULL, },
+ { 0x3333aaaa3333aaaaULL, 0x3333aaaa3333aaaaULL, },
+ { 0x3333555533335555ULL, 0x3333555533335555ULL, },
+ { 0x3333cccc3333ccccULL, 0x3333cccc3333ccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333338e33333e38eULL, 0x33338e38333338e3ULL, },
+ { 0x3333c71c33331c71ULL, 0x333371c73333c71cULL, },
+ { 0x38e3ffffe38effffULL, 0x8e38ffff38e3ffffULL, }, /* 48 */
+ { 0x38e30000e38e0000ULL, 0x8e38000038e30000ULL, },
+ { 0x38e3aaaae38eaaaaULL, 0x8e38aaaa38e3aaaaULL, },
+ { 0x38e35555e38e5555ULL, 0x8e38555538e35555ULL, },
+ { 0x38e3cccce38eccccULL, 0x8e38cccc38e3ccccULL, },
+ { 0x38e33333e38e3333ULL, 0x8e38333338e33333ULL, },
+ { 0x38e338e3e38ee38eULL, 0x8e388e3838e338e3ULL, },
+ { 0x38e3c71ce38e1c71ULL, 0x8e3871c738e3c71cULL, },
+ { 0xc71cffff1c71ffffULL, 0x71c7ffffc71cffffULL, }, /* 56 */
+ { 0xc71c00001c710000ULL, 0x71c70000c71c0000ULL, },
+ { 0xc71caaaa1c71aaaaULL, 0x71c7aaaac71caaaaULL, },
+ { 0xc71c55551c715555ULL, 0x71c75555c71c5555ULL, },
+ { 0xc71ccccc1c71ccccULL, 0x71c7ccccc71cccccULL, },
+ { 0xc71c33331c713333ULL, 0x71c73333c71c3333ULL, },
+ { 0xc71c38e31c71e38eULL, 0x71c78e38c71c38e3ULL, },
+ { 0xc71cc71c1c711c71ULL, 0x71c771c7c71cc71cULL, },
+ { 0xe6cce6cc55405540ULL, 0x0b5e0b5eb00cb00cULL, }, /* 64 */
+ { 0xe6cc00635540c708ULL, 0x0b5ebb1ab00c52fcULL, },
+ { 0xe6ccaeaa55408b80ULL, 0x0b5ec6ffb00c2514ULL, },
+ { 0xe6cc164d5540e24eULL, 0x0b5e88d8b00ce2a0ULL, },
+ { 0x0063e6ccc7085540ULL, 0xbb1a0b5e52fcb00cULL, },
+ { 0x00630063c708c708ULL, 0xbb1abb1a52fc52fcULL, },
+ { 0x0063aeaac7088b80ULL, 0xbb1ac6ff52fc2514ULL, },
+ { 0x0063164dc708e24eULL, 0xbb1a88d852fce2a0ULL, },
+ { 0xaeaae6cc8b805540ULL, 0xc6ff0b5e2514b00cULL, }, /* 72 */
+ { 0xaeaa00638b80c708ULL, 0xc6ffbb1a251452fcULL, },
+ { 0xaeaaaeaa8b808b80ULL, 0xc6ffc6ff25142514ULL, },
+ { 0xaeaa164d8b80e24eULL, 0xc6ff88d82514e2a0ULL, },
+ { 0x164de6cce24e5540ULL, 0x88d80b5ee2a0b00cULL, },
+ { 0x164d0063e24ec708ULL, 0x88d8bb1ae2a052fcULL, },
+ { 0x164daeaae24e8b80ULL, 0x88d8c6ffe2a02514ULL, },
+ { 0x164d164de24ee24eULL, 0x88d888d8e2a0e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c
new file mode 100644
index 0000000000..6e168c701e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVEV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVEV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffff00000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0xffffffff55555555ULL, 0xffffffff55555555ULL, },
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0xffffffff33333333ULL, 0xffffffff33333333ULL, },
+ { 0xffffffff8e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0xffffffff71c71c71ULL, 0xffffffff1c71c71cULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x000000008e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xaaaaaaaaffffffffULL, 0xaaaaaaaaffffffffULL, }, /* 16 */
+ { 0xaaaaaaaa00000000ULL, 0xaaaaaaaa00000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa55555555ULL, 0xaaaaaaaa55555555ULL, },
+ { 0xaaaaaaaaccccccccULL, 0xaaaaaaaaccccccccULL, },
+ { 0xaaaaaaaa33333333ULL, 0xaaaaaaaa33333333ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaae38e38e3ULL, },
+ { 0xaaaaaaaa71c71c71ULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x55555555ffffffffULL, 0x55555555ffffffffULL, }, /* 24 */
+ { 0x5555555500000000ULL, 0x5555555500000000ULL, },
+ { 0x55555555aaaaaaaaULL, 0x55555555aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55555555ccccccccULL, 0x55555555ccccccccULL, },
+ { 0x5555555533333333ULL, 0x5555555533333333ULL, },
+ { 0x555555558e38e38eULL, 0x55555555e38e38e3ULL, },
+ { 0x5555555571c71c71ULL, 0x555555551c71c71cULL, },
+ { 0xccccccccffffffffULL, 0xccccccccffffffffULL, }, /* 32 */
+ { 0xcccccccc00000000ULL, 0xcccccccc00000000ULL, },
+ { 0xccccccccaaaaaaaaULL, 0xccccccccaaaaaaaaULL, },
+ { 0xcccccccc55555555ULL, 0xcccccccc55555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc33333333ULL, 0xcccccccc33333333ULL, },
+ { 0xcccccccc8e38e38eULL, 0xcccccccce38e38e3ULL, },
+ { 0xcccccccc71c71c71ULL, 0xcccccccc1c71c71cULL, },
+ { 0x33333333ffffffffULL, 0x33333333ffffffffULL, }, /* 40 */
+ { 0x3333333300000000ULL, 0x3333333300000000ULL, },
+ { 0x33333333aaaaaaaaULL, 0x33333333aaaaaaaaULL, },
+ { 0x3333333355555555ULL, 0x3333333355555555ULL, },
+ { 0x33333333ccccccccULL, 0x33333333ccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333333338e38e38eULL, 0x33333333e38e38e3ULL, },
+ { 0x3333333371c71c71ULL, 0x333333331c71c71cULL, },
+ { 0x8e38e38effffffffULL, 0xe38e38e3ffffffffULL, }, /* 48 */
+ { 0x8e38e38e00000000ULL, 0xe38e38e300000000ULL, },
+ { 0x8e38e38eaaaaaaaaULL, 0xe38e38e3aaaaaaaaULL, },
+ { 0x8e38e38e55555555ULL, 0xe38e38e355555555ULL, },
+ { 0x8e38e38eccccccccULL, 0xe38e38e3ccccccccULL, },
+ { 0x8e38e38e33333333ULL, 0xe38e38e333333333ULL, },
+ { 0x8e38e38e8e38e38eULL, 0xe38e38e3e38e38e3ULL, },
+ { 0x8e38e38e71c71c71ULL, 0xe38e38e31c71c71cULL, },
+ { 0x71c71c71ffffffffULL, 0x1c71c71cffffffffULL, }, /* 56 */
+ { 0x71c71c7100000000ULL, 0x1c71c71c00000000ULL, },
+ { 0x71c71c71aaaaaaaaULL, 0x1c71c71caaaaaaaaULL, },
+ { 0x71c71c7155555555ULL, 0x1c71c71c55555555ULL, },
+ { 0x71c71c71ccccccccULL, 0x1c71c71cccccccccULL, },
+ { 0x71c71c7133333333ULL, 0x1c71c71c33333333ULL, },
+ { 0x71c71c718e38e38eULL, 0x1c71c71ce38e38e3ULL, },
+ { 0x71c71c7171c71c71ULL, 0x1c71c71c1c71c71cULL, },
+ { 0x2862554028625540ULL, 0xfe7bb00cfe7bb00cULL, }, /* 64 */
+ { 0x286255404d93c708ULL, 0xfe7bb00c153f52fcULL, },
+ { 0x28625540b9cf8b80ULL, 0xfe7bb00cab2b2514ULL, },
+ { 0x286255405e31e24eULL, 0xfe7bb00ca942e2a0ULL, },
+ { 0x4d93c70828625540ULL, 0x153f52fcfe7bb00cULL, },
+ { 0x4d93c7084d93c708ULL, 0x153f52fc153f52fcULL, },
+ { 0x4d93c708b9cf8b80ULL, 0x153f52fcab2b2514ULL, },
+ { 0x4d93c7085e31e24eULL, 0x153f52fca942e2a0ULL, },
+ { 0xb9cf8b8028625540ULL, 0xab2b2514fe7bb00cULL, }, /* 72 */
+ { 0xb9cf8b804d93c708ULL, 0xab2b2514153f52fcULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xab2b2514ab2b2514ULL, },
+ { 0xb9cf8b805e31e24eULL, 0xab2b2514a942e2a0ULL, },
+ { 0x5e31e24e28625540ULL, 0xa942e2a0fe7bb00cULL, },
+ { 0x5e31e24e4d93c708ULL, 0xa942e2a0153f52fcULL, },
+ { 0x5e31e24eb9cf8b80ULL, 0xa942e2a0ab2b2514ULL, },
+ { 0x5e31e24e5e31e24eULL, 0xa942e2a0a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVEV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c
new file mode 100644
index 0000000000..11cfbf398a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVL.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVL.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xff00ff00ff00ff00ULL, 0xff00ff00ff00ff00ULL, },
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0xff55ff55ff55ff55ULL, 0xff55ff55ff55ff55ULL, },
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0xff33ff33ff33ff33ULL, 0xff33ff33ff33ff33ULL, },
+ { 0xffe3ff8eff38ffe3ULL, 0xff38ffe3ff8eff38ULL, },
+ { 0xff1cff71ffc7ff1cULL, 0xffc7ff1cff71ffc7ULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x00e3008e003800e3ULL, 0x003800e3008e0038ULL, },
+ { 0x001c007100c7001cULL, 0x00c7001c007100c7ULL, },
+ { 0xaaffaaffaaffaaffULL, 0xaaffaaffaaffaaffULL, }, /* 16 */
+ { 0xaa00aa00aa00aa00ULL, 0xaa00aa00aa00aa00ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa55aa55aa55aa55ULL, 0xaa55aa55aa55aa55ULL, },
+ { 0xaaccaaccaaccaaccULL, 0xaaccaaccaaccaaccULL, },
+ { 0xaa33aa33aa33aa33ULL, 0xaa33aa33aa33aa33ULL, },
+ { 0xaae3aa8eaa38aae3ULL, 0xaa38aae3aa8eaa38ULL, },
+ { 0xaa1caa71aac7aa1cULL, 0xaac7aa1caa71aac7ULL, },
+ { 0x55ff55ff55ff55ffULL, 0x55ff55ff55ff55ffULL, }, /* 24 */
+ { 0x5500550055005500ULL, 0x5500550055005500ULL, },
+ { 0x55aa55aa55aa55aaULL, 0x55aa55aa55aa55aaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55cc55cc55cc55ccULL, 0x55cc55cc55cc55ccULL, },
+ { 0x5533553355335533ULL, 0x5533553355335533ULL, },
+ { 0x55e3558e553855e3ULL, 0x553855e3558e5538ULL, },
+ { 0x551c557155c7551cULL, 0x55c7551c557155c7ULL, },
+ { 0xccffccffccffccffULL, 0xccffccffccffccffULL, }, /* 32 */
+ { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
+ { 0xccaaccaaccaaccaaULL, 0xccaaccaaccaaccaaULL, },
+ { 0xcc55cc55cc55cc55ULL, 0xcc55cc55cc55cc55ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcc33cc33cc33cc33ULL, 0xcc33cc33cc33cc33ULL, },
+ { 0xcce3cc8ecc38cce3ULL, 0xcc38cce3cc8ecc38ULL, },
+ { 0xcc1ccc71ccc7cc1cULL, 0xccc7cc1ccc71ccc7ULL, },
+ { 0x33ff33ff33ff33ffULL, 0x33ff33ff33ff33ffULL, }, /* 40 */
+ { 0x3300330033003300ULL, 0x3300330033003300ULL, },
+ { 0x33aa33aa33aa33aaULL, 0x33aa33aa33aa33aaULL, },
+ { 0x3355335533553355ULL, 0x3355335533553355ULL, },
+ { 0x33cc33cc33cc33ccULL, 0x33cc33cc33cc33ccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x33e3338e333833e3ULL, 0x333833e3338e3338ULL, },
+ { 0x331c337133c7331cULL, 0x33c7331c337133c7ULL, },
+ { 0xe3ff8eff38ffe3ffULL, 0x38ffe3ff8eff38ffULL, }, /* 48 */
+ { 0xe3008e003800e300ULL, 0x3800e3008e003800ULL, },
+ { 0xe3aa8eaa38aae3aaULL, 0x38aae3aa8eaa38aaULL, },
+ { 0xe3558e553855e355ULL, 0x3855e3558e553855ULL, },
+ { 0xe3cc8ecc38cce3ccULL, 0x38cce3cc8ecc38ccULL, },
+ { 0xe3338e333833e333ULL, 0x3833e3338e333833ULL, },
+ { 0xe3e38e8e3838e3e3ULL, 0x3838e3e38e8e3838ULL, },
+ { 0xe31c8e7138c7e31cULL, 0x38c7e31c8e7138c7ULL, },
+ { 0x1cff71ffc7ff1cffULL, 0xc7ff1cff71ffc7ffULL, }, /* 56 */
+ { 0x1c007100c7001c00ULL, 0xc7001c007100c700ULL, },
+ { 0x1caa71aac7aa1caaULL, 0xc7aa1caa71aac7aaULL, },
+ { 0x1c557155c7551c55ULL, 0xc7551c557155c755ULL, },
+ { 0x1ccc71ccc7cc1cccULL, 0xc7cc1ccc71ccc7ccULL, },
+ { 0x1c337133c7331c33ULL, 0xc7331c337133c733ULL, },
+ { 0x1ce3718ec7381ce3ULL, 0xc7381ce3718ec738ULL, },
+ { 0x1c1c7171c7c71c1cULL, 0xc7c71c1c7171c7c7ULL, },
+ { 0xfefe7b7bb0b00c0cULL, 0x4b4b67670b0b5e5eULL, }, /* 64 */
+ { 0xfe157b3fb0520cfcULL, 0x4b1267f70bbb5e1aULL, },
+ { 0xfeab7b2bb0250c14ULL, 0x4b2767d80bc65effULL, },
+ { 0xfea97b42b0e20ca0ULL, 0x4b8d67f10b885ed8ULL, },
+ { 0x15fe3f7b52b0fc0cULL, 0x124bf767bb0b1a5eULL, },
+ { 0x15153f3f5252fcfcULL, 0x1212f7f7bbbb1a1aULL, },
+ { 0x15ab3f2b5225fc14ULL, 0x1227f7d8bbc61affULL, },
+ { 0x15a93f4252e2fca0ULL, 0x128df7f1bb881ad8ULL, },
+ { 0xabfe2b7b25b0140cULL, 0x274bd867c60bff5eULL, }, /* 72 */
+ { 0xab152b3f255214fcULL, 0x2712d8f7c6bbff1aULL, },
+ { 0xabab2b2b25251414ULL, 0x2727d8d8c6c6ffffULL, },
+ { 0xaba92b4225e214a0ULL, 0x278dd8f1c688ffd8ULL, },
+ { 0xa9fe427be2b0a00cULL, 0x8d4bf167880bd85eULL, },
+ { 0xa915423fe252a0fcULL, 0x8d12f1f788bbd81aULL, },
+ { 0xa9ab422be225a014ULL, 0x8d27f1d888c6d8ffULL, },
+ { 0xa9a94242e2e2a0a0ULL, 0x8d8df1f18888d8d8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c
new file mode 100644
index 0000000000..35581ee7ea
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVL.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVL.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e3ULL, 0xffffffffffffffffULL, },
+ { 0xc71c71c71c71c71cULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x38e38e38e38e38e3ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xc71c71c71c71c71cULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x5555555555555555ULL, },
+ { 0xc71c71c71c71c71cULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x38e38e38e38e38e3ULL, 0xccccccccccccccccULL, },
+ { 0xc71c71c71c71c71cULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x3333333333333333ULL, },
+ { 0xc71c71c71c71c71cULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xc71c71c71c71c71cULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71cULL, 0xc71c71c71c71c71cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x12f7bb1a153f52fcULL, 0x4b670b5efe7bb00cULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x8df188d8a942e2a0ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x12f7bb1a153f52fcULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x8df188d8a942e2a0ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x4b670b5efe7bb00cULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0x12f7bb1a153f52fcULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, },
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c
new file mode 100644
index 0000000000..0d89d95edd
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVL.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVL.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffff0000ffff0000ULL, 0xffff0000ffff0000ULL, },
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0xffff5555ffff5555ULL, 0xffff5555ffff5555ULL, },
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0xffff3333ffff3333ULL, 0xffff3333ffff3333ULL, },
+ { 0xffffe38effff38e3ULL, 0xffff38e3ffff8e38ULL, },
+ { 0xffff1c71ffffc71cULL, 0xffffc71cffff71c7ULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x0000e38e000038e3ULL, 0x000038e300008e38ULL, },
+ { 0x00001c710000c71cULL, 0x0000c71c000071c7ULL, },
+ { 0xaaaaffffaaaaffffULL, 0xaaaaffffaaaaffffULL, }, /* 16 */
+ { 0xaaaa0000aaaa0000ULL, 0xaaaa0000aaaa0000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaa5555aaaa5555ULL, 0xaaaa5555aaaa5555ULL, },
+ { 0xaaaaccccaaaaccccULL, 0xaaaaccccaaaaccccULL, },
+ { 0xaaaa3333aaaa3333ULL, 0xaaaa3333aaaa3333ULL, },
+ { 0xaaaae38eaaaa38e3ULL, 0xaaaa38e3aaaa8e38ULL, },
+ { 0xaaaa1c71aaaac71cULL, 0xaaaac71caaaa71c7ULL, },
+ { 0x5555ffff5555ffffULL, 0x5555ffff5555ffffULL, }, /* 24 */
+ { 0x5555000055550000ULL, 0x5555000055550000ULL, },
+ { 0x5555aaaa5555aaaaULL, 0x5555aaaa5555aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555cccc5555ccccULL, 0x5555cccc5555ccccULL, },
+ { 0x5555333355553333ULL, 0x5555333355553333ULL, },
+ { 0x5555e38e555538e3ULL, 0x555538e355558e38ULL, },
+ { 0x55551c715555c71cULL, 0x5555c71c555571c7ULL, },
+ { 0xccccffffccccffffULL, 0xccccffffccccffffULL, }, /* 32 */
+ { 0xcccc0000cccc0000ULL, 0xcccc0000cccc0000ULL, },
+ { 0xccccaaaaccccaaaaULL, 0xccccaaaaccccaaaaULL, },
+ { 0xcccc5555cccc5555ULL, 0xcccc5555cccc5555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccc3333cccc3333ULL, 0xcccc3333cccc3333ULL, },
+ { 0xcccce38ecccc38e3ULL, 0xcccc38e3cccc8e38ULL, },
+ { 0xcccc1c71ccccc71cULL, 0xccccc71ccccc71c7ULL, },
+ { 0x3333ffff3333ffffULL, 0x3333ffff3333ffffULL, }, /* 40 */
+ { 0x3333000033330000ULL, 0x3333000033330000ULL, },
+ { 0x3333aaaa3333aaaaULL, 0x3333aaaa3333aaaaULL, },
+ { 0x3333555533335555ULL, 0x3333555533335555ULL, },
+ { 0x3333cccc3333ccccULL, 0x3333cccc3333ccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333e38e333338e3ULL, 0x333338e333338e38ULL, },
+ { 0x33331c713333c71cULL, 0x3333c71c333371c7ULL, },
+ { 0xe38effff38e3ffffULL, 0x38e3ffff8e38ffffULL, }, /* 48 */
+ { 0xe38e000038e30000ULL, 0x38e300008e380000ULL, },
+ { 0xe38eaaaa38e3aaaaULL, 0x38e3aaaa8e38aaaaULL, },
+ { 0xe38e555538e35555ULL, 0x38e355558e385555ULL, },
+ { 0xe38ecccc38e3ccccULL, 0x38e3cccc8e38ccccULL, },
+ { 0xe38e333338e33333ULL, 0x38e333338e383333ULL, },
+ { 0xe38ee38e38e338e3ULL, 0x38e338e38e388e38ULL, },
+ { 0xe38e1c7138e3c71cULL, 0x38e3c71c8e3871c7ULL, },
+ { 0x1c71ffffc71cffffULL, 0xc71cffff71c7ffffULL, }, /* 56 */
+ { 0x1c710000c71c0000ULL, 0xc71c000071c70000ULL, },
+ { 0x1c71aaaac71caaaaULL, 0xc71caaaa71c7aaaaULL, },
+ { 0x1c715555c71c5555ULL, 0xc71c555571c75555ULL, },
+ { 0x1c71ccccc71cccccULL, 0xc71ccccc71c7ccccULL, },
+ { 0x1c713333c71c3333ULL, 0xc71c333371c73333ULL, },
+ { 0x1c71e38ec71c38e3ULL, 0xc71c38e371c78e38ULL, },
+ { 0x1c711c71c71cc71cULL, 0xc71cc71c71c771c7ULL, },
+ { 0xfe7bfe7bb00cb00cULL, 0x4b674b670b5e0b5eULL, }, /* 64 */
+ { 0xfe7b153fb00c52fcULL, 0x4b6712f70b5ebb1aULL, },
+ { 0xfe7bab2bb00c2514ULL, 0x4b6727d80b5ec6ffULL, },
+ { 0xfe7ba942b00ce2a0ULL, 0x4b678df10b5e88d8ULL, },
+ { 0x153ffe7b52fcb00cULL, 0x12f74b67bb1a0b5eULL, },
+ { 0x153f153f52fc52fcULL, 0x12f712f7bb1abb1aULL, },
+ { 0x153fab2b52fc2514ULL, 0x12f727d8bb1ac6ffULL, },
+ { 0x153fa94252fce2a0ULL, 0x12f78df1bb1a88d8ULL, },
+ { 0xab2bfe7b2514b00cULL, 0x27d84b67c6ff0b5eULL, }, /* 72 */
+ { 0xab2b153f251452fcULL, 0x27d812f7c6ffbb1aULL, },
+ { 0xab2bab2b25142514ULL, 0x27d827d8c6ffc6ffULL, },
+ { 0xab2ba9422514e2a0ULL, 0x27d88df1c6ff88d8ULL, },
+ { 0xa942fe7be2a0b00cULL, 0x8df14b6788d80b5eULL, },
+ { 0xa942153fe2a052fcULL, 0x8df112f788d8bb1aULL, },
+ { 0xa942ab2be2a02514ULL, 0x8df127d888d8c6ffULL, },
+ { 0xa942a942e2a0e2a0ULL, 0x8df18df188d888d8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c
new file mode 100644
index 0000000000..ce044889c3
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVL.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVL.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffff00000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0xffffffff55555555ULL, 0xffffffff55555555ULL, },
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0xffffffff33333333ULL, 0xffffffff33333333ULL, },
+ { 0xffffffffe38e38e3ULL, 0xffffffff38e38e38ULL, },
+ { 0xffffffff1c71c71cULL, 0xffffffffc71c71c7ULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x00000000e38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0x000000001c71c71cULL, 0x00000000c71c71c7ULL, },
+ { 0xaaaaaaaaffffffffULL, 0xaaaaaaaaffffffffULL, }, /* 16 */
+ { 0xaaaaaaaa00000000ULL, 0xaaaaaaaa00000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa55555555ULL, 0xaaaaaaaa55555555ULL, },
+ { 0xaaaaaaaaccccccccULL, 0xaaaaaaaaccccccccULL, },
+ { 0xaaaaaaaa33333333ULL, 0xaaaaaaaa33333333ULL, },
+ { 0xaaaaaaaae38e38e3ULL, 0xaaaaaaaa38e38e38ULL, },
+ { 0xaaaaaaaa1c71c71cULL, 0xaaaaaaaac71c71c7ULL, },
+ { 0x55555555ffffffffULL, 0x55555555ffffffffULL, }, /* 24 */
+ { 0x5555555500000000ULL, 0x5555555500000000ULL, },
+ { 0x55555555aaaaaaaaULL, 0x55555555aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55555555ccccccccULL, 0x55555555ccccccccULL, },
+ { 0x5555555533333333ULL, 0x5555555533333333ULL, },
+ { 0x55555555e38e38e3ULL, 0x5555555538e38e38ULL, },
+ { 0x555555551c71c71cULL, 0x55555555c71c71c7ULL, },
+ { 0xccccccccffffffffULL, 0xccccccccffffffffULL, }, /* 32 */
+ { 0xcccccccc00000000ULL, 0xcccccccc00000000ULL, },
+ { 0xccccccccaaaaaaaaULL, 0xccccccccaaaaaaaaULL, },
+ { 0xcccccccc55555555ULL, 0xcccccccc55555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc33333333ULL, 0xcccccccc33333333ULL, },
+ { 0xcccccccce38e38e3ULL, 0xcccccccc38e38e38ULL, },
+ { 0xcccccccc1c71c71cULL, 0xccccccccc71c71c7ULL, },
+ { 0x33333333ffffffffULL, 0x33333333ffffffffULL, }, /* 40 */
+ { 0x3333333300000000ULL, 0x3333333300000000ULL, },
+ { 0x33333333aaaaaaaaULL, 0x33333333aaaaaaaaULL, },
+ { 0x3333333355555555ULL, 0x3333333355555555ULL, },
+ { 0x33333333ccccccccULL, 0x33333333ccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x33333333e38e38e3ULL, 0x3333333338e38e38ULL, },
+ { 0x333333331c71c71cULL, 0x33333333c71c71c7ULL, },
+ { 0xe38e38e3ffffffffULL, 0x38e38e38ffffffffULL, }, /* 48 */
+ { 0xe38e38e300000000ULL, 0x38e38e3800000000ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38aaaaaaaaULL, },
+ { 0xe38e38e355555555ULL, 0x38e38e3855555555ULL, },
+ { 0xe38e38e3ccccccccULL, 0x38e38e38ccccccccULL, },
+ { 0xe38e38e333333333ULL, 0x38e38e3833333333ULL, },
+ { 0xe38e38e3e38e38e3ULL, 0x38e38e3838e38e38ULL, },
+ { 0xe38e38e31c71c71cULL, 0x38e38e38c71c71c7ULL, },
+ { 0x1c71c71cffffffffULL, 0xc71c71c7ffffffffULL, }, /* 56 */
+ { 0x1c71c71c00000000ULL, 0xc71c71c700000000ULL, },
+ { 0x1c71c71caaaaaaaaULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c755555555ULL, },
+ { 0x1c71c71cccccccccULL, 0xc71c71c7ccccccccULL, },
+ { 0x1c71c71c33333333ULL, 0xc71c71c733333333ULL, },
+ { 0x1c71c71ce38e38e3ULL, 0xc71c71c738e38e38ULL, },
+ { 0x1c71c71c1c71c71cULL, 0xc71c71c7c71c71c7ULL, },
+ { 0xfe7bb00cfe7bb00cULL, 0x4b670b5e4b670b5eULL, }, /* 64 */
+ { 0xfe7bb00c153f52fcULL, 0x4b670b5e12f7bb1aULL, },
+ { 0xfe7bb00cab2b2514ULL, 0x4b670b5e27d8c6ffULL, },
+ { 0xfe7bb00ca942e2a0ULL, 0x4b670b5e8df188d8ULL, },
+ { 0x153f52fcfe7bb00cULL, 0x12f7bb1a4b670b5eULL, },
+ { 0x153f52fc153f52fcULL, 0x12f7bb1a12f7bb1aULL, },
+ { 0x153f52fcab2b2514ULL, 0x12f7bb1a27d8c6ffULL, },
+ { 0x153f52fca942e2a0ULL, 0x12f7bb1a8df188d8ULL, },
+ { 0xab2b2514fe7bb00cULL, 0x27d8c6ff4b670b5eULL, }, /* 72 */
+ { 0xab2b2514153f52fcULL, 0x27d8c6ff12f7bb1aULL, },
+ { 0xab2b2514ab2b2514ULL, 0x27d8c6ff27d8c6ffULL, },
+ { 0xab2b2514a942e2a0ULL, 0x27d8c6ff8df188d8ULL, },
+ { 0xa942e2a0fe7bb00cULL, 0x8df188d84b670b5eULL, },
+ { 0xa942e2a0153f52fcULL, 0x8df188d812f7bb1aULL, },
+ { 0xa942e2a0ab2b2514ULL, 0x8df188d827d8c6ffULL, },
+ { 0xa942e2a0a942e2a0ULL, 0x8df188d88df188d8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVL_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c
new file mode 100644
index 0000000000..f7dd1d22b0
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVOD.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVOD.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xff00ff00ff00ff00ULL, 0xff00ff00ff00ff00ULL, },
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0xff55ff55ff55ff55ULL, 0xff55ff55ff55ff55ULL, },
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0xff33ff33ff33ff33ULL, 0xff33ff33ff33ff33ULL, },
+ { 0xffe3ff38ff8effe3ULL, 0xff38ff8effe3ff38ULL, },
+ { 0xff1cffc7ff71ff1cULL, 0xffc7ff71ff1cffc7ULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x00e30038008e00e3ULL, 0x0038008e00e30038ULL, },
+ { 0x001c00c70071001cULL, 0x00c70071001c00c7ULL, },
+ { 0xaaffaaffaaffaaffULL, 0xaaffaaffaaffaaffULL, }, /* 16 */
+ { 0xaa00aa00aa00aa00ULL, 0xaa00aa00aa00aa00ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa55aa55aa55aa55ULL, 0xaa55aa55aa55aa55ULL, },
+ { 0xaaccaaccaaccaaccULL, 0xaaccaaccaaccaaccULL, },
+ { 0xaa33aa33aa33aa33ULL, 0xaa33aa33aa33aa33ULL, },
+ { 0xaae3aa38aa8eaae3ULL, 0xaa38aa8eaae3aa38ULL, },
+ { 0xaa1caac7aa71aa1cULL, 0xaac7aa71aa1caac7ULL, },
+ { 0x55ff55ff55ff55ffULL, 0x55ff55ff55ff55ffULL, }, /* 24 */
+ { 0x5500550055005500ULL, 0x5500550055005500ULL, },
+ { 0x55aa55aa55aa55aaULL, 0x55aa55aa55aa55aaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55cc55cc55cc55ccULL, 0x55cc55cc55cc55ccULL, },
+ { 0x5533553355335533ULL, 0x5533553355335533ULL, },
+ { 0x55e35538558e55e3ULL, 0x5538558e55e35538ULL, },
+ { 0x551c55c75571551cULL, 0x55c75571551c55c7ULL, },
+ { 0xccffccffccffccffULL, 0xccffccffccffccffULL, }, /* 32 */
+ { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
+ { 0xccaaccaaccaaccaaULL, 0xccaaccaaccaaccaaULL, },
+ { 0xcc55cc55cc55cc55ULL, 0xcc55cc55cc55cc55ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcc33cc33cc33cc33ULL, 0xcc33cc33cc33cc33ULL, },
+ { 0xcce3cc38cc8ecce3ULL, 0xcc38cc8ecce3cc38ULL, },
+ { 0xcc1cccc7cc71cc1cULL, 0xccc7cc71cc1cccc7ULL, },
+ { 0x33ff33ff33ff33ffULL, 0x33ff33ff33ff33ffULL, }, /* 40 */
+ { 0x3300330033003300ULL, 0x3300330033003300ULL, },
+ { 0x33aa33aa33aa33aaULL, 0x33aa33aa33aa33aaULL, },
+ { 0x3355335533553355ULL, 0x3355335533553355ULL, },
+ { 0x33cc33cc33cc33ccULL, 0x33cc33cc33cc33ccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x33e33338338e33e3ULL, 0x3338338e33e33338ULL, },
+ { 0x331c33c73371331cULL, 0x33c73371331c33c7ULL, },
+ { 0xe3ff38ff8effe3ffULL, 0x38ff8effe3ff38ffULL, }, /* 48 */
+ { 0xe30038008e00e300ULL, 0x38008e00e3003800ULL, },
+ { 0xe3aa38aa8eaae3aaULL, 0x38aa8eaae3aa38aaULL, },
+ { 0xe35538558e55e355ULL, 0x38558e55e3553855ULL, },
+ { 0xe3cc38cc8ecce3ccULL, 0x38cc8ecce3cc38ccULL, },
+ { 0xe33338338e33e333ULL, 0x38338e33e3333833ULL, },
+ { 0xe3e338388e8ee3e3ULL, 0x38388e8ee3e33838ULL, },
+ { 0xe31c38c78e71e31cULL, 0x38c78e71e31c38c7ULL, },
+ { 0x1cffc7ff71ff1cffULL, 0xc7ff71ff1cffc7ffULL, }, /* 56 */
+ { 0x1c00c70071001c00ULL, 0xc70071001c00c700ULL, },
+ { 0x1caac7aa71aa1caaULL, 0xc7aa71aa1caac7aaULL, },
+ { 0x1c55c75571551c55ULL, 0xc75571551c55c755ULL, },
+ { 0x1cccc7cc71cc1cccULL, 0xc7cc71cc1cccc7ccULL, },
+ { 0x1c33c73371331c33ULL, 0xc73371331c33c733ULL, },
+ { 0x1ce3c738718e1ce3ULL, 0xc738718e1ce3c738ULL, },
+ { 0x1c1cc7c771711c1cULL, 0xc7c771711c1cc7c7ULL, },
+ { 0x8888e6e628285555ULL, 0x4b4b0b0bfefeb0b0ULL, }, /* 64 */
+ { 0x88fbe600284d55c7ULL, 0x4b120bbbfe15b052ULL, },
+ { 0x88ace6ae28b9558bULL, 0x4b270bc6feabb025ULL, },
+ { 0x8870e616285e55e2ULL, 0x4b8d0b88fea9b0e2ULL, },
+ { 0xfb8800e64d28c755ULL, 0x124bbb0b15fe52b0ULL, },
+ { 0xfbfb00004d4dc7c7ULL, 0x1212bbbb15155252ULL, },
+ { 0xfbac00ae4db9c78bULL, 0x1227bbc615ab5225ULL, },
+ { 0xfb7000164d5ec7e2ULL, 0x128dbb8815a952e2ULL, },
+ { 0xac88aee6b9288b55ULL, 0x274bc60babfe25b0ULL, }, /* 72 */
+ { 0xacfbae00b94d8bc7ULL, 0x2712c6bbab152552ULL, },
+ { 0xacacaeaeb9b98b8bULL, 0x2727c6c6abab2525ULL, },
+ { 0xac70ae16b95e8be2ULL, 0x278dc688aba925e2ULL, },
+ { 0x708816e65e28e255ULL, 0x8d4b880ba9fee2b0ULL, },
+ { 0x70fb16005e4de2c7ULL, 0x8d1288bba915e252ULL, },
+ { 0x70ac16ae5eb9e28bULL, 0x8d2788c6a9abe225ULL, },
+ { 0x707016165e5ee2e2ULL, 0x8d8d8888a9a9e2e2ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c
new file mode 100644
index 0000000000..bef28d8ded
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVOD.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVOD.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e3ULL, 0xffffffffffffffffULL, },
+ { 0xc71c71c71c71c71cULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x38e38e38e38e38e3ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xc71c71c71c71c71cULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x5555555555555555ULL, },
+ { 0xc71c71c71c71c71cULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x38e38e38e38e38e3ULL, 0xccccccccccccccccULL, },
+ { 0xc71c71c71c71c71cULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x3333333333333333ULL, },
+ { 0xc71c71c71c71c71cULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xc71c71c71c71c71cULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71cULL, 0xc71c71c71c71c71cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x12f7bb1a153f52fcULL, 0x4b670b5efe7bb00cULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x8df188d8a942e2a0ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x12f7bb1a153f52fcULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x8df188d8a942e2a0ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x4b670b5efe7bb00cULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0x12f7bb1a153f52fcULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, },
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c
new file mode 100644
index 0000000000..d2355c6676
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVOD.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVOD.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffff0000ffff0000ULL, 0xffff0000ffff0000ULL, },
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0xffff5555ffff5555ULL, 0xffff5555ffff5555ULL, },
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0xffff3333ffff3333ULL, 0xffff3333ffff3333ULL, },
+ { 0xffffe38effff8e38ULL, 0xffff38e3ffffe38eULL, },
+ { 0xffff1c71ffff71c7ULL, 0xffffc71cffff1c71ULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x0000e38e00008e38ULL, 0x000038e30000e38eULL, },
+ { 0x00001c71000071c7ULL, 0x0000c71c00001c71ULL, },
+ { 0xaaaaffffaaaaffffULL, 0xaaaaffffaaaaffffULL, }, /* 16 */
+ { 0xaaaa0000aaaa0000ULL, 0xaaaa0000aaaa0000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaa5555aaaa5555ULL, 0xaaaa5555aaaa5555ULL, },
+ { 0xaaaaccccaaaaccccULL, 0xaaaaccccaaaaccccULL, },
+ { 0xaaaa3333aaaa3333ULL, 0xaaaa3333aaaa3333ULL, },
+ { 0xaaaae38eaaaa8e38ULL, 0xaaaa38e3aaaae38eULL, },
+ { 0xaaaa1c71aaaa71c7ULL, 0xaaaac71caaaa1c71ULL, },
+ { 0x5555ffff5555ffffULL, 0x5555ffff5555ffffULL, }, /* 24 */
+ { 0x5555000055550000ULL, 0x5555000055550000ULL, },
+ { 0x5555aaaa5555aaaaULL, 0x5555aaaa5555aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555cccc5555ccccULL, 0x5555cccc5555ccccULL, },
+ { 0x5555333355553333ULL, 0x5555333355553333ULL, },
+ { 0x5555e38e55558e38ULL, 0x555538e35555e38eULL, },
+ { 0x55551c71555571c7ULL, 0x5555c71c55551c71ULL, },
+ { 0xccccffffccccffffULL, 0xccccffffccccffffULL, }, /* 32 */
+ { 0xcccc0000cccc0000ULL, 0xcccc0000cccc0000ULL, },
+ { 0xccccaaaaccccaaaaULL, 0xccccaaaaccccaaaaULL, },
+ { 0xcccc5555cccc5555ULL, 0xcccc5555cccc5555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccc3333cccc3333ULL, 0xcccc3333cccc3333ULL, },
+ { 0xcccce38ecccc8e38ULL, 0xcccc38e3cccce38eULL, },
+ { 0xcccc1c71cccc71c7ULL, 0xccccc71ccccc1c71ULL, },
+ { 0x3333ffff3333ffffULL, 0x3333ffff3333ffffULL, }, /* 40 */
+ { 0x3333000033330000ULL, 0x3333000033330000ULL, },
+ { 0x3333aaaa3333aaaaULL, 0x3333aaaa3333aaaaULL, },
+ { 0x3333555533335555ULL, 0x3333555533335555ULL, },
+ { 0x3333cccc3333ccccULL, 0x3333cccc3333ccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x3333e38e33338e38ULL, 0x333338e33333e38eULL, },
+ { 0x33331c71333371c7ULL, 0x3333c71c33331c71ULL, },
+ { 0xe38effff8e38ffffULL, 0x38e3ffffe38effffULL, }, /* 48 */
+ { 0xe38e00008e380000ULL, 0x38e30000e38e0000ULL, },
+ { 0xe38eaaaa8e38aaaaULL, 0x38e3aaaae38eaaaaULL, },
+ { 0xe38e55558e385555ULL, 0x38e35555e38e5555ULL, },
+ { 0xe38ecccc8e38ccccULL, 0x38e3cccce38eccccULL, },
+ { 0xe38e33338e383333ULL, 0x38e33333e38e3333ULL, },
+ { 0xe38ee38e8e388e38ULL, 0x38e338e3e38ee38eULL, },
+ { 0xe38e1c718e3871c7ULL, 0x38e3c71ce38e1c71ULL, },
+ { 0x1c71ffff71c7ffffULL, 0xc71cffff1c71ffffULL, }, /* 56 */
+ { 0x1c71000071c70000ULL, 0xc71c00001c710000ULL, },
+ { 0x1c71aaaa71c7aaaaULL, 0xc71caaaa1c71aaaaULL, },
+ { 0x1c71555571c75555ULL, 0xc71c55551c715555ULL, },
+ { 0x1c71cccc71c7ccccULL, 0xc71ccccc1c71ccccULL, },
+ { 0x1c71333371c73333ULL, 0xc71c33331c713333ULL, },
+ { 0x1c71e38e71c78e38ULL, 0xc71c38e31c71e38eULL, },
+ { 0x1c711c7171c771c7ULL, 0xc71cc71c1c711c71ULL, },
+ { 0x886a886a28622862ULL, 0x4b674b67fe7bfe7bULL, }, /* 64 */
+ { 0x886afbbe28624d93ULL, 0x4b6712f7fe7b153fULL, },
+ { 0x886aac5a2862b9cfULL, 0x4b6727d8fe7bab2bULL, },
+ { 0x886a704f28625e31ULL, 0x4b678df1fe7ba942ULL, },
+ { 0xfbbe886a4d932862ULL, 0x12f74b67153ffe7bULL, },
+ { 0xfbbefbbe4d934d93ULL, 0x12f712f7153f153fULL, },
+ { 0xfbbeac5a4d93b9cfULL, 0x12f727d8153fab2bULL, },
+ { 0xfbbe704f4d935e31ULL, 0x12f78df1153fa942ULL, },
+ { 0xac5a886ab9cf2862ULL, 0x27d84b67ab2bfe7bULL, }, /* 72 */
+ { 0xac5afbbeb9cf4d93ULL, 0x27d812f7ab2b153fULL, },
+ { 0xac5aac5ab9cfb9cfULL, 0x27d827d8ab2bab2bULL, },
+ { 0xac5a704fb9cf5e31ULL, 0x27d88df1ab2ba942ULL, },
+ { 0x704f886a5e312862ULL, 0x8df14b67a942fe7bULL, },
+ { 0x704ffbbe5e314d93ULL, 0x8df112f7a942153fULL, },
+ { 0x704fac5a5e31b9cfULL, 0x8df127d8a942ab2bULL, },
+ { 0x704f704f5e315e31ULL, 0x8df18df1a942a942ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c
new file mode 100644
index 0000000000..636a62d056
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVOD.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVOD.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffff00000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0xffffffff55555555ULL, 0xffffffff55555555ULL, },
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0xffffffff33333333ULL, 0xffffffff33333333ULL, },
+ { 0xffffffffe38e38e3ULL, 0xffffffff38e38e38ULL, },
+ { 0xffffffff1c71c71cULL, 0xffffffffc71c71c7ULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x00000000e38e38e3ULL, 0x0000000038e38e38ULL, },
+ { 0x000000001c71c71cULL, 0x00000000c71c71c7ULL, },
+ { 0xaaaaaaaaffffffffULL, 0xaaaaaaaaffffffffULL, }, /* 16 */
+ { 0xaaaaaaaa00000000ULL, 0xaaaaaaaa00000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa55555555ULL, 0xaaaaaaaa55555555ULL, },
+ { 0xaaaaaaaaccccccccULL, 0xaaaaaaaaccccccccULL, },
+ { 0xaaaaaaaa33333333ULL, 0xaaaaaaaa33333333ULL, },
+ { 0xaaaaaaaae38e38e3ULL, 0xaaaaaaaa38e38e38ULL, },
+ { 0xaaaaaaaa1c71c71cULL, 0xaaaaaaaac71c71c7ULL, },
+ { 0x55555555ffffffffULL, 0x55555555ffffffffULL, }, /* 24 */
+ { 0x5555555500000000ULL, 0x5555555500000000ULL, },
+ { 0x55555555aaaaaaaaULL, 0x55555555aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55555555ccccccccULL, 0x55555555ccccccccULL, },
+ { 0x5555555533333333ULL, 0x5555555533333333ULL, },
+ { 0x55555555e38e38e3ULL, 0x5555555538e38e38ULL, },
+ { 0x555555551c71c71cULL, 0x55555555c71c71c7ULL, },
+ { 0xccccccccffffffffULL, 0xccccccccffffffffULL, }, /* 32 */
+ { 0xcccccccc00000000ULL, 0xcccccccc00000000ULL, },
+ { 0xccccccccaaaaaaaaULL, 0xccccccccaaaaaaaaULL, },
+ { 0xcccccccc55555555ULL, 0xcccccccc55555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc33333333ULL, 0xcccccccc33333333ULL, },
+ { 0xcccccccce38e38e3ULL, 0xcccccccc38e38e38ULL, },
+ { 0xcccccccc1c71c71cULL, 0xccccccccc71c71c7ULL, },
+ { 0x33333333ffffffffULL, 0x33333333ffffffffULL, }, /* 40 */
+ { 0x3333333300000000ULL, 0x3333333300000000ULL, },
+ { 0x33333333aaaaaaaaULL, 0x33333333aaaaaaaaULL, },
+ { 0x3333333355555555ULL, 0x3333333355555555ULL, },
+ { 0x33333333ccccccccULL, 0x33333333ccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x33333333e38e38e3ULL, 0x3333333338e38e38ULL, },
+ { 0x333333331c71c71cULL, 0x33333333c71c71c7ULL, },
+ { 0xe38e38e3ffffffffULL, 0x38e38e38ffffffffULL, }, /* 48 */
+ { 0xe38e38e300000000ULL, 0x38e38e3800000000ULL, },
+ { 0xe38e38e3aaaaaaaaULL, 0x38e38e38aaaaaaaaULL, },
+ { 0xe38e38e355555555ULL, 0x38e38e3855555555ULL, },
+ { 0xe38e38e3ccccccccULL, 0x38e38e38ccccccccULL, },
+ { 0xe38e38e333333333ULL, 0x38e38e3833333333ULL, },
+ { 0xe38e38e3e38e38e3ULL, 0x38e38e3838e38e38ULL, },
+ { 0xe38e38e31c71c71cULL, 0x38e38e38c71c71c7ULL, },
+ { 0x1c71c71cffffffffULL, 0xc71c71c7ffffffffULL, }, /* 56 */
+ { 0x1c71c71c00000000ULL, 0xc71c71c700000000ULL, },
+ { 0x1c71c71caaaaaaaaULL, 0xc71c71c7aaaaaaaaULL, },
+ { 0x1c71c71c55555555ULL, 0xc71c71c755555555ULL, },
+ { 0x1c71c71cccccccccULL, 0xc71c71c7ccccccccULL, },
+ { 0x1c71c71c33333333ULL, 0xc71c71c733333333ULL, },
+ { 0x1c71c71ce38e38e3ULL, 0xc71c71c738e38e38ULL, },
+ { 0x1c71c71c1c71c71cULL, 0xc71c71c7c71c71c7ULL, },
+ { 0x886ae6cc886ae6ccULL, 0x4b670b5e4b670b5eULL, }, /* 64 */
+ { 0x886ae6ccfbbe0063ULL, 0x4b670b5e12f7bb1aULL, },
+ { 0x886ae6ccac5aaeaaULL, 0x4b670b5e27d8c6ffULL, },
+ { 0x886ae6cc704f164dULL, 0x4b670b5e8df188d8ULL, },
+ { 0xfbbe0063886ae6ccULL, 0x12f7bb1a4b670b5eULL, },
+ { 0xfbbe0063fbbe0063ULL, 0x12f7bb1a12f7bb1aULL, },
+ { 0xfbbe0063ac5aaeaaULL, 0x12f7bb1a27d8c6ffULL, },
+ { 0xfbbe0063704f164dULL, 0x12f7bb1a8df188d8ULL, },
+ { 0xac5aaeaa886ae6ccULL, 0x27d8c6ff4b670b5eULL, }, /* 72 */
+ { 0xac5aaeaafbbe0063ULL, 0x27d8c6ff12f7bb1aULL, },
+ { 0xac5aaeaaac5aaeaaULL, 0x27d8c6ff27d8c6ffULL, },
+ { 0xac5aaeaa704f164dULL, 0x27d8c6ff8df188d8ULL, },
+ { 0x704f164d886ae6ccULL, 0x8df188d84b670b5eULL, },
+ { 0x704f164dfbbe0063ULL, 0x8df188d812f7bb1aULL, },
+ { 0x704f164dac5aaeaaULL, 0x8df188d827d8c6ffULL, },
+ { 0x704f164d704f164dULL, 0x8df188d88df188d8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVOD_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c
new file mode 100644
index 0000000000..75bc9de9f9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVR.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVR.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xff00ff00ff00ff00ULL, 0xff00ff00ff00ff00ULL, },
+ { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+ { 0xff55ff55ff55ff55ULL, 0xff55ff55ff55ff55ULL, },
+ { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+ { 0xff33ff33ff33ff33ULL, 0xff33ff33ff33ff33ULL, },
+ { 0xff8eff38ffe3ff8eULL, 0xffe3ff8eff38ffe3ULL, },
+ { 0xff71ffc7ff1cff71ULL, 0xff1cff71ffc7ff1cULL, },
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+ { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+ { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x008e003800e3008eULL, 0x00e3008e003800e3ULL, },
+ { 0x007100c7001c0071ULL, 0x001c007100c7001cULL, },
+ { 0xaaffaaffaaffaaffULL, 0xaaffaaffaaffaaffULL, }, /* 16 */
+ { 0xaa00aa00aa00aa00ULL, 0xaa00aa00aa00aa00ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaa55aa55aa55aa55ULL, 0xaa55aa55aa55aa55ULL, },
+ { 0xaaccaaccaaccaaccULL, 0xaaccaaccaaccaaccULL, },
+ { 0xaa33aa33aa33aa33ULL, 0xaa33aa33aa33aa33ULL, },
+ { 0xaa8eaa38aae3aa8eULL, 0xaae3aa8eaa38aae3ULL, },
+ { 0xaa71aac7aa1caa71ULL, 0xaa1caa71aac7aa1cULL, },
+ { 0x55ff55ff55ff55ffULL, 0x55ff55ff55ff55ffULL, }, /* 24 */
+ { 0x5500550055005500ULL, 0x5500550055005500ULL, },
+ { 0x55aa55aa55aa55aaULL, 0x55aa55aa55aa55aaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55cc55cc55cc55ccULL, 0x55cc55cc55cc55ccULL, },
+ { 0x5533553355335533ULL, 0x5533553355335533ULL, },
+ { 0x558e553855e3558eULL, 0x55e3558e553855e3ULL, },
+ { 0x557155c7551c5571ULL, 0x551c557155c7551cULL, },
+ { 0xccffccffccffccffULL, 0xccffccffccffccffULL, }, /* 32 */
+ { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
+ { 0xccaaccaaccaaccaaULL, 0xccaaccaaccaaccaaULL, },
+ { 0xcc55cc55cc55cc55ULL, 0xcc55cc55cc55cc55ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcc33cc33cc33cc33ULL, 0xcc33cc33cc33cc33ULL, },
+ { 0xcc8ecc38cce3cc8eULL, 0xcce3cc8ecc38cce3ULL, },
+ { 0xcc71ccc7cc1ccc71ULL, 0xcc1ccc71ccc7cc1cULL, },
+ { 0x33ff33ff33ff33ffULL, 0x33ff33ff33ff33ffULL, }, /* 40 */
+ { 0x3300330033003300ULL, 0x3300330033003300ULL, },
+ { 0x33aa33aa33aa33aaULL, 0x33aa33aa33aa33aaULL, },
+ { 0x3355335533553355ULL, 0x3355335533553355ULL, },
+ { 0x33cc33cc33cc33ccULL, 0x33cc33cc33cc33ccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x338e333833e3338eULL, 0x33e3338e333833e3ULL, },
+ { 0x337133c7331c3371ULL, 0x331c337133c7331cULL, },
+ { 0x8eff38ffe3ff8effULL, 0xe3ff8eff38ffe3ffULL, }, /* 48 */
+ { 0x8e003800e3008e00ULL, 0xe3008e003800e300ULL, },
+ { 0x8eaa38aae3aa8eaaULL, 0xe3aa8eaa38aae3aaULL, },
+ { 0x8e553855e3558e55ULL, 0xe3558e553855e355ULL, },
+ { 0x8ecc38cce3cc8eccULL, 0xe3cc8ecc38cce3ccULL, },
+ { 0x8e333833e3338e33ULL, 0xe3338e333833e333ULL, },
+ { 0x8e8e3838e3e38e8eULL, 0xe3e38e8e3838e3e3ULL, },
+ { 0x8e7138c7e31c8e71ULL, 0xe31c8e7138c7e31cULL, },
+ { 0x71ffc7ff1cff71ffULL, 0x1cff71ffc7ff1cffULL, }, /* 56 */
+ { 0x7100c7001c007100ULL, 0x1c007100c7001c00ULL, },
+ { 0x71aac7aa1caa71aaULL, 0x1caa71aac7aa1caaULL, },
+ { 0x7155c7551c557155ULL, 0x1c557155c7551c55ULL, },
+ { 0x71ccc7cc1ccc71ccULL, 0x1ccc71ccc7cc1cccULL, },
+ { 0x7133c7331c337133ULL, 0x1c337133c7331c33ULL, },
+ { 0x718ec7381ce3718eULL, 0x1ce3718ec7381ce3ULL, },
+ { 0x7171c7c71c1c7171ULL, 0x1c1c7171c7c71c1cULL, },
+ { 0x2828626255554040ULL, 0x88886a6ae6e6ccccULL, }, /* 64 */
+ { 0x284d629355c74008ULL, 0x88fb6abee600cc63ULL, },
+ { 0x28b962cf558b4080ULL, 0x88ac6a5ae6aeccaaULL, },
+ { 0x285e623155e2404eULL, 0x88706a4fe616cc4dULL, },
+ { 0x4d289362c7550840ULL, 0xfb88be6a00e663ccULL, },
+ { 0x4d4d9393c7c70808ULL, 0xfbfbbebe00006363ULL, },
+ { 0x4db993cfc78b0880ULL, 0xfbacbe5a00ae63aaULL, },
+ { 0x4d5e9331c7e2084eULL, 0xfb70be4f0016634dULL, },
+ { 0xb928cf628b558040ULL, 0xac885a6aaee6aaccULL, }, /* 72 */
+ { 0xb94dcf938bc78008ULL, 0xacfb5abeae00aa63ULL, },
+ { 0xb9b9cfcf8b8b8080ULL, 0xacac5a5aaeaeaaaaULL, },
+ { 0xb95ecf318be2804eULL, 0xac705a4fae16aa4dULL, },
+ { 0x5e283162e2554e40ULL, 0x70884f6a16e64dccULL, },
+ { 0x5e4d3193e2c74e08ULL, 0x70fb4fbe16004d63ULL, },
+ { 0x5eb931cfe28b4e80ULL, 0x70ac4f5a16ae4daaULL, },
+ { 0x5e5e3131e2e24e4eULL, 0x70704f4f16164d4dULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c
new file mode 100644
index 0000000000..a80aa446f8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVR.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVR.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e38e38e38eULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0xe38e38e38e38e38eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555555ULL, 0xe38e38e38e38e38eULL, },
+ { 0xccccccccccccccccULL, 0xe38e38e38e38e38eULL, },
+ { 0x3333333333333333ULL, 0xe38e38e38e38e38eULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x1c71c71c71c71c71ULL, 0xe38e38e38e38e38eULL, },
+ { 0xffffffffffffffffULL, 0x1c71c71c71c71c71ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x1c71c71c71c71c71ULL, },
+ { 0x5555555555555555ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xccccccccccccccccULL, 0x1c71c71c71c71c71ULL, },
+ { 0x3333333333333333ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe38e38e38e38e38eULL, 0x1c71c71c71c71c71ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x886ae6cc28625540ULL, },
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, },
+ { 0x886ae6cc28625540ULL, 0xfbbe00634d93c708ULL, },
+ { 0xfbbe00634d93c708ULL, 0xfbbe00634d93c708ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x886ae6cc28625540ULL, 0xac5aaeaab9cf8b80ULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, },
+ { 0xfbbe00634d93c708ULL, 0x704f164d5e31e24eULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x704f164d5e31e24eULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c
new file mode 100644
index 0000000000..caa00224fd
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVR.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVR.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffff0000ffff0000ULL, 0xffff0000ffff0000ULL, },
+ { 0xffffaaaaffffaaaaULL, 0xffffaaaaffffaaaaULL, },
+ { 0xffff5555ffff5555ULL, 0xffff5555ffff5555ULL, },
+ { 0xffffccccffffccccULL, 0xffffccccffffccccULL, },
+ { 0xffff3333ffff3333ULL, 0xffff3333ffff3333ULL, },
+ { 0xffff8e38ffffe38eULL, 0xffffe38effff38e3ULL, },
+ { 0xffff71c7ffff1c71ULL, 0xffff1c71ffffc71cULL, },
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000aaaa0000aaaaULL, 0x0000aaaa0000aaaaULL, },
+ { 0x0000555500005555ULL, 0x0000555500005555ULL, },
+ { 0x0000cccc0000ccccULL, 0x0000cccc0000ccccULL, },
+ { 0x0000333300003333ULL, 0x0000333300003333ULL, },
+ { 0x00008e380000e38eULL, 0x0000e38e000038e3ULL, },
+ { 0x000071c700001c71ULL, 0x00001c710000c71cULL, },
+ { 0xaaaaffffaaaaffffULL, 0xaaaaffffaaaaffffULL, }, /* 16 */
+ { 0xaaaa0000aaaa0000ULL, 0xaaaa0000aaaa0000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaa5555aaaa5555ULL, 0xaaaa5555aaaa5555ULL, },
+ { 0xaaaaccccaaaaccccULL, 0xaaaaccccaaaaccccULL, },
+ { 0xaaaa3333aaaa3333ULL, 0xaaaa3333aaaa3333ULL, },
+ { 0xaaaa8e38aaaae38eULL, 0xaaaae38eaaaa38e3ULL, },
+ { 0xaaaa71c7aaaa1c71ULL, 0xaaaa1c71aaaac71cULL, },
+ { 0x5555ffff5555ffffULL, 0x5555ffff5555ffffULL, }, /* 24 */
+ { 0x5555000055550000ULL, 0x5555000055550000ULL, },
+ { 0x5555aaaa5555aaaaULL, 0x5555aaaa5555aaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555cccc5555ccccULL, 0x5555cccc5555ccccULL, },
+ { 0x5555333355553333ULL, 0x5555333355553333ULL, },
+ { 0x55558e385555e38eULL, 0x5555e38e555538e3ULL, },
+ { 0x555571c755551c71ULL, 0x55551c715555c71cULL, },
+ { 0xccccffffccccffffULL, 0xccccffffccccffffULL, }, /* 32 */
+ { 0xcccc0000cccc0000ULL, 0xcccc0000cccc0000ULL, },
+ { 0xccccaaaaccccaaaaULL, 0xccccaaaaccccaaaaULL, },
+ { 0xcccc5555cccc5555ULL, 0xcccc5555cccc5555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccc3333cccc3333ULL, 0xcccc3333cccc3333ULL, },
+ { 0xcccc8e38cccce38eULL, 0xcccce38ecccc38e3ULL, },
+ { 0xcccc71c7cccc1c71ULL, 0xcccc1c71ccccc71cULL, },
+ { 0x3333ffff3333ffffULL, 0x3333ffff3333ffffULL, }, /* 40 */
+ { 0x3333000033330000ULL, 0x3333000033330000ULL, },
+ { 0x3333aaaa3333aaaaULL, 0x3333aaaa3333aaaaULL, },
+ { 0x3333555533335555ULL, 0x3333555533335555ULL, },
+ { 0x3333cccc3333ccccULL, 0x3333cccc3333ccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x33338e383333e38eULL, 0x3333e38e333338e3ULL, },
+ { 0x333371c733331c71ULL, 0x33331c713333c71cULL, },
+ { 0x8e38ffffe38effffULL, 0xe38effff38e3ffffULL, }, /* 48 */
+ { 0x8e380000e38e0000ULL, 0xe38e000038e30000ULL, },
+ { 0x8e38aaaae38eaaaaULL, 0xe38eaaaa38e3aaaaULL, },
+ { 0x8e385555e38e5555ULL, 0xe38e555538e35555ULL, },
+ { 0x8e38cccce38eccccULL, 0xe38ecccc38e3ccccULL, },
+ { 0x8e383333e38e3333ULL, 0xe38e333338e33333ULL, },
+ { 0x8e388e38e38ee38eULL, 0xe38ee38e38e338e3ULL, },
+ { 0x8e3871c7e38e1c71ULL, 0xe38e1c7138e3c71cULL, },
+ { 0x71c7ffff1c71ffffULL, 0x1c71ffffc71cffffULL, }, /* 56 */
+ { 0x71c700001c710000ULL, 0x1c710000c71c0000ULL, },
+ { 0x71c7aaaa1c71aaaaULL, 0x1c71aaaac71caaaaULL, },
+ { 0x71c755551c715555ULL, 0x1c715555c71c5555ULL, },
+ { 0x71c7cccc1c71ccccULL, 0x1c71ccccc71cccccULL, },
+ { 0x71c733331c713333ULL, 0x1c713333c71c3333ULL, },
+ { 0x71c78e381c71e38eULL, 0x1c71e38ec71c38e3ULL, },
+ { 0x71c771c71c711c71ULL, 0x1c711c71c71cc71cULL, },
+ { 0x2862286255405540ULL, 0x886a886ae6cce6ccULL, }, /* 64 */
+ { 0x28624d935540c708ULL, 0x886afbbee6cc0063ULL, },
+ { 0x2862b9cf55408b80ULL, 0x886aac5ae6ccaeaaULL, },
+ { 0x28625e315540e24eULL, 0x886a704fe6cc164dULL, },
+ { 0x4d932862c7085540ULL, 0xfbbe886a0063e6ccULL, },
+ { 0x4d934d93c708c708ULL, 0xfbbefbbe00630063ULL, },
+ { 0x4d93b9cfc7088b80ULL, 0xfbbeac5a0063aeaaULL, },
+ { 0x4d935e31c708e24eULL, 0xfbbe704f0063164dULL, },
+ { 0xb9cf28628b805540ULL, 0xac5a886aaeaae6ccULL, }, /* 72 */
+ { 0xb9cf4d938b80c708ULL, 0xac5afbbeaeaa0063ULL, },
+ { 0xb9cfb9cf8b808b80ULL, 0xac5aac5aaeaaaeaaULL, },
+ { 0xb9cf5e318b80e24eULL, 0xac5a704faeaa164dULL, },
+ { 0x5e312862e24e5540ULL, 0x704f886a164de6ccULL, },
+ { 0x5e314d93e24ec708ULL, 0x704ffbbe164d0063ULL, },
+ { 0x5e31b9cfe24e8b80ULL, 0x704fac5a164daeaaULL, },
+ { 0x5e315e31e24ee24eULL, 0x704f704f164d164dULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c
new file mode 100644
index 0000000000..65c89a3712
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction ILVR.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Interleave";
+ char *instruction_name = "ILVR.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffff00000000ULL, 0xffffffff00000000ULL, },
+ { 0xffffffffaaaaaaaaULL, 0xffffffffaaaaaaaaULL, },
+ { 0xffffffff55555555ULL, 0xffffffff55555555ULL, },
+ { 0xffffffffccccccccULL, 0xffffffffccccccccULL, },
+ { 0xffffffff33333333ULL, 0xffffffff33333333ULL, },
+ { 0xffffffff8e38e38eULL, 0xffffffffe38e38e3ULL, },
+ { 0xffffffff71c71c71ULL, 0xffffffff1c71c71cULL, },
+ { 0x00000000ffffffffULL, 0x00000000ffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x00000000aaaaaaaaULL, 0x00000000aaaaaaaaULL, },
+ { 0x0000000055555555ULL, 0x0000000055555555ULL, },
+ { 0x00000000ccccccccULL, 0x00000000ccccccccULL, },
+ { 0x0000000033333333ULL, 0x0000000033333333ULL, },
+ { 0x000000008e38e38eULL, 0x00000000e38e38e3ULL, },
+ { 0x0000000071c71c71ULL, 0x000000001c71c71cULL, },
+ { 0xaaaaaaaaffffffffULL, 0xaaaaaaaaffffffffULL, }, /* 16 */
+ { 0xaaaaaaaa00000000ULL, 0xaaaaaaaa00000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaa55555555ULL, 0xaaaaaaaa55555555ULL, },
+ { 0xaaaaaaaaccccccccULL, 0xaaaaaaaaccccccccULL, },
+ { 0xaaaaaaaa33333333ULL, 0xaaaaaaaa33333333ULL, },
+ { 0xaaaaaaaa8e38e38eULL, 0xaaaaaaaae38e38e3ULL, },
+ { 0xaaaaaaaa71c71c71ULL, 0xaaaaaaaa1c71c71cULL, },
+ { 0x55555555ffffffffULL, 0x55555555ffffffffULL, }, /* 24 */
+ { 0x5555555500000000ULL, 0x5555555500000000ULL, },
+ { 0x55555555aaaaaaaaULL, 0x55555555aaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x55555555ccccccccULL, 0x55555555ccccccccULL, },
+ { 0x5555555533333333ULL, 0x5555555533333333ULL, },
+ { 0x555555558e38e38eULL, 0x55555555e38e38e3ULL, },
+ { 0x5555555571c71c71ULL, 0x555555551c71c71cULL, },
+ { 0xccccccccffffffffULL, 0xccccccccffffffffULL, }, /* 32 */
+ { 0xcccccccc00000000ULL, 0xcccccccc00000000ULL, },
+ { 0xccccccccaaaaaaaaULL, 0xccccccccaaaaaaaaULL, },
+ { 0xcccccccc55555555ULL, 0xcccccccc55555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xcccccccc33333333ULL, 0xcccccccc33333333ULL, },
+ { 0xcccccccc8e38e38eULL, 0xcccccccce38e38e3ULL, },
+ { 0xcccccccc71c71c71ULL, 0xcccccccc1c71c71cULL, },
+ { 0x33333333ffffffffULL, 0x33333333ffffffffULL, }, /* 40 */
+ { 0x3333333300000000ULL, 0x3333333300000000ULL, },
+ { 0x33333333aaaaaaaaULL, 0x33333333aaaaaaaaULL, },
+ { 0x3333333355555555ULL, 0x3333333355555555ULL, },
+ { 0x33333333ccccccccULL, 0x33333333ccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x333333338e38e38eULL, 0x33333333e38e38e3ULL, },
+ { 0x3333333371c71c71ULL, 0x333333331c71c71cULL, },
+ { 0x8e38e38effffffffULL, 0xe38e38e3ffffffffULL, }, /* 48 */
+ { 0x8e38e38e00000000ULL, 0xe38e38e300000000ULL, },
+ { 0x8e38e38eaaaaaaaaULL, 0xe38e38e3aaaaaaaaULL, },
+ { 0x8e38e38e55555555ULL, 0xe38e38e355555555ULL, },
+ { 0x8e38e38eccccccccULL, 0xe38e38e3ccccccccULL, },
+ { 0x8e38e38e33333333ULL, 0xe38e38e333333333ULL, },
+ { 0x8e38e38e8e38e38eULL, 0xe38e38e3e38e38e3ULL, },
+ { 0x8e38e38e71c71c71ULL, 0xe38e38e31c71c71cULL, },
+ { 0x71c71c71ffffffffULL, 0x1c71c71cffffffffULL, }, /* 56 */
+ { 0x71c71c7100000000ULL, 0x1c71c71c00000000ULL, },
+ { 0x71c71c71aaaaaaaaULL, 0x1c71c71caaaaaaaaULL, },
+ { 0x71c71c7155555555ULL, 0x1c71c71c55555555ULL, },
+ { 0x71c71c71ccccccccULL, 0x1c71c71cccccccccULL, },
+ { 0x71c71c7133333333ULL, 0x1c71c71c33333333ULL, },
+ { 0x71c71c718e38e38eULL, 0x1c71c71ce38e38e3ULL, },
+ { 0x71c71c7171c71c71ULL, 0x1c71c71c1c71c71cULL, },
+ { 0x2862554028625540ULL, 0x886ae6cc886ae6ccULL, }, /* 64 */
+ { 0x286255404d93c708ULL, 0x886ae6ccfbbe0063ULL, },
+ { 0x28625540b9cf8b80ULL, 0x886ae6ccac5aaeaaULL, },
+ { 0x286255405e31e24eULL, 0x886ae6cc704f164dULL, },
+ { 0x4d93c70828625540ULL, 0xfbbe0063886ae6ccULL, },
+ { 0x4d93c7084d93c708ULL, 0xfbbe0063fbbe0063ULL, },
+ { 0x4d93c708b9cf8b80ULL, 0xfbbe0063ac5aaeaaULL, },
+ { 0x4d93c7085e31e24eULL, 0xfbbe0063704f164dULL, },
+ { 0xb9cf8b8028625540ULL, 0xac5aaeaa886ae6ccULL, }, /* 72 */
+ { 0xb9cf8b804d93c708ULL, 0xac5aaeaafbbe0063ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xac5aaeaaac5aaeaaULL, },
+ { 0xb9cf8b805e31e24eULL, 0xac5aaeaa704f164dULL, },
+ { 0x5e31e24e28625540ULL, 0x704f164d886ae6ccULL, },
+ { 0x5e31e24e4d93c708ULL, 0x704f164dfbbe0063ULL, },
+ { 0x5e31e24eb9cf8b80ULL, 0x704f164dac5aaeaaULL, },
+ { 0x5e31e24e5e31e24eULL, 0x704f164d704f164dULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_ILVR_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c
new file mode 100644
index 0000000000..22d1f9cc0f
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction AND.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Logic";
+ char *instruction_name = "AND.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0xa28a28a28a28a28aULL, 0x28a28a28a28a28a2ULL, },
+ { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+ { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xc08c08c08c08c08cULL, 0x08c08c08c08c08c0ULL, },
+ { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+ { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xa28a28a28a28a28aULL, 0x28a28a28a28a28a2ULL, },
+ { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+ { 0xc08c08c08c08c08cULL, 0x08c08c08c08c08c0ULL, },
+ { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+ { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+ { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+ { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x882a004008024500ULL, 0x02670b1a143b100cULL, },
+ { 0x884aa68828420100ULL, 0x0340025eaa2b2004ULL, },
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+ { 0x882a004008024500ULL, 0x02670b1a143b100cULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xa81a002209838300ULL, 0x02d0821a012b0014ULL, },
+ { 0x700e00414c11c208ULL, 0x00f18818010242a0ULL, },
+ { 0x884aa68828420100ULL, 0x0340025eaa2b2004ULL, }, /* 72 */
+ { 0xa81a002209838300ULL, 0x02d0821a012b0014ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x204a060818018200ULL, 0x05d080d8a9022000ULL, },
+ { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+ { 0x700e00414c11c208ULL, 0x00f18818010242a0ULL, },
+ { 0x204a060818018200ULL, 0x05d080d8a9022000ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AND_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_AND_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c
new file mode 100644
index 0000000000..3b9e481582
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction NOR.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Logic";
+ char *instruction_name = "NOR.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+ { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+ { 0xa28a28a28a28a28aULL, 0x28a28a28a28a28a2ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+ { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+ { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+ { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+ { 0xc08c08c08c08c08cULL, 0x08c08c08c08c08c0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+ { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+ { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+ { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+ { 0xa28a28a28a28a28aULL, 0x28a28a28a28a28a2ULL, },
+ { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+ { 0xc08c08c08c08c08cULL, 0x08c08c08c08c08c0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x77951933d79daabfULL, 0xb498f4a101844ff3ULL, }, /* 64 */
+ { 0x04011910920c28b7ULL, 0xa40844a100800d03ULL, },
+ { 0x538511114610203fULL, 0x9000300000844ae3ULL, },
+ { 0x07900932818c08b1ULL, 0x3008742100840d53ULL, },
+ { 0x04011910920c28b7ULL, 0xa40844a100800d03ULL, },
+ { 0x0441ff9cb26c38f7ULL, 0xed0844e5eac0ad03ULL, },
+ { 0x0001511402203077ULL, 0xc800000040c08803ULL, },
+ { 0x0400e990a04c18b1ULL, 0x6008442542800d03ULL, },
+ { 0x538511114610203fULL, 0x9000300000844ae3ULL, }, /* 72 */
+ { 0x0001511402203077ULL, 0xc800000040c08803ULL, },
+ { 0x53a551554630747fULL, 0xd827390054d4daebULL, },
+ { 0x03a0411000001431ULL, 0x500631005494184bULL, },
+ { 0x07900932818c08b1ULL, 0x3008742100840d53ULL, },
+ { 0x0400e990a04c18b1ULL, 0x6008442542800d03ULL, },
+ { 0x03a0411000001431ULL, 0x500631005494184bULL, },
+ { 0x8fb0e9b2a1ce1db1ULL, 0x720e772756bd1d5fULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_NOR_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_NOR_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c
new file mode 100644
index 0000000000..e6e5da4efb
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction OR.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Logic";
+ char *instruction_name = "OR.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0xebaebaebaebaebaeULL, 0xbaebaebaebaebaebULL, },
+ { 0xbefbefbefbefbefbULL, 0xefbefbefbefbefbeULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xf7df7df7df7df7dfULL, 0x7df7df7df7df7df7ULL, },
+ { 0x5d75d75d75d75d75ULL, 0xd75d75d75d75d75dULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xeeeeeeeeeeeeeeeeULL, 0xeeeeeeeeeeeeeeeeULL, },
+ { 0xddddddddddddddddULL, 0xddddddddddddddddULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xefcefcefcefcefceULL, 0xfcefcefcefcefcefULL, },
+ { 0xdcfdcfdcfdcfdcfdULL, 0xcfdcfdcfdcfdcfdcULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xbbbbbbbbbbbbbbbbULL, 0xbbbbbbbbbbbbbbbbULL, },
+ { 0x7777777777777777ULL, 0x7777777777777777ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xf3bf3bf3bf3bf3bfULL, 0x3bf3bf3bf3bf3bf3ULL, },
+ { 0x3f73f73f73f73f73ULL, 0xf73f73f73f73f73fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xebaebaebaebaebaeULL, 0xbaebaebaebaebaebULL, },
+ { 0xf7df7df7df7df7dfULL, 0x7df7df7df7df7df7ULL, },
+ { 0xefcefcefcefcefceULL, 0xfcefcefcefcefcefULL, },
+ { 0xf3bf3bf3bf3bf3bfULL, 0x3bf3bf3bf3bf3bf3ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xbefbefbefbefbefbULL, 0xefbefbefbefbefbeULL, },
+ { 0x5d75d75d75d75d75ULL, 0xd75d75d75d75d75dULL, },
+ { 0xdcfdcfdcfdcfdcfdULL, 0xcfdcfdcfdcfdcfdcULL, },
+ { 0x3f73f73f73f73f73ULL, 0xf73f73f73f73f73fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbfee6ef6df3d748ULL, 0x5bf7bb5eff7ff2fcULL, },
+ { 0xac7aeeeeb9efdfc0ULL, 0x6fffcfffff7bb51cULL, },
+ { 0xf86ff6cd7e73f74eULL, 0xcff78bdeff7bf2acULL, },
+ { 0xfbfee6ef6df3d748ULL, 0x5bf7bb5eff7ff2fcULL, },
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xfffeaeebfddfcf88ULL, 0x37ffffffbf3f77fcULL, },
+ { 0xfbff166f5fb3e74eULL, 0x9ff7bbdabd7ff2fcULL, },
+ { 0xac7aeeeeb9efdfc0ULL, 0x6fffcfffff7bb51cULL, }, /* 72 */
+ { 0xfffeaeebfddfcf88ULL, 0x37ffffffbf3f77fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0xfc5fbeefffffebceULL, 0xaff9ceffab6be7b4ULL, },
+ { 0xf86ff6cd7e73f74eULL, 0xcff78bdeff7bf2acULL, },
+ { 0xfbff166f5fb3e74eULL, 0x9ff7bbdabd7ff2fcULL, },
+ { 0xfc5fbeefffffebceULL, 0xaff9ceffab6be7b4ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_OR_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_OR_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c b/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c
new file mode 100644
index 0000000000..1b699b5ca4
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction XOR.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Logic";
+ char *instruction_name = "XOR.V";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x4924924924924924ULL, 0x9249249249249249ULL, },
+ { 0xb6db6db6db6db6dbULL, 0x6db6db6db6db6db6ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xb6db6db6db6db6dbULL, 0x6db6db6db6db6db6ULL, },
+ { 0x4924924924924924ULL, 0x9249249249249249ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x2f42f42f42f42f42ULL, 0xf42f42f42f42f42fULL, },
+ { 0xd0bd0bd0bd0bd0bdULL, 0x0bd0bd0bd0bd0bd0ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x9999999999999999ULL, 0x9999999999999999ULL, },
+ { 0x6666666666666666ULL, 0x6666666666666666ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xd0bd0bd0bd0bd0bdULL, 0x0bd0bd0bd0bd0bd0ULL, },
+ { 0x2f42f42f42f42f42ULL, 0xf42f42f42f42f42fULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x4924924924924924ULL, 0x9249249249249249ULL, },
+ { 0xb6db6db6db6db6dbULL, 0x6db6db6db6db6db6ULL, },
+ { 0x2f42f42f42f42f42ULL, 0xf42f42f42f42f42fULL, },
+ { 0xd0bd0bd0bd0bd0bdULL, 0x0bd0bd0bd0bd0bd0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xb6db6db6db6db6dbULL, 0x6db6db6db6db6db6ULL, },
+ { 0x4924924924924924ULL, 0x9249249249249249ULL, },
+ { 0xd0bd0bd0bd0bd0bdULL, 0x0bd0bd0bd0bd0bd0ULL, },
+ { 0x2f42f42f42f42f42ULL, 0xf42f42f42f42f42fULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
+ { 0x73d4e6af65f19248ULL, 0x5990b044eb44e2f0ULL, },
+ { 0x2430486691addec0ULL, 0x6cbfcda155509518ULL, },
+ { 0xf825f0817653b70eULL, 0xc6968386573952acULL, },
+ { 0x73d4e6af65f19248ULL, 0x5990b044eb44e2f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x57e4aec9f45c4c88ULL, 0x352f7de5be1477e8ULL, },
+ { 0x8bf1162e13a22546ULL, 0x9f0633c2bc7db05cULL, },
+ { 0x2430486691addec0ULL, 0x6cbfcda155509518ULL, }, /* 72 */
+ { 0x57e4aec9f45c4c88ULL, 0x352f7de5be1477e8ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xdc15b8e7e7fe69ceULL, 0xaa294e270269c7b4ULL, },
+ { 0xf825f0817653b70eULL, 0xc6968386573952acULL, },
+ { 0x8bf1162e13a22546ULL, 0x9f0633c2bc7db05cULL, },
+ { 0xdc15b8e7e7fe69ceULL, 0xaa294e270269c7b4ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_XOR_V(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_XOR_V(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/move/test_msa_move_v.c b/tests/tcg/mips/user/ase/msa/move/test_msa_move_v.c
new file mode 100644
index 0000000000..ef2aa6dbdd
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/move/test_msa_move_v.c
@@ -0,0 +1,149 @@
+/*
+ * Test program for MSA instruction MOVE.V
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Move";
+ char *instruction_name = "MOVE.V";
+ int32_t ret;
+ uint32_t i;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xf0f0f0f0f0f0f0f0ULL, 0xf0f0f0f0f0f0f0f0ULL, }, /* 8 */
+ { 0x0f0f0f0f0f0f0f0fULL, 0x0f0f0f0f0f0f0f0fULL, },
+ { 0xf83e0f83e0f83e0fULL, 0x83e0f83e0f83e0f8ULL, },
+ { 0x07c1f07c1f07c1f0ULL, 0x7c1f07c1f07c1f07ULL, },
+ { 0xfc0fc0fc0fc0fc0fULL, 0xc0fc0fc0fc0fc0fcULL, },
+ { 0x03f03f03f03f03f0ULL, 0x3f03f03f03f03f03ULL, },
+ { 0xfe03f80fe03f80feULL, 0x03f80fe03f80fe03ULL, },
+ { 0x01fc07f01fc07f01ULL, 0xfc07f01fc07f01fcULL, },
+ { 0xff00ff00ff00ff00ULL, 0xff00ff00ff00ff00ULL, }, /* 16 */
+ { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },
+ { 0xff803fe00ff803feULL, 0x00ff803fe00ff803ULL, },
+ { 0x007fc01ff007fc01ULL, 0xff007fc01ff007fcULL, },
+ { 0xffc00ffc00ffc00fULL, 0xfc00ffc00ffc00ffULL, },
+ { 0x003ff003ff003ff0ULL, 0x03ff003ff003ff00ULL, },
+ { 0xffe003ff800ffe00ULL, 0x3ff800ffe003ff80ULL, },
+ { 0x001ffc007ff001ffULL, 0xc007ff001ffc007fULL, },
+ { 0xfff000fff000fff0ULL, 0x00fff000fff000ffULL, }, /* 24 */
+ { 0x000fff000fff000fULL, 0xff000fff000fff00ULL, },
+ { 0xfff8003ffe000fffULL, 0x8003ffe000fff800ULL, },
+ { 0x0007ffc001fff000ULL, 0x7ffc001fff0007ffULL, },
+ { 0xfffc000fffc000ffULL, 0xfc000fffc000fffcULL, },
+ { 0x0003fff0003fff00ULL, 0x03fff0003fff0003ULL, },
+ { 0xfffe0003fff8000fULL, 0xffe0003fff8000ffULL, },
+ { 0x0001fffc0007fff0ULL, 0x001fffc0007fff00ULL, },
+ { 0xffff0000ffff0000ULL, 0xffff0000ffff0000ULL, }, /* 32 */
+ { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, },
+ { 0xffff80003fffe000ULL, 0x0ffff80003fffe00ULL, },
+ { 0x00007fffc0001fffULL, 0xf00007fffc0001ffULL, },
+ { 0xffffc0000ffffc00ULL, 0x00ffffc0000ffffcULL, },
+ { 0x00003ffff00003ffULL, 0xff00003ffff00003ULL, },
+ { 0xffffe00003ffff80ULL, 0x000ffffe00003fffULL, },
+ { 0x00001ffffc00007fULL, 0xfff00001ffffc000ULL, },
+ { 0xfffff00000fffff0ULL, 0x0000fffff00000ffULL, }, /* 40 */
+ { 0x00000fffff00000fULL, 0xffff00000fffff00ULL, },
+ { 0xfffff800003ffffeULL, 0x00000fffff800003ULL, },
+ { 0x000007ffffc00001ULL, 0xfffff000007ffffcULL, },
+ { 0xfffffc00000fffffULL, 0xc00000fffffc0000ULL, },
+ { 0x000003fffff00000ULL, 0x3fffff000003ffffULL, },
+ { 0xfffffe000003ffffULL, 0xf800000fffffe000ULL, },
+ { 0x000001fffffc0000ULL, 0x07fffff000001fffULL, },
+ { 0xffffff000000ffffULL, 0xff000000ffffff00ULL, }, /* 48 */
+ { 0x000000ffffff0000ULL, 0x00ffffff000000ffULL, },
+ { 0xffffff8000003fffULL, 0xffe000000ffffff8ULL, },
+ { 0x0000007fffffc000ULL, 0x001ffffff0000007ULL, },
+ { 0xffffffc000000fffULL, 0xfffc000000ffffffULL, },
+ { 0x0000003ffffff000ULL, 0x0003ffffff000000ULL, },
+ { 0xffffffe0000003ffULL, 0xffff8000000fffffULL, },
+ { 0x0000001ffffffc00ULL, 0x00007ffffff00000ULL, },
+ { 0xfffffff0000000ffULL, 0xfffff0000000ffffULL, }, /* 56 */
+ { 0x0000000fffffff00ULL, 0x00000fffffff0000ULL, },
+ { 0xfffffff80000003fULL, 0xfffffe0000000fffULL, },
+ { 0x00000007ffffffc0ULL, 0x000001fffffff000ULL, },
+ { 0xfffffffc0000000fULL, 0xffffffc0000000ffULL, },
+ { 0x00000003fffffff0ULL, 0x0000003fffffff00ULL, },
+ { 0xfffffffe00000003ULL, 0xfffffff80000000fULL, },
+ { 0x00000001fffffffcULL, 0x00000007fffffff0ULL, },
+ { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+ { 0xb9926b7c7daf4258ULL, 0xa1227caddcce65b6ULL, },
+ { 0xd027be89ff0a2ef9ULL, 0x170b5050fea53078ULL, },
+ { 0xb83b580665cabc4aULL, 0x91230822bff0ba62ULL, },
+ { 0xfc8f23f09aa6b782ULL, 0x93fd6637124275aeULL, },
+ { 0x201e09cd56aee649ULL, 0xef5de039a6a52758ULL, }, /* 72 */
+ { 0xa57cd91365d9e5d7ULL, 0x9321bc9881ecba5cULL, },
+ { 0xa2e8f6f5c9cbc61bULL, 0xb2c471545e0d7a12ULL, },
+ { 0xa89cf2f131a864aeULL, 0xd2a3e87a5db986e7ULL, },
+ { 0xe61438e9a652ea0aULL, 0xa85483d97879d41cULL, },
+ { 0x944a35fd192361a8ULL, 0xf3912da36a0b2d6bULL, },
+ { 0x4630426322bef79cULL, 0xeb5686f7cb19304eULL, },
+ { 0x8b5aa7a2f259deadULL, 0xd278cbcd696417e3ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+ if (i < PATTERN_INPUTS_COUNT) {
+ do_msa_MOVE_V(b128_pattern[i], b128_result[i]);
+ } else {
+ do_msa_MOVE_V(b128_random[i - PATTERN_INPUTS_COUNT],
+ b128_result[i]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c
new file mode 100644
index 0000000000..2f4ffd9195
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKEV.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKEV.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0xe3388ee38ee3388eULL, 0xffffffffffffffffULL, },
+ { 0x1cc7711c711cc771ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0xe3388ee38ee3388eULL, 0x0000000000000000ULL, },
+ { 0x1cc7711c711cc771ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe3388ee38ee3388eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1cc7711c711cc771ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0xe3388ee38ee3388eULL, 0x5555555555555555ULL, },
+ { 0x1cc7711c711cc771ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0xe3388ee38ee3388eULL, 0xccccccccccccccccULL, },
+ { 0x1cc7711c711cc771ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe3388ee38ee3388eULL, 0x3333333333333333ULL, },
+ { 0x1cc7711c711cc771ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0xe3388ee38ee3388eULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0xe3388ee38ee3388eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xe3388ee38ee3388eULL, },
+ { 0x5555555555555555ULL, 0xe3388ee38ee3388eULL, },
+ { 0xccccccccccccccccULL, 0xe3388ee38ee3388eULL, },
+ { 0x3333333333333333ULL, 0xe3388ee38ee3388eULL, },
+ { 0xe3388ee38ee3388eULL, 0xe3388ee38ee3388eULL, },
+ { 0x1cc7711c711cc771ULL, 0xe3388ee38ee3388eULL, },
+ { 0xffffffffffffffffULL, 0x1cc7711c711cc771ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x1cc7711c711cc771ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x1cc7711c711cc771ULL, },
+ { 0x5555555555555555ULL, 0x1cc7711c711cc771ULL, },
+ { 0xccccccccccccccccULL, 0x1cc7711c711cc771ULL, },
+ { 0x3333333333333333ULL, 0x1cc7711c711cc771ULL, },
+ { 0xe3388ee38ee3388eULL, 0x1cc7711c711cc771ULL, },
+ { 0x1cc7711c711cc771ULL, 0x1cc7711c711cc771ULL, },
+ { 0x675e7b0c6acc6240ULL, 0x675e7b0c6acc6240ULL, }, /* 64 */
+ { 0xf71a3ffcbe639308ULL, 0x675e7b0c6acc6240ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0x675e7b0c6acc6240ULL, },
+ { 0xf1d842a04f4d314eULL, 0x675e7b0c6acc6240ULL, },
+ { 0x675e7b0c6acc6240ULL, 0xf71a3ffcbe639308ULL, },
+ { 0xf71a3ffcbe639308ULL, 0xf71a3ffcbe639308ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0xf71a3ffcbe639308ULL, },
+ { 0xf1d842a04f4d314eULL, 0xf71a3ffcbe639308ULL, },
+ { 0x675e7b0c6acc6240ULL, 0xd8ff2b145aaacf80ULL, }, /* 72 */
+ { 0xf71a3ffcbe639308ULL, 0xd8ff2b145aaacf80ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0xd8ff2b145aaacf80ULL, },
+ { 0xf1d842a04f4d314eULL, 0xd8ff2b145aaacf80ULL, },
+ { 0x675e7b0c6acc6240ULL, 0xf1d842a04f4d314eULL, },
+ { 0xf71a3ffcbe639308ULL, 0xf1d842a04f4d314eULL, },
+ { 0xd8ff2b145aaacf80ULL, 0xf1d842a04f4d314eULL, },
+ { 0xf1d842a04f4d314eULL, 0xf1d842a04f4d314eULL, },
+ { 0x675e7b0c6acc6240ULL, 0xd8a04d4ed8a04d4eULL, }, /* 80 */
+ { 0xf71a3ffcbe639308ULL, 0xa04ea04e5e0ccc40ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0x4e4e0c401afc6308ULL, },
+ { 0xf1d842a04f4d314eULL, 0x4e40fc08ff14aa80ULL, },
+ { 0x675e7b0c6acc6240ULL, 0x40081480d8a04d4eULL, },
+ { 0xf71a3ffcbe639308ULL, 0x0880a04e5e0ccc40ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0x804e0c401afc6308ULL, },
+ { 0xf1d842a04f4d314eULL, 0x4e40fc08ff14aa80ULL, },
+ { 0x675e7b0c6acc6240ULL, 0x40081480d8a04d4eULL, }, /* 88 */
+ { 0xf71a3ffcbe639308ULL, 0x0880a04e5e0ccc40ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0x804e0c401afc6308ULL, },
+ { 0xf1d842a04f4d314eULL, 0x4e40fc08ff14aa80ULL, },
+ { 0x675e7b0c6acc6240ULL, 0x40081480d8a04d4eULL, },
+ { 0xf71a3ffcbe639308ULL, 0x0880a04e5e0ccc40ULL, },
+ { 0xd8ff2b145aaacf80ULL, 0x804e0c401afc6308ULL, },
+ { 0xf1d842a04f4d314eULL, 0x4e40fc08ff14aa80ULL, },
+ { 0x40081480d8a04d4eULL, 0x675e7b0c6acc6240ULL, }, /* 96 */
+ { 0x5e0ccc400880a04eULL, 0x675e7b0c6acc6240ULL, },
+ { 0x5e0ccc400c40804eULL, 0x675e7b0c6acc6240ULL, },
+ { 0x5e0ccc400c40404eULL, 0x675e7b0c6acc6240ULL, },
+ { 0x5e0ccc400c40404eULL, 0xf71a3ffcbe639308ULL, },
+ { 0x1afc63080c40404eULL, 0xf71a3ffcbe639308ULL, },
+ { 0x1afc6308fc08404eULL, 0xf71a3ffcbe639308ULL, },
+ { 0x1afc6308fc08084eULL, 0xf71a3ffcbe639308ULL, },
+ { 0x1afc6308fc08084eULL, 0xd8ff2b145aaacf80ULL, }, /* 104 */
+ { 0xff14aa80fc08084eULL, 0xd8ff2b145aaacf80ULL, },
+ { 0xff14aa801480084eULL, 0xd8ff2b145aaacf80ULL, },
+ { 0xff14aa801480804eULL, 0xd8ff2b145aaacf80ULL, },
+ { 0xff14aa801480804eULL, 0xf1d842a04f4d314eULL, },
+ { 0xd8a04d4e1480804eULL, 0xf1d842a04f4d314eULL, },
+ { 0xd8a04d4ea04e804eULL, 0xf1d842a04f4d314eULL, },
+ { 0xd8a04d4ea04e4e4eULL, 0xf1d842a04f4d314eULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c
new file mode 100644
index 0000000000..3f0bd47ffd
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKEV.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKEV.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e38e38e38eULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0xe38e38e38e38e38eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555555ULL, 0xe38e38e38e38e38eULL, },
+ { 0xccccccccccccccccULL, 0xe38e38e38e38e38eULL, },
+ { 0x3333333333333333ULL, 0xe38e38e38e38e38eULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x1c71c71c71c71c71ULL, 0xe38e38e38e38e38eULL, },
+ { 0xffffffffffffffffULL, 0x1c71c71c71c71c71ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x1c71c71c71c71c71ULL, },
+ { 0x5555555555555555ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xccccccccccccccccULL, 0x1c71c71c71c71c71ULL, },
+ { 0x3333333333333333ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe38e38e38e38e38eULL, 0x1c71c71c71c71c71ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c71ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 64 */
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x886ae6cc28625540ULL, },
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, },
+ { 0x886ae6cc28625540ULL, 0xfbbe00634d93c708ULL, },
+ { 0xfbbe00634d93c708ULL, 0xfbbe00634d93c708ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x886ae6cc28625540ULL, 0xac5aaeaab9cf8b80ULL, }, /* 72 */
+ { 0xfbbe00634d93c708ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, },
+ { 0xfbbe00634d93c708ULL, 0x704f164d5e31e24eULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x704f164d5e31e24eULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, }, /* 80 */
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, },
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, }, /* 88 */
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x886ae6cc28625540ULL, 0x704f164d5e31e24eULL, },
+ { 0xfbbe00634d93c708ULL, 0x886ae6cc28625540ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, }, /* 96 */
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, },
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, },
+ { 0x704f164d5e31e24eULL, 0x886ae6cc28625540ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xfbbe00634d93c708ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, }, /* 104 */
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ { 0x704f164d5e31e24eULL, 0x704f164d5e31e24eULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c
new file mode 100644
index 0000000000..2eae01fa75
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKEV.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKEV.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x8e3838e338e3e38eULL, 0xffffffffffffffffULL, },
+ { 0x71c7c71cc71c1c71ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x8e3838e338e3e38eULL, 0x0000000000000000ULL, },
+ { 0x71c7c71cc71c1c71ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x8e3838e338e3e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x71c7c71cc71c1c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x8e3838e338e3e38eULL, 0x5555555555555555ULL, },
+ { 0x71c7c71cc71c1c71ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x8e3838e338e3e38eULL, 0xccccccccccccccccULL, },
+ { 0x71c7c71cc71c1c71ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x8e3838e338e3e38eULL, 0x3333333333333333ULL, },
+ { 0x71c7c71cc71c1c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x8e3838e338e3e38eULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x8e3838e338e3e38eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x8e3838e338e3e38eULL, },
+ { 0x5555555555555555ULL, 0x8e3838e338e3e38eULL, },
+ { 0xccccccccccccccccULL, 0x8e3838e338e3e38eULL, },
+ { 0x3333333333333333ULL, 0x8e3838e338e3e38eULL, },
+ { 0x8e3838e338e3e38eULL, 0x8e3838e338e3e38eULL, },
+ { 0x71c7c71cc71c1c71ULL, 0x8e3838e338e3e38eULL, },
+ { 0xffffffffffffffffULL, 0x71c7c71cc71c1c71ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x71c7c71cc71c1c71ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x71c7c71cc71c1c71ULL, },
+ { 0x5555555555555555ULL, 0x71c7c71cc71c1c71ULL, },
+ { 0xccccccccccccccccULL, 0x71c7c71cc71c1c71ULL, },
+ { 0x3333333333333333ULL, 0x71c7c71cc71c1c71ULL, },
+ { 0x8e3838e338e3e38eULL, 0x71c7c71cc71c1c71ULL, },
+ { 0x71c7c71cc71c1c71ULL, 0x71c7c71cc71c1c71ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0x0b5eb00ce6cc5540ULL, }, /* 64 */
+ { 0xbb1a52fc0063c708ULL, 0x0b5eb00ce6cc5540ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0x0b5eb00ce6cc5540ULL, },
+ { 0x88d8e2a0164de24eULL, 0x0b5eb00ce6cc5540ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0xbb1a52fc0063c708ULL, },
+ { 0xbb1a52fc0063c708ULL, 0xbb1a52fc0063c708ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0xbb1a52fc0063c708ULL, },
+ { 0x88d8e2a0164de24eULL, 0xbb1a52fc0063c708ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0xc6ff2514aeaa8b80ULL, }, /* 72 */
+ { 0xbb1a52fc0063c708ULL, 0xc6ff2514aeaa8b80ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0xc6ff2514aeaa8b80ULL, },
+ { 0x88d8e2a0164de24eULL, 0xc6ff2514aeaa8b80ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0x88d8e2a0164de24eULL, },
+ { 0xbb1a52fc0063c708ULL, 0x88d8e2a0164de24eULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0x88d8e2a0164de24eULL, },
+ { 0x88d8e2a0164de24eULL, 0x88d8e2a0164de24eULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0xe2a0e24ee2a0e24eULL, }, /* 80 */
+ { 0xbb1a52fc0063c708ULL, 0xe24ee24eb00c5540ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0xe24e554052fcc708ULL, },
+ { 0x88d8e2a0164de24eULL, 0x5540c70825148b80ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0xc7088b80e2a0e24eULL, },
+ { 0xbb1a52fc0063c708ULL, 0x8b80e24eb00c5540ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0xe24e554052fcc708ULL, },
+ { 0x88d8e2a0164de24eULL, 0x5540c70825148b80ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0xc7088b80e2a0e24eULL, }, /* 88 */
+ { 0xbb1a52fc0063c708ULL, 0x8b80e24eb00c5540ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0xe24e554052fcc708ULL, },
+ { 0x88d8e2a0164de24eULL, 0x5540c70825148b80ULL, },
+ { 0x0b5eb00ce6cc5540ULL, 0xc7088b80e2a0e24eULL, },
+ { 0xbb1a52fc0063c708ULL, 0x8b80e24eb00c5540ULL, },
+ { 0xc6ff2514aeaa8b80ULL, 0xe24e554052fcc708ULL, },
+ { 0x88d8e2a0164de24eULL, 0x5540c70825148b80ULL, },
+ { 0xc7088b80e2a0e24eULL, 0x0b5eb00ce6cc5540ULL, }, /* 96 */
+ { 0xb00c55408b80e24eULL, 0x0b5eb00ce6cc5540ULL, },
+ { 0xb00c55405540e24eULL, 0x0b5eb00ce6cc5540ULL, },
+ { 0xb00c55405540e24eULL, 0x0b5eb00ce6cc5540ULL, },
+ { 0xb00c55405540e24eULL, 0xbb1a52fc0063c708ULL, },
+ { 0x52fcc7085540e24eULL, 0xbb1a52fc0063c708ULL, },
+ { 0x52fcc708c708e24eULL, 0xbb1a52fc0063c708ULL, },
+ { 0x52fcc708c708e24eULL, 0xbb1a52fc0063c708ULL, },
+ { 0x52fcc708c708e24eULL, 0xc6ff2514aeaa8b80ULL, }, /* 104 */
+ { 0x25148b80c708e24eULL, 0xc6ff2514aeaa8b80ULL, },
+ { 0x25148b808b80e24eULL, 0xc6ff2514aeaa8b80ULL, },
+ { 0x25148b808b80e24eULL, 0xc6ff2514aeaa8b80ULL, },
+ { 0x25148b808b80e24eULL, 0x88d8e2a0164de24eULL, },
+ { 0xe2a0e24e8b80e24eULL, 0x88d8e2a0164de24eULL, },
+ { 0xe2a0e24ee24ee24eULL, 0x88d8e2a0164de24eULL, },
+ { 0xe2a0e24ee24ee24eULL, 0x88d8e2a0164de24eULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c
new file mode 100644
index 0000000000..f7215d0e43
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckev_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKEV.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKEV.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0xe38e38e38e38e38eULL, 0xffffffffffffffffULL, },
+ { 0x1c71c71c71c71c71ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0x0000000000000000ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xe38e38e38e38e38eULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x1c71c71c71c71c71ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0xe38e38e38e38e38eULL, 0x5555555555555555ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0xe38e38e38e38e38eULL, 0xccccccccccccccccULL, },
+ { 0x1c71c71c71c71c71ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xe38e38e38e38e38eULL, 0x3333333333333333ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0xe38e38e38e38e38eULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0xe38e38e38e38e38eULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xe38e38e38e38e38eULL, },
+ { 0x5555555555555555ULL, 0xe38e38e38e38e38eULL, },
+ { 0xccccccccccccccccULL, 0xe38e38e38e38e38eULL, },
+ { 0x3333333333333333ULL, 0xe38e38e38e38e38eULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x1c71c71c71c71c71ULL, 0xe38e38e38e38e38eULL, },
+ { 0xffffffffffffffffULL, 0x1c71c71c71c71c71ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x1c71c71c71c71c71ULL, },
+ { 0x5555555555555555ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xccccccccccccccccULL, 0x1c71c71c71c71c71ULL, },
+ { 0x3333333333333333ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xe38e38e38e38e38eULL, 0x1c71c71c71c71c71ULL, },
+ { 0x1c71c71c71c71c71ULL, 0x1c71c71c71c71c71ULL, },
+ { 0xfe7bb00c28625540ULL, 0xfe7bb00c28625540ULL, }, /* 64 */
+ { 0x153f52fc4d93c708ULL, 0xfe7bb00c28625540ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0xfe7bb00c28625540ULL, },
+ { 0xa942e2a05e31e24eULL, 0xfe7bb00c28625540ULL, },
+ { 0xfe7bb00c28625540ULL, 0x153f52fc4d93c708ULL, },
+ { 0x153f52fc4d93c708ULL, 0x153f52fc4d93c708ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0x153f52fc4d93c708ULL, },
+ { 0xa942e2a05e31e24eULL, 0x153f52fc4d93c708ULL, },
+ { 0xfe7bb00c28625540ULL, 0xab2b2514b9cf8b80ULL, }, /* 72 */
+ { 0x153f52fc4d93c708ULL, 0xab2b2514b9cf8b80ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0xab2b2514b9cf8b80ULL, },
+ { 0xa942e2a05e31e24eULL, 0xab2b2514b9cf8b80ULL, },
+ { 0xfe7bb00c28625540ULL, 0xa942e2a05e31e24eULL, },
+ { 0x153f52fc4d93c708ULL, 0xa942e2a05e31e24eULL, },
+ { 0xab2b2514b9cf8b80ULL, 0xa942e2a05e31e24eULL, },
+ { 0xa942e2a05e31e24eULL, 0xa942e2a05e31e24eULL, },
+ { 0xfe7bb00c28625540ULL, 0x5e31e24e5e31e24eULL, }, /* 80 */
+ { 0x153f52fc4d93c708ULL, 0x5e31e24e28625540ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0x286255404d93c708ULL, },
+ { 0xa942e2a05e31e24eULL, 0x4d93c708b9cf8b80ULL, },
+ { 0xfe7bb00c28625540ULL, 0xb9cf8b805e31e24eULL, },
+ { 0x153f52fc4d93c708ULL, 0x5e31e24e28625540ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0x286255404d93c708ULL, },
+ { 0xa942e2a05e31e24eULL, 0x4d93c708b9cf8b80ULL, },
+ { 0xfe7bb00c28625540ULL, 0xb9cf8b805e31e24eULL, }, /* 88 */
+ { 0x153f52fc4d93c708ULL, 0x5e31e24e28625540ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0x286255404d93c708ULL, },
+ { 0xa942e2a05e31e24eULL, 0x4d93c708b9cf8b80ULL, },
+ { 0xfe7bb00c28625540ULL, 0xb9cf8b805e31e24eULL, },
+ { 0x153f52fc4d93c708ULL, 0x5e31e24e28625540ULL, },
+ { 0xab2b2514b9cf8b80ULL, 0x286255404d93c708ULL, },
+ { 0xa942e2a05e31e24eULL, 0x4d93c708b9cf8b80ULL, },
+ { 0xb9cf8b805e31e24eULL, 0xfe7bb00c28625540ULL, }, /* 96 */
+ { 0x286255405e31e24eULL, 0xfe7bb00c28625540ULL, },
+ { 0x286255405e31e24eULL, 0xfe7bb00c28625540ULL, },
+ { 0x286255405e31e24eULL, 0xfe7bb00c28625540ULL, },
+ { 0x286255405e31e24eULL, 0x153f52fc4d93c708ULL, },
+ { 0x4d93c7085e31e24eULL, 0x153f52fc4d93c708ULL, },
+ { 0x4d93c7085e31e24eULL, 0x153f52fc4d93c708ULL, },
+ { 0x4d93c7085e31e24eULL, 0x153f52fc4d93c708ULL, },
+ { 0x4d93c7085e31e24eULL, 0xab2b2514b9cf8b80ULL, }, /* 104 */
+ { 0xb9cf8b805e31e24eULL, 0xab2b2514b9cf8b80ULL, },
+ { 0xb9cf8b805e31e24eULL, 0xab2b2514b9cf8b80ULL, },
+ { 0xb9cf8b805e31e24eULL, 0xab2b2514b9cf8b80ULL, },
+ { 0xb9cf8b805e31e24eULL, 0xa942e2a05e31e24eULL, },
+ { 0x5e31e24e5e31e24eULL, 0xa942e2a05e31e24eULL, },
+ { 0x5e31e24e5e31e24eULL, 0xa942e2a05e31e24eULL, },
+ { 0x5e31e24e5e31e24eULL, 0xa942e2a05e31e24eULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKEV_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c
new file mode 100644
index 0000000000..6355338332
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKOD.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKOD.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x388ee338e3388ee3ULL, 0xffffffffffffffffULL, },
+ { 0xc7711cc71cc7711cULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x388ee338e3388ee3ULL, 0x0000000000000000ULL, },
+ { 0xc7711cc71cc7711cULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x388ee338e3388ee3ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xc7711cc71cc7711cULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x388ee338e3388ee3ULL, 0x5555555555555555ULL, },
+ { 0xc7711cc71cc7711cULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x388ee338e3388ee3ULL, 0xccccccccccccccccULL, },
+ { 0xc7711cc71cc7711cULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x388ee338e3388ee3ULL, 0x3333333333333333ULL, },
+ { 0xc7711cc71cc7711cULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x388ee338e3388ee3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x388ee338e3388ee3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x388ee338e3388ee3ULL, },
+ { 0x5555555555555555ULL, 0x388ee338e3388ee3ULL, },
+ { 0xccccccccccccccccULL, 0x388ee338e3388ee3ULL, },
+ { 0x3333333333333333ULL, 0x388ee338e3388ee3ULL, },
+ { 0x388ee338e3388ee3ULL, 0x388ee338e3388ee3ULL, },
+ { 0xc7711cc71cc7711cULL, 0x388ee338e3388ee3ULL, },
+ { 0xffffffffffffffffULL, 0xc7711cc71cc7711cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc7711cc71cc7711cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc7711cc71cc7711cULL, },
+ { 0x5555555555555555ULL, 0xc7711cc71cc7711cULL, },
+ { 0xccccccccccccccccULL, 0xc7711cc71cc7711cULL, },
+ { 0x3333333333333333ULL, 0xc7711cc71cc7711cULL, },
+ { 0x388ee338e3388ee3ULL, 0xc7711cc71cc7711cULL, },
+ { 0xc7711cc71cc7711cULL, 0xc7711cc71cc7711cULL, },
+ { 0x4b0bfeb088e62855ULL, 0x4b0bfeb088e62855ULL, }, /* 64 */
+ { 0x12bb1552fb004dc7ULL, 0x4b0bfeb088e62855ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x4b0bfeb088e62855ULL, },
+ { 0x8d88a9e270165ee2ULL, 0x4b0bfeb088e62855ULL, },
+ { 0x4b0bfeb088e62855ULL, 0x12bb1552fb004dc7ULL, },
+ { 0x12bb1552fb004dc7ULL, 0x12bb1552fb004dc7ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x12bb1552fb004dc7ULL, },
+ { 0x8d88a9e270165ee2ULL, 0x12bb1552fb004dc7ULL, },
+ { 0x4b0bfeb088e62855ULL, 0x27c6ab25acaeb98bULL, }, /* 72 */
+ { 0x12bb1552fb004dc7ULL, 0x27c6ab25acaeb98bULL, },
+ { 0x27c6ab25acaeb98bULL, 0x27c6ab25acaeb98bULL, },
+ { 0x8d88a9e270165ee2ULL, 0x27c6ab25acaeb98bULL, },
+ { 0x4b0bfeb088e62855ULL, 0x8d88a9e270165ee2ULL, },
+ { 0x12bb1552fb004dc7ULL, 0x8d88a9e270165ee2ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x8d88a9e270165ee2ULL, },
+ { 0x8d88a9e270165ee2ULL, 0x8d88a9e270165ee2ULL, },
+ { 0x4b0bfeb088e62855ULL, 0x8da9705e8da9705eULL, }, /* 80 */
+ { 0x12bb1552fb004dc7ULL, 0x8d708d704bfe8828ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x8d8d4b881215fb4dULL, },
+ { 0x8d88a9e270165ee2ULL, 0x8d4b12fb27abacb9ULL, },
+ { 0x4b0bfeb088e62855ULL, 0x8d1227ac8da9705eULL, },
+ { 0x12bb1552fb004dc7ULL, 0x8d278d704bfe8828ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x8d8d4b881215fb4dULL, },
+ { 0x8d88a9e270165ee2ULL, 0x8d4b12fb27abacb9ULL, },
+ { 0x4b0bfeb088e62855ULL, 0x8d1227ac8da9705eULL, }, /* 88 */
+ { 0x12bb1552fb004dc7ULL, 0x8d278d704bfe8828ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x8d8d4b881215fb4dULL, },
+ { 0x8d88a9e270165ee2ULL, 0x8d4b12fb27abacb9ULL, },
+ { 0x4b0bfeb088e62855ULL, 0x8d1227ac8da9705eULL, },
+ { 0x12bb1552fb004dc7ULL, 0x8d278d704bfe8828ULL, },
+ { 0x27c6ab25acaeb98bULL, 0x8d8d4b881215fb4dULL, },
+ { 0x8d88a9e270165ee2ULL, 0x8d4b12fb27abacb9ULL, },
+ { 0x8d1227ac8da9705eULL, 0x4b0bfeb088e62855ULL, }, /* 96 */
+ { 0x4bfe88288d278d70ULL, 0x4b0bfeb088e62855ULL, },
+ { 0x4bfe88284b888d8dULL, 0x4b0bfeb088e62855ULL, },
+ { 0x4bfe88284b884b8dULL, 0x4b0bfeb088e62855ULL, },
+ { 0x4bfe88284b884b4bULL, 0x12bb1552fb004dc7ULL, },
+ { 0x1215fb4d4b884b4bULL, 0x12bb1552fb004dc7ULL, },
+ { 0x1215fb4d12fb4b4bULL, 0x12bb1552fb004dc7ULL, },
+ { 0x1215fb4d12fb124bULL, 0x12bb1552fb004dc7ULL, },
+ { 0x1215fb4d12fb1212ULL, 0x27c6ab25acaeb98bULL, }, /* 104 */
+ { 0x27abacb912fb1212ULL, 0x27c6ab25acaeb98bULL, },
+ { 0x27abacb927ac1212ULL, 0x27c6ab25acaeb98bULL, },
+ { 0x27abacb927ac2712ULL, 0x27c6ab25acaeb98bULL, },
+ { 0x27abacb927ac2727ULL, 0x8d88a9e270165ee2ULL, },
+ { 0x8da9705e27ac2727ULL, 0x8d88a9e270165ee2ULL, },
+ { 0x8da9705e8d702727ULL, 0x8d88a9e270165ee2ULL, },
+ { 0x8da9705e8d708d27ULL, 0x8d88a9e270165ee2ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c
new file mode 100644
index 0000000000..ac75526fda
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKOD.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKOD.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e3ULL, 0xffffffffffffffffULL, },
+ { 0xc71c71c71c71c71cULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x38e38e38e38e38e3ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xc71c71c71c71c71cULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x5555555555555555ULL, },
+ { 0xc71c71c71c71c71cULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x38e38e38e38e38e3ULL, 0xccccccccccccccccULL, },
+ { 0xc71c71c71c71c71cULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x3333333333333333ULL, },
+ { 0xc71c71c71c71c71cULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xc71c71c71c71c71cULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71cULL, 0xc71c71c71c71c71cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x4b670b5efe7bb00cULL, }, /* 64 */
+ { 0x12f7bb1a153f52fcULL, 0x4b670b5efe7bb00cULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x8df188d8a942e2a0ULL, 0x4b670b5efe7bb00cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x12f7bb1a153f52fcULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x8df188d8a942e2a0ULL, 0x12f7bb1a153f52fcULL, },
+ { 0x4b670b5efe7bb00cULL, 0x27d8c6ffab2b2514ULL, }, /* 72 */
+ { 0x12f7bb1a153f52fcULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, },
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, }, /* 80 */
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, },
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, }, /* 88 */
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x4b670b5efe7bb00cULL, 0x8df188d8a942e2a0ULL, },
+ { 0x12f7bb1a153f52fcULL, 0x8df188d8a942e2a0ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x4b670b5efe7bb00cULL, }, /* 96 */
+ { 0x4b670b5efe7bb00cULL, 0x4b670b5efe7bb00cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x4b670b5efe7bb00cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x4b670b5efe7bb00cULL, },
+ { 0x4b670b5efe7bb00cULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x12f7bb1a153f52fcULL, },
+ { 0x12f7bb1a153f52fcULL, 0x27d8c6ffab2b2514ULL, }, /* 104 */
+ { 0x27d8c6ffab2b2514ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x27d8c6ffab2b2514ULL, },
+ { 0x27d8c6ffab2b2514ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ { 0x8df188d8a942e2a0ULL, 0x8df188d8a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c
new file mode 100644
index 0000000000..12c1fa1ea5
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKOD.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKOD.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x38e3e38ee38e8e38ULL, 0xffffffffffffffffULL, },
+ { 0xc71c1c711c7171c7ULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x38e3e38ee38e8e38ULL, 0x0000000000000000ULL, },
+ { 0xc71c1c711c7171c7ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x38e3e38ee38e8e38ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xc71c1c711c7171c7ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x38e3e38ee38e8e38ULL, 0x5555555555555555ULL, },
+ { 0xc71c1c711c7171c7ULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x38e3e38ee38e8e38ULL, 0xccccccccccccccccULL, },
+ { 0xc71c1c711c7171c7ULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x38e3e38ee38e8e38ULL, 0x3333333333333333ULL, },
+ { 0xc71c1c711c7171c7ULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e3e38ee38e8e38ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e3e38ee38e8e38ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e3e38ee38e8e38ULL, },
+ { 0x5555555555555555ULL, 0x38e3e38ee38e8e38ULL, },
+ { 0xccccccccccccccccULL, 0x38e3e38ee38e8e38ULL, },
+ { 0x3333333333333333ULL, 0x38e3e38ee38e8e38ULL, },
+ { 0x38e3e38ee38e8e38ULL, 0x38e3e38ee38e8e38ULL, },
+ { 0xc71c1c711c7171c7ULL, 0x38e3e38ee38e8e38ULL, },
+ { 0xffffffffffffffffULL, 0xc71c1c711c7171c7ULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c1c711c7171c7ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c1c711c7171c7ULL, },
+ { 0x5555555555555555ULL, 0xc71c1c711c7171c7ULL, },
+ { 0xccccccccccccccccULL, 0xc71c1c711c7171c7ULL, },
+ { 0x3333333333333333ULL, 0xc71c1c711c7171c7ULL, },
+ { 0x38e3e38ee38e8e38ULL, 0xc71c1c711c7171c7ULL, },
+ { 0xc71c1c711c7171c7ULL, 0xc71c1c711c7171c7ULL, },
+ { 0x4b67fe7b886a2862ULL, 0x4b67fe7b886a2862ULL, }, /* 64 */
+ { 0x12f7153ffbbe4d93ULL, 0x4b67fe7b886a2862ULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x4b67fe7b886a2862ULL, },
+ { 0x8df1a942704f5e31ULL, 0x4b67fe7b886a2862ULL, },
+ { 0x4b67fe7b886a2862ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x12f7153ffbbe4d93ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x8df1a942704f5e31ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x4b67fe7b886a2862ULL, 0x27d8ab2bac5ab9cfULL, }, /* 72 */
+ { 0x12f7153ffbbe4d93ULL, 0x27d8ab2bac5ab9cfULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x27d8ab2bac5ab9cfULL, },
+ { 0x8df1a942704f5e31ULL, 0x27d8ab2bac5ab9cfULL, },
+ { 0x4b67fe7b886a2862ULL, 0x8df1a942704f5e31ULL, },
+ { 0x12f7153ffbbe4d93ULL, 0x8df1a942704f5e31ULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x8df1a942704f5e31ULL, },
+ { 0x8df1a942704f5e31ULL, 0x8df1a942704f5e31ULL, },
+ { 0x4b67fe7b886a2862ULL, 0x8df1704f8df1704fULL, }, /* 80 */
+ { 0x12f7153ffbbe4d93ULL, 0x8df18df14b67886aULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x8df14b6712f7fbbeULL, },
+ { 0x8df1a942704f5e31ULL, 0x8df112f727d8ac5aULL, },
+ { 0x4b67fe7b886a2862ULL, 0x8df127d88df1704fULL, },
+ { 0x12f7153ffbbe4d93ULL, 0x8df18df14b67886aULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x8df14b6712f7fbbeULL, },
+ { 0x8df1a942704f5e31ULL, 0x8df112f727d8ac5aULL, },
+ { 0x4b67fe7b886a2862ULL, 0x8df127d88df1704fULL, }, /* 88 */
+ { 0x12f7153ffbbe4d93ULL, 0x8df18df14b67886aULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x8df14b6712f7fbbeULL, },
+ { 0x8df1a942704f5e31ULL, 0x8df112f727d8ac5aULL, },
+ { 0x4b67fe7b886a2862ULL, 0x8df127d88df1704fULL, },
+ { 0x12f7153ffbbe4d93ULL, 0x8df18df14b67886aULL, },
+ { 0x27d8ab2bac5ab9cfULL, 0x8df14b6712f7fbbeULL, },
+ { 0x8df1a942704f5e31ULL, 0x8df112f727d8ac5aULL, },
+ { 0x8df127d88df1704fULL, 0x4b67fe7b886a2862ULL, }, /* 96 */
+ { 0x4b67886a8df18df1ULL, 0x4b67fe7b886a2862ULL, },
+ { 0x4b67886a4b678df1ULL, 0x4b67fe7b886a2862ULL, },
+ { 0x4b67886a4b674b67ULL, 0x4b67fe7b886a2862ULL, },
+ { 0x4b67886a4b674b67ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x12f7fbbe4b674b67ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x12f7fbbe12f74b67ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x12f7fbbe12f712f7ULL, 0x12f7153ffbbe4d93ULL, },
+ { 0x12f7fbbe12f712f7ULL, 0x27d8ab2bac5ab9cfULL, }, /* 104 */
+ { 0x27d8ac5a12f712f7ULL, 0x27d8ab2bac5ab9cfULL, },
+ { 0x27d8ac5a27d812f7ULL, 0x27d8ab2bac5ab9cfULL, },
+ { 0x27d8ac5a27d827d8ULL, 0x27d8ab2bac5ab9cfULL, },
+ { 0x27d8ac5a27d827d8ULL, 0x8df1a942704f5e31ULL, },
+ { 0x8df1704f27d827d8ULL, 0x8df1a942704f5e31ULL, },
+ { 0x8df1704f8df127d8ULL, 0x8df1a942704f5e31ULL, },
+ { 0x8df1704f8df18df1ULL, 0x8df1a942704f5e31ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c
new file mode 100644
index 0000000000..b8979c3f43
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_pckod_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction PCKOD.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "PCKOD.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xffffffffffffffffULL, },
+ { 0x5555555555555555ULL, 0xffffffffffffffffULL, },
+ { 0xccccccccccccccccULL, 0xffffffffffffffffULL, },
+ { 0x3333333333333333ULL, 0xffffffffffffffffULL, },
+ { 0x38e38e38e38e38e3ULL, 0xffffffffffffffffULL, },
+ { 0xc71c71c71c71c71cULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x0000000000000000ULL, },
+ { 0x5555555555555555ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0x0000000000000000ULL, },
+ { 0x3333333333333333ULL, 0x0000000000000000ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x0000000000000000ULL, },
+ { 0xc71c71c71c71c71cULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xaaaaaaaaaaaaaaaaULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x5555555555555555ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xccccccccccccccccULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x3333333333333333ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x38e38e38e38e38e3ULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xc71c71c71c71c71cULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffffffffULL, 0x5555555555555555ULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x5555555555555555ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x5555555555555555ULL, },
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0xccccccccccccccccULL, 0x5555555555555555ULL, },
+ { 0x3333333333333333ULL, 0x5555555555555555ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x5555555555555555ULL, },
+ { 0xc71c71c71c71c71cULL, 0x5555555555555555ULL, },
+ { 0xffffffffffffffffULL, 0xccccccccccccccccULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0xccccccccccccccccULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xccccccccccccccccULL, },
+ { 0x5555555555555555ULL, 0xccccccccccccccccULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0xccccccccccccccccULL, },
+ { 0x38e38e38e38e38e3ULL, 0xccccccccccccccccULL, },
+ { 0xc71c71c71c71c71cULL, 0xccccccccccccccccULL, },
+ { 0xffffffffffffffffULL, 0x3333333333333333ULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x3333333333333333ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x3333333333333333ULL, },
+ { 0x5555555555555555ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0x3333333333333333ULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x3333333333333333ULL, },
+ { 0xc71c71c71c71c71cULL, 0x3333333333333333ULL, },
+ { 0xffffffffffffffffULL, 0x38e38e38e38e38e3ULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0x38e38e38e38e38e3ULL, },
+ { 0x5555555555555555ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xccccccccccccccccULL, 0x38e38e38e38e38e3ULL, },
+ { 0x3333333333333333ULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38e38e38e38e3ULL, 0x38e38e38e38e38e3ULL, },
+ { 0xc71c71c71c71c71cULL, 0x38e38e38e38e38e3ULL, },
+ { 0xffffffffffffffffULL, 0xc71c71c71c71c71cULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0xc71c71c71c71c71cULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xc71c71c71c71c71cULL, },
+ { 0x5555555555555555ULL, 0xc71c71c71c71c71cULL, },
+ { 0xccccccccccccccccULL, 0xc71c71c71c71c71cULL, },
+ { 0x3333333333333333ULL, 0xc71c71c71c71c71cULL, },
+ { 0x38e38e38e38e38e3ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c71c71c71c71cULL, 0xc71c71c71c71c71cULL, },
+ { 0x4b670b5e886ae6ccULL, 0x4b670b5e886ae6ccULL, }, /* 64 */
+ { 0x12f7bb1afbbe0063ULL, 0x4b670b5e886ae6ccULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x4b670b5e886ae6ccULL, },
+ { 0x8df188d8704f164dULL, 0x4b670b5e886ae6ccULL, },
+ { 0x4b670b5e886ae6ccULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x12f7bb1afbbe0063ULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x8df188d8704f164dULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x4b670b5e886ae6ccULL, 0x27d8c6ffac5aaeaaULL, }, /* 72 */
+ { 0x12f7bb1afbbe0063ULL, 0x27d8c6ffac5aaeaaULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x27d8c6ffac5aaeaaULL, },
+ { 0x8df188d8704f164dULL, 0x27d8c6ffac5aaeaaULL, },
+ { 0x4b670b5e886ae6ccULL, 0x8df188d8704f164dULL, },
+ { 0x12f7bb1afbbe0063ULL, 0x8df188d8704f164dULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x8df188d8704f164dULL, },
+ { 0x8df188d8704f164dULL, 0x8df188d8704f164dULL, },
+ { 0x4b670b5e886ae6ccULL, 0x8df188d88df188d8ULL, }, /* 80 */
+ { 0x12f7bb1afbbe0063ULL, 0x8df188d84b670b5eULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x8df188d812f7bb1aULL, },
+ { 0x8df188d8704f164dULL, 0x8df188d827d8c6ffULL, },
+ { 0x4b670b5e886ae6ccULL, 0x8df188d88df188d8ULL, },
+ { 0x12f7bb1afbbe0063ULL, 0x8df188d84b670b5eULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x8df188d812f7bb1aULL, },
+ { 0x8df188d8704f164dULL, 0x8df188d827d8c6ffULL, },
+ { 0x4b670b5e886ae6ccULL, 0x8df188d88df188d8ULL, }, /* 88 */
+ { 0x12f7bb1afbbe0063ULL, 0x8df188d84b670b5eULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x8df188d812f7bb1aULL, },
+ { 0x8df188d8704f164dULL, 0x8df188d827d8c6ffULL, },
+ { 0x4b670b5e886ae6ccULL, 0x8df188d88df188d8ULL, },
+ { 0x12f7bb1afbbe0063ULL, 0x8df188d84b670b5eULL, },
+ { 0x27d8c6ffac5aaeaaULL, 0x8df188d812f7bb1aULL, },
+ { 0x8df188d8704f164dULL, 0x8df188d827d8c6ffULL, },
+ { 0x8df188d88df188d8ULL, 0x4b670b5e886ae6ccULL, }, /* 96 */
+ { 0x4b670b5e8df188d8ULL, 0x4b670b5e886ae6ccULL, },
+ { 0x4b670b5e4b670b5eULL, 0x4b670b5e886ae6ccULL, },
+ { 0x4b670b5e4b670b5eULL, 0x4b670b5e886ae6ccULL, },
+ { 0x4b670b5e4b670b5eULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x12f7bb1a4b670b5eULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x12f7bb1a12f7bb1aULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x12f7bb1a12f7bb1aULL, 0x12f7bb1afbbe0063ULL, },
+ { 0x12f7bb1a12f7bb1aULL, 0x27d8c6ffac5aaeaaULL, }, /* 104 */
+ { 0x27d8c6ff12f7bb1aULL, 0x27d8c6ffac5aaeaaULL, },
+ { 0x27d8c6ff27d8c6ffULL, 0x27d8c6ffac5aaeaaULL, },
+ { 0x27d8c6ff27d8c6ffULL, 0x27d8c6ffac5aaeaaULL, },
+ { 0x27d8c6ff27d8c6ffULL, 0x8df188d8704f164dULL, },
+ { 0x8df188d827d8c6ffULL, 0x8df188d8704f164dULL, },
+ { 0x8df188d88df188d8ULL, 0x8df188d8704f164dULL, },
+ { 0x8df188d88df188d8ULL, 0x8df188d8704f164dULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_PCKOD_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c
new file mode 100644
index 0000000000..1839a26ca7
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_b.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction VSHF.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "VSHF.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e8e8e8e8e8e8e8eULL, 0x8e8e8e8e8e8e8e8eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, }, /* 80 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, }, /* 88 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 96 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 104 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_B__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_B__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c
new file mode 100644
index 0000000000..ebc198feb8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_d.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction VSHF.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "VSHF.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38e38e38e38e38eULL, 0xe38e38e38e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 80 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, }, /* 88 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x886ae6cc28625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0xac5aaeaab9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 96 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 104 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_D__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_D__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c
new file mode 100644
index 0000000000..a7240134d7
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_h.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction VSHF.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "VSHF.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xe38ee38ee38ee38eULL, 0xe38ee38ee38ee38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, }, /* 80 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, }, /* 88 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8b808b808b808b80ULL, 0x8b808b808b808b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 96 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 104 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_H__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_H__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c
new file mode 100644
index 0000000000..607ac4fb53
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/pack/test_msa_vshf_w.c
@@ -0,0 +1,214 @@
+/*
+ * Test program for MSA instruction VSHF.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *`
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ 3 * (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Pack";
+ char *instruction_name = "VSHF.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 24 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 40 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 48 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x8e38e38e8e38e38eULL, 0x8e38e38e8e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, }, /* 64 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, }, /* 72 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, }, /* 80 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, }, /* 88 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x2862554028625540ULL, 0x2862554028625540ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xb9cf8b80b9cf8b80ULL, 0xb9cf8b80b9cf8b80ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 96 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 104 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_W__DDT(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ ((RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_VSHF_W__DSD(b128_random[i], b128_random[j],
+ b128_result[
+ ((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ (2 * (RANDOM_INPUTS_SHORT_COUNT) *
+ (RANDOM_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_b.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_b.c
new file mode 100644
index 0000000000..649e67b6a1
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SLL.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SLL.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xe0e0e0e0e0e0e0e0ULL, 0xe0e0e0e0e0e0e0e0ULL, },
+ { 0xf0f0f0f0f0f0f0f0ULL, 0xf0f0f0f0f0f0f0f0ULL, },
+ { 0xf8f8f8f8f8f8f8f8ULL, 0xf8f8f8f8f8f8f8f8ULL, },
+ { 0xf8c0fff8c0fff8c0ULL, 0xfff8c0fff8c0fff8ULL, },
+ { 0xf0fe80f0fe80f0feULL, 0x80f0fe80f0fe80f0ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xa8a8a8a8a8a8a8a8ULL, 0xa8a8a8a8a8a8a8a8ULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, },
+ { 0xa0a0a0a0a0a0a0a0ULL, 0xa0a0a0a0a0a0a0a0ULL, },
+ { 0x5050505050505050ULL, 0x5050505050505050ULL, },
+ { 0x5080aa5080aa5080ULL, 0xaa5080aa5080aa50ULL, },
+ { 0xa05400a05400a054ULL, 0x00a05400a05400a0ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5454545454545454ULL, 0x5454545454545454ULL, },
+ { 0xa0a0a0a0a0a0a0a0ULL, 0xa0a0a0a0a0a0a0a0ULL, },
+ { 0x5050505050505050ULL, 0x5050505050505050ULL, },
+ { 0xa8a8a8a8a8a8a8a8ULL, 0xa8a8a8a8a8a8a8a8ULL, },
+ { 0xa84055a84055a840ULL, 0x55a84055a84055a8ULL, },
+ { 0x50aa8050aa8050aaULL, 0x8050aa8050aa8050ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3030303030303030ULL, 0x3030303030303030ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, },
+ { 0xc0c0c0c0c0c0c0c0ULL, 0xc0c0c0c0c0c0c0c0ULL, },
+ { 0x6060606060606060ULL, 0x6060606060606060ULL, },
+ { 0x6000cc6000cc6000ULL, 0xcc6000cc6000cc60ULL, },
+ { 0xc09800c09800c098ULL, 0x00c09800c09800c0ULL, },
+ { 0x8080808080808080ULL, 0x8080808080808080ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x6060606060606060ULL, 0x6060606060606060ULL, },
+ { 0x3030303030303030ULL, 0x3030303030303030ULL, },
+ { 0x9898989898989898ULL, 0x9898989898989898ULL, },
+ { 0x98c03398c03398c0ULL, 0x3398c03398c03398ULL, },
+ { 0x3066803066803066ULL, 0x8030668030668030ULL, },
+ { 0x8000008000008000ULL, 0x0080000080000080ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x8c38e08c38e08c38ULL, 0xe08c38e08c38e08cULL, },
+ { 0x60c00060c00060c0ULL, 0x0060c00060c00060ULL, },
+ { 0x30e08030e08030e0ULL, 0x8030e08030e08030ULL, },
+ { 0x1870c01870c01870ULL, 0xc01870c01870c018ULL, },
+ { 0x1880381880381880ULL, 0x3818803818803818ULL, },
+ { 0x301c00301c00301cULL, 0x00301c00301c0030ULL, },
+ { 0x0080800080800080ULL, 0x8000808000808000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x70c41c70c41c70c4ULL, 0x1c70c41c70c41c70ULL, },
+ { 0x8020e08020e08020ULL, 0xe08020e08020e080ULL, },
+ { 0xc01070c01070c010ULL, 0x70c01070c01070c0ULL, },
+ { 0xe08838e08838e088ULL, 0x38e08838e08838e0ULL, },
+ { 0xe040c7e040c7e040ULL, 0xc7e040c7e040c7e0ULL, },
+ { 0xc0e280c0e280c0e2ULL, 0x80c0e280c0e280c0ULL, },
+ { 0x88a880c02888a040ULL, 0x5880588080d8b0c0ULL, }, /* 64 */
+ { 0x4080e66000108040ULL, 0x2c805878c080c0c0ULL, },
+ { 0x80a880305000a840ULL, 0x8067c000f0d800c0ULL, },
+ { 0x8800808000c45400ULL, 0x60ce0b5efcecc00cULL, },
+ { 0xfbf800304d4ce008ULL, 0x9080d88040f852c0ULL, },
+ { 0xd8800018a0988008ULL, 0x4880d868a08048c0ULL, },
+ { 0xb0f8008c9a803808ULL, 0x00f7c000a8f840c0ULL, },
+ { 0xfb00006040261c00ULL, 0x40eebb1a2afc48fcULL, },
+ { 0xac6880a0b93c6080ULL, 0x380030c0c0582540ULL, }, /* 72 */
+ { 0x6080ae5020788080ULL, 0x9c0030fc60809440ULL, },
+ { 0xc06880a872805880ULL, 0x80d880805858a040ULL, },
+ { 0xac008040409e2c00ULL, 0xe0b0c6ff56ac9414ULL, },
+ { 0x703c80d05ec4404eULL, 0x688040004010e200ULL, },
+ { 0x80c01668c088004eULL, 0x3480406020008800ULL, },
+ { 0x003c8034bc80104eULL, 0x80f1000048104000ULL, },
+ { 0x708080a080628880ULL, 0xa0e288d8520888a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_d.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_d.c
new file mode 100644
index 0000000000..1d6fe54207
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SLL.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SLL.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfffffc0000000000ULL, 0xfffffc0000000000ULL, },
+ { 0xffffffffffe00000ULL, 0xffffffffffe00000ULL, },
+ { 0xfffffffffffff000ULL, 0xfffffffffffff000ULL, },
+ { 0xfff8000000000000ULL, 0xfff8000000000000ULL, },
+ { 0xffffffffffffc000ULL, 0xfffffff800000000ULL, },
+ { 0xfffe000000000000ULL, 0xfffffffff0000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaa80000000000ULL, 0xaaaaa80000000000ULL, },
+ { 0x5555555555400000ULL, 0x5555555555400000ULL, },
+ { 0xaaaaaaaaaaaaa000ULL, 0xaaaaaaaaaaaaa000ULL, },
+ { 0x5550000000000000ULL, 0x5550000000000000ULL, },
+ { 0xaaaaaaaaaaaa8000ULL, 0x5555555000000000ULL, },
+ { 0x5554000000000000ULL, 0xaaaaaaaaa0000000ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555540000000000ULL, 0x5555540000000000ULL, },
+ { 0xaaaaaaaaaaa00000ULL, 0xaaaaaaaaaaa00000ULL, },
+ { 0x5555555555555000ULL, 0x5555555555555000ULL, },
+ { 0xaaa8000000000000ULL, 0xaaa8000000000000ULL, },
+ { 0x5555555555554000ULL, 0xaaaaaaa800000000ULL, },
+ { 0xaaaa000000000000ULL, 0x5555555550000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333300000000000ULL, 0x3333300000000000ULL, },
+ { 0x9999999999800000ULL, 0x9999999999800000ULL, },
+ { 0xccccccccccccc000ULL, 0xccccccccccccc000ULL, },
+ { 0x6660000000000000ULL, 0x6660000000000000ULL, },
+ { 0x3333333333330000ULL, 0x6666666000000000ULL, },
+ { 0x9998000000000000ULL, 0xccccccccc0000000ULL, },
+ { 0x8000000000000000ULL, 0x8000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcccccc0000000000ULL, 0xcccccc0000000000ULL, },
+ { 0x6666666666600000ULL, 0x6666666666600000ULL, },
+ { 0x3333333333333000ULL, 0x3333333333333000ULL, },
+ { 0x9998000000000000ULL, 0x9998000000000000ULL, },
+ { 0xccccccccccccc000ULL, 0x9999999800000000ULL, },
+ { 0x6666000000000000ULL, 0x3333333330000000ULL, },
+ { 0x0000000000000000ULL, 0x8000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xe38e380000000000ULL, 0x38e38c0000000000ULL, },
+ { 0x1c71c71c71c00000ULL, 0xc71c71c71c600000ULL, },
+ { 0xe38e38e38e38e000ULL, 0x38e38e38e38e3000ULL, },
+ { 0x1c70000000000000ULL, 0xc718000000000000ULL, },
+ { 0x8e38e38e38e38000ULL, 0x1c71c71800000000ULL, },
+ { 0xc71c000000000000ULL, 0x8e38e38e30000000ULL, },
+ { 0x8000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x1c71c40000000000ULL, 0xc71c700000000000ULL, },
+ { 0xe38e38e38e200000ULL, 0x38e38e38e3800000ULL, },
+ { 0x1c71c71c71c71000ULL, 0xc71c71c71c71c000ULL, },
+ { 0xe388000000000000ULL, 0x38e0000000000000ULL, },
+ { 0x71c71c71c71c4000ULL, 0xe38e38e000000000ULL, },
+ { 0x38e2000000000000ULL, 0x71c71c71c0000000ULL, },
+ { 0x886ae6cc28625540ULL, 0x70b5efe7bb00c000ULL, }, /* 64 */
+ { 0x6ae6cc2862554000ULL, 0xc000000000000000ULL, },
+ { 0x886ae6cc28625540ULL, 0xb5efe7bb00c00000ULL, },
+ { 0xb9b30a1895500000ULL, 0xfe7bb00c00000000ULL, },
+ { 0xfbbe00634d93c708ULL, 0x7bb1a153f52fc000ULL, },
+ { 0xbe00634d93c70800ULL, 0xc000000000000000ULL, },
+ { 0xfbbe00634d93c708ULL, 0xb1a153f52fc00000ULL, },
+ { 0x8018d364f1c20000ULL, 0x153f52fc00000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x8c6ffab2b2514000ULL, }, /* 72 */
+ { 0x5aaeaab9cf8b8000ULL, 0x4000000000000000ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x6ffab2b251400000ULL, },
+ { 0xabaaae73e2e00000ULL, 0xab2b251400000000ULL, },
+ { 0x704f164d5e31e24eULL, 0x188d8a942e2a0000ULL, },
+ { 0x4f164d5e31e24e00ULL, 0x0000000000000000ULL, },
+ { 0x704f164d5e31e24eULL, 0x8d8a942e2a000000ULL, },
+ { 0xc593578c78938000ULL, 0xa942e2a000000000ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_h.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_h.c
new file mode 100644
index 0000000000..1e6c27bfe7
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SLL.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SLL.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfc00fc00fc00fc00ULL, 0xfc00fc00fc00fc00ULL, },
+ { 0xffe0ffe0ffe0ffe0ULL, 0xffe0ffe0ffe0ffe0ULL, },
+ { 0xf000f000f000f000ULL, 0xf000f000f000f000ULL, },
+ { 0xfff8fff8fff8fff8ULL, 0xfff8fff8fff8fff8ULL, },
+ { 0xc000fff8ff00c000ULL, 0xfff8ff00c000fff8ULL, },
+ { 0xfffef000ff80fffeULL, 0xf000ff80fffef000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xa800a800a800a800ULL, 0xa800a800a800a800ULL, },
+ { 0x5540554055405540ULL, 0x5540554055405540ULL, },
+ { 0xa000a000a000a000ULL, 0xa000a000a000a000ULL, },
+ { 0x5550555055505550ULL, 0x5550555055505550ULL, },
+ { 0x80005550aa008000ULL, 0x5550aa0080005550ULL, },
+ { 0x5554a00055005554ULL, 0xa00055005554a000ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5400540054005400ULL, 0x5400540054005400ULL, },
+ { 0xaaa0aaa0aaa0aaa0ULL, 0xaaa0aaa0aaa0aaa0ULL, },
+ { 0x5000500050005000ULL, 0x5000500050005000ULL, },
+ { 0xaaa8aaa8aaa8aaa8ULL, 0xaaa8aaa8aaa8aaa8ULL, },
+ { 0x4000aaa855004000ULL, 0xaaa855004000aaa8ULL, },
+ { 0xaaaa5000aa80aaaaULL, 0x5000aa80aaaa5000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3000300030003000ULL, 0x3000300030003000ULL, },
+ { 0x9980998099809980ULL, 0x9980998099809980ULL, },
+ { 0xc000c000c000c000ULL, 0xc000c000c000c000ULL, },
+ { 0x6660666066606660ULL, 0x6660666066606660ULL, },
+ { 0x00006660cc000000ULL, 0x6660cc0000006660ULL, },
+ { 0x9998c00066009998ULL, 0xc00066009998c000ULL, },
+ { 0x8000800080008000ULL, 0x8000800080008000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
+ { 0x6660666066606660ULL, 0x6660666066606660ULL, },
+ { 0x3000300030003000ULL, 0x3000300030003000ULL, },
+ { 0x9998999899989998ULL, 0x9998999899989998ULL, },
+ { 0xc00099983300c000ULL, 0x99983300c0009998ULL, },
+ { 0x6666300099806666ULL, 0x3000998066663000ULL, },
+ { 0x0000800000000000ULL, 0x8000000000008000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38008c00e0003800ULL, 0x8c00e00038008c00ULL, },
+ { 0x71c01c60c70071c0ULL, 0x1c60c70071c01c60ULL, },
+ { 0xe00030008000e000ULL, 0x30008000e0003000ULL, },
+ { 0x1c70c71871c01c70ULL, 0xc71871c01c70c718ULL, },
+ { 0x8000c71838008000ULL, 0xc71838008000c718ULL, },
+ { 0xc71c30001c00c71cULL, 0x30001c00c71c3000ULL, },
+ { 0x8000000080008000ULL, 0x0000800080000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc40070001c00c400ULL, 0x70001c00c4007000ULL, },
+ { 0x8e20e38038e08e20ULL, 0xe38038e08e20e380ULL, },
+ { 0x1000c00070001000ULL, 0xc00070001000c000ULL, },
+ { 0xe38838e08e38e388ULL, 0x38e08e38e38838e0ULL, },
+ { 0x400038e0c7004000ULL, 0x38e0c700400038e0ULL, },
+ { 0x38e2c000e38038e2ULL, 0xc000e38038e2c000ULL, },
+ { 0xa800c000a1885540ULL, 0xb3808000d800c000ULL, }, /* 64 */
+ { 0x8000366043104000ULL, 0xb38078008000c000ULL, },
+ { 0xa800300000005540ULL, 0x67000000d80000c0ULL, },
+ { 0x0000800050c40000ULL, 0x96ce5e00f9ecb00cULL, },
+ { 0xf8003000364cc708ULL, 0x7b808000f800c000ULL, },
+ { 0x800003186c980800ULL, 0x7b8068008000c000ULL, },
+ { 0xf8008c008000c708ULL, 0xf7000000f8002fc0ULL, },
+ { 0x000060009b260000ULL, 0x25ee1a0054fc52fcULL, },
+ { 0x6800a000e73c8b80ULL, 0xec00c00058004000ULL, }, /* 72 */
+ { 0x80007550ce788000ULL, 0xec00fc0080004000ULL, },
+ { 0x6800a80080008b80ULL, 0xd800800058005140ULL, },
+ { 0x00004000739e0000ULL, 0x4fb0ff00acac2514ULL, },
+ { 0x3c00d00078c4e24eULL, 0xf880000010000000ULL, },
+ { 0xc000b268f1884e00ULL, 0xf880600000000000ULL, },
+ { 0x3c0034008000e24eULL, 0xf100000010002a00ULL, },
+ { 0x8000a000bc628000ULL, 0x1be2d800a508e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_w.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_w.c
new file mode 100644
index 0000000000..8bfbaca6fc
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sll_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SLL.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SLL.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xfffffc00fffffc00ULL, 0xfffffc00fffffc00ULL, },
+ { 0xffe00000ffe00000ULL, 0xffe00000ffe00000ULL, },
+ { 0xfffff000fffff000ULL, 0xfffff000fffff000ULL, },
+ { 0xfff80000fff80000ULL, 0xfff80000fff80000ULL, },
+ { 0xfffffff8ffffc000ULL, 0xff000000fffffff8ULL, },
+ { 0xf0000000fffe0000ULL, 0xffffff80f0000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xaaaaa800aaaaa800ULL, 0xaaaaa800aaaaa800ULL, },
+ { 0x5540000055400000ULL, 0x5540000055400000ULL, },
+ { 0xaaaaa000aaaaa000ULL, 0xaaaaa000aaaaa000ULL, },
+ { 0x5550000055500000ULL, 0x5550000055500000ULL, },
+ { 0x55555550aaaa8000ULL, 0xaa00000055555550ULL, },
+ { 0xa000000055540000ULL, 0x55555500a0000000ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x5555540055555400ULL, 0x5555540055555400ULL, },
+ { 0xaaa00000aaa00000ULL, 0xaaa00000aaa00000ULL, },
+ { 0x5555500055555000ULL, 0x5555500055555000ULL, },
+ { 0xaaa80000aaa80000ULL, 0xaaa80000aaa80000ULL, },
+ { 0xaaaaaaa855554000ULL, 0x55000000aaaaaaa8ULL, },
+ { 0x50000000aaaa0000ULL, 0xaaaaaa8050000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333300033333000ULL, 0x3333300033333000ULL, },
+ { 0x9980000099800000ULL, 0x9980000099800000ULL, },
+ { 0xccccc000ccccc000ULL, 0xccccc000ccccc000ULL, },
+ { 0x6660000066600000ULL, 0x6660000066600000ULL, },
+ { 0x6666666033330000ULL, 0xcc00000066666660ULL, },
+ { 0xc000000099980000ULL, 0x66666600c0000000ULL, },
+ { 0x8000000080000000ULL, 0x8000000080000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0xcccccc00cccccc00ULL, 0xcccccc00cccccc00ULL, },
+ { 0x6660000066600000ULL, 0x6660000066600000ULL, },
+ { 0x3333300033333000ULL, 0x3333300033333000ULL, },
+ { 0x9998000099980000ULL, 0x9998000099980000ULL, },
+ { 0x99999998ccccc000ULL, 0x3300000099999998ULL, },
+ { 0x3000000066660000ULL, 0x9999998030000000ULL, },
+ { 0x8000000000000000ULL, 0x0000000080000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38e38c00e38e3800ULL, 0x8e38e00038e38c00ULL, },
+ { 0x1c60000071c00000ULL, 0xc70000001c600000ULL, },
+ { 0xe38e30008e38e000ULL, 0x38e38000e38e3000ULL, },
+ { 0xc71800001c700000ULL, 0x71c00000c7180000ULL, },
+ { 0x1c71c71838e38000ULL, 0x380000001c71c718ULL, },
+ { 0x30000000c71c0000ULL, 0x71c71c0030000000ULL, },
+ { 0x0000000080000000ULL, 0x8000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0xc71c70001c71c400ULL, 0x71c71c00c71c7000ULL, },
+ { 0xe38000008e200000ULL, 0x38e00000e3800000ULL, },
+ { 0x1c71c00071c71000ULL, 0xc71c70001c71c000ULL, },
+ { 0x38e00000e3880000ULL, 0x8e38000038e00000ULL, },
+ { 0xe38e38e0c71c4000ULL, 0xc7000000e38e38e0ULL, },
+ { 0xc000000038e20000ULL, 0x8e38e380c0000000ULL, },
+ { 0xae6cc00028625540ULL, 0x80000000bb00c000ULL, }, /* 64 */
+ { 0x4357366062554000ULL, 0x78000000c0000000ULL, },
+ { 0xab9b300028625540ULL, 0x0000000000c00000ULL, },
+ { 0x5cd9800095500000ULL, 0x5e000000fe7bb00cULL, },
+ { 0xe00630004d93c708ULL, 0x80000000f52fc000ULL, },
+ { 0xddf0031893c70800ULL, 0x68000000c0000000ULL, },
+ { 0xf8018c004d93c708ULL, 0x000000002fc00000ULL, },
+ { 0xc00c6000f1c20000ULL, 0x1a000000153f52fcULL, },
+ { 0xaaeaa000b9cf8b80ULL, 0xc0000000b2514000ULL, }, /* 72 */
+ { 0x62d57550cf8b8000ULL, 0xfc00000040000000ULL, },
+ { 0x6abaa800b9cf8b80ULL, 0x8000000051400000ULL, },
+ { 0x55d54000e2e00000ULL, 0xff000000ab2b2514ULL, },
+ { 0xf164d0005e31e24eULL, 0x000000002e2a0000ULL, },
+ { 0x8278b26831e24e00ULL, 0x6000000000000000ULL, },
+ { 0x3c5934005e31e24eULL, 0x000000002a000000ULL, },
+ { 0xe2c9a00078938000ULL, 0xd8000000a942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SLL_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_b.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_b.c
new file mode 100644
index 0000000000..a5dcee3a72
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRA.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRA.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xeaeaeaeaeaeaeaeaULL, 0xeaeaeaeaeaeaeaeaULL, },
+ { 0xfdfdfdfdfdfdfdfdULL, 0xfdfdfdfdfdfdfdfdULL, },
+ { 0xfafafafafafafafaULL, 0xfafafafafafafafaULL, },
+ { 0xf5f5f5f5f5f5f5f5ULL, 0xf5f5f5f5f5f5f5f5ULL, },
+ { 0xf5feaaf5feaaf5feULL, 0xaaf5feaaf5feaaf5ULL, },
+ { 0xfad5fffad5fffad5ULL, 0xfffad5fffad5fffaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1515151515151515ULL, 0x1515151515151515ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0a0a0a0a0a0a0a0aULL, 0x0a0a0a0a0a0a0a0aULL, },
+ { 0x0a01550a01550a01ULL, 0x550a01550a01550aULL, },
+ { 0x052a00052a00052aULL, 0x00052a00052a0005ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xf3f3f3f3f3f3f3f3ULL, 0xf3f3f3f3f3f3f3f3ULL, },
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, },
+ { 0xfcfcfcfcfcfcfcfcULL, 0xfcfcfcfcfcfcfcfcULL, },
+ { 0xf9f9f9f9f9f9f9f9ULL, 0xf9f9f9f9f9f9f9f9ULL, },
+ { 0xf9ffccf9ffccf9ffULL, 0xccf9ffccf9ffccf9ULL, },
+ { 0xfce6fffce6fffce6ULL, 0xfffce6fffce6fffcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0c0c0c0c0c0c0c0cULL, 0x0c0c0c0c0c0c0c0cULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0x0600330600330600ULL, 0x3306003306003306ULL, },
+ { 0x0319000319000319ULL, 0x0003190003190003ULL, },
+ { 0xffff00ffff00ffffULL, 0x00ffff00ffff00ffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xf8e30ef8e30ef8e3ULL, 0x0ef8e30ef8e30ef8ULL, },
+ { 0xfffc01fffc01fffcULL, 0x01fffc01fffc01ffULL, },
+ { 0xfef803fef803fef8ULL, 0x03fef803fef803feULL, },
+ { 0xfcf107fcf107fcf1ULL, 0x07fcf107fcf107fcULL, },
+ { 0xfcfe38fcfe38fcfeULL, 0x38fcfe38fcfe38fcULL, },
+ { 0xfec700fec700fec7ULL, 0x00fec700fec700feULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x071cf1071cf1071cULL, 0xf1071cf1071cf107ULL, },
+ { 0x0003fe0003fe0003ULL, 0xfe0003fe0003fe00ULL, },
+ { 0x0107fc0107fc0107ULL, 0xfc0107fc0107fc01ULL, },
+ { 0x030ef8030ef8030eULL, 0xf8030ef8030ef803ULL, },
+ { 0x0301c70301c70301ULL, 0xc70301c70301c703ULL, },
+ { 0x0138ff0138ff0138ULL, 0xff0138ff0138ff01ULL, },
+ { 0x881afffc28180240ULL, 0x09000101ff0fb000ULL, }, /* 64 */
+ { 0xf101e6f9010c0040ULL, 0x12000117ff00ec00ULL, },
+ { 0xf81afff314000a40ULL, 0x00670000ff0ffd00ULL, },
+ { 0x8800fffe00311501ULL, 0x02330b5eff1eec0cULL, },
+ { 0xfbef00064de4fe08ULL, 0x02fff700000752ffULL, },
+ { 0xfffe000c02f2ff08ULL, 0x04fff706000014ffULL, },
+ { 0xffef001826fff808ULL, 0x00f7fe00020702ffULL, },
+ { 0xfbff000301c9f100ULL, 0x00fbbb1a0a0f14fcULL, },
+ { 0xac16fefab9f3fc80ULL, 0x04fff8fffe052501ULL, }, /* 72 */
+ { 0xf501aef5fdf9ff80ULL, 0x09fff8fffd000901ULL, },
+ { 0xfa16feeadcfff180ULL, 0x00d8fffff5050101ULL, },
+ { 0xac00fefdfee7e2feULL, 0x01ecc6ffd50a0914ULL, },
+ { 0x701300045e0cff4eULL, 0xf1fff1fffe08e2faULL, },
+ { 0x0e0116090206ff4eULL, 0xe3fff1f6fd00f8faULL, },
+ { 0x071300132f00fc4eULL, 0xfff1fefff508fffaULL, },
+ { 0x700000020118f801ULL, 0xfcf888d8d410f8a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_d.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_d.c
new file mode 100644
index 0000000000..95a13620b9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRA.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRA.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffeaaaaaULL, 0xffffffffffeaaaaaULL, },
+ { 0xfffffd5555555555ULL, 0xfffffd5555555555ULL, },
+ { 0xfffaaaaaaaaaaaaaULL, 0xfffaaaaaaaaaaaaaULL, },
+ { 0xfffffffffffff555ULL, 0xfffffffffffff555ULL, },
+ { 0xfffeaaaaaaaaaaaaULL, 0xfffffffff5555555ULL, },
+ { 0xffffffffffffd555ULL, 0xfffffffaaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000155555ULL, 0x0000000000155555ULL, },
+ { 0x000002aaaaaaaaaaULL, 0x000002aaaaaaaaaaULL, },
+ { 0x0005555555555555ULL, 0x0005555555555555ULL, },
+ { 0x0000000000000aaaULL, 0x0000000000000aaaULL, },
+ { 0x0001555555555555ULL, 0x000000000aaaaaaaULL, },
+ { 0x0000000000002aaaULL, 0x0000000555555555ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xfffffffffff33333ULL, 0xfffffffffff33333ULL, },
+ { 0xfffffe6666666666ULL, 0xfffffe6666666666ULL, },
+ { 0xfffcccccccccccccULL, 0xfffcccccccccccccULL, },
+ { 0xfffffffffffff999ULL, 0xfffffffffffff999ULL, },
+ { 0xffff333333333333ULL, 0xfffffffff9999999ULL, },
+ { 0xffffffffffffe666ULL, 0xfffffffcccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x00000000000cccccULL, 0x00000000000cccccULL, },
+ { 0x0000019999999999ULL, 0x0000019999999999ULL, },
+ { 0x0003333333333333ULL, 0x0003333333333333ULL, },
+ { 0x0000000000000666ULL, 0x0000000000000666ULL, },
+ { 0x0000ccccccccccccULL, 0x0000000006666666ULL, },
+ { 0x0000000000001999ULL, 0x0000000333333333ULL, },
+ { 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xfffffffffff8e38eULL, 0x00000000000e38e3ULL, },
+ { 0xffffff1c71c71c71ULL, 0x000001c71c71c71cULL, },
+ { 0xfffe38e38e38e38eULL, 0x00038e38e38e38e3ULL, },
+ { 0xfffffffffffffc71ULL, 0x000000000000071cULL, },
+ { 0xffff8e38e38e38e3ULL, 0x00000000071c71c7ULL, },
+ { 0xfffffffffffff1c7ULL, 0x000000038e38e38eULL, },
+ { 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000071c71ULL, 0xfffffffffff1c71cULL, },
+ { 0x000000e38e38e38eULL, 0xfffffe38e38e38e3ULL, },
+ { 0x0001c71c71c71c71ULL, 0xfffc71c71c71c71cULL, },
+ { 0x000000000000038eULL, 0xfffffffffffff8e3ULL, },
+ { 0x000071c71c71c71cULL, 0xfffffffff8e38e38ULL, },
+ { 0x0000000000000e38ULL, 0xfffffffc71c71c71ULL, },
+ { 0x886ae6cc28625540ULL, 0x0004b670b5efe7bbULL, }, /* 64 */
+ { 0xff886ae6cc286255ULL, 0x0000000000000004ULL, },
+ { 0x886ae6cc28625540ULL, 0x000004b670b5efe7ULL, },
+ { 0xfffe21ab9b30a189ULL, 0x000000004b670b5eULL, },
+ { 0xfbbe00634d93c708ULL, 0x00012f7bb1a153f5ULL, },
+ { 0xfffbbe00634d93c7ULL, 0x0000000000000001ULL, },
+ { 0xfbbe00634d93c708ULL, 0x0000012f7bb1a153ULL, },
+ { 0xffffeef8018d364fULL, 0x0000000012f7bb1aULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x00027d8c6ffab2b2ULL, }, /* 72 */
+ { 0xffac5aaeaab9cf8bULL, 0x0000000000000002ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x0000027d8c6ffab2ULL, },
+ { 0xfffeb16abaaae73eULL, 0x0000000027d8c6ffULL, },
+ { 0x704f164d5e31e24eULL, 0xfff8df188d8a942eULL, },
+ { 0x00704f164d5e31e2ULL, 0xfffffffffffffff8ULL, },
+ { 0x704f164d5e31e24eULL, 0xfffff8df188d8a94ULL, },
+ { 0x0001c13c593578c7ULL, 0xffffffff8df188d8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_h.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_h.c
new file mode 100644
index 0000000000..f00003d51c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRA.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRA.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffeaffeaffeaffeaULL, 0xffeaffeaffeaffeaULL, },
+ { 0xfd55fd55fd55fd55ULL, 0xfd55fd55fd55fd55ULL, },
+ { 0xfffafffafffafffaULL, 0xfffafffafffafffaULL, },
+ { 0xf555f555f555f555ULL, 0xf555f555f555f555ULL, },
+ { 0xfffef555ffaafffeULL, 0xf555ffaafffef555ULL, },
+ { 0xd555fffaff55d555ULL, 0xfffaff55d555fffaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015001500150015ULL, 0x0015001500150015ULL, },
+ { 0x02aa02aa02aa02aaULL, 0x02aa02aa02aa02aaULL, },
+ { 0x0005000500050005ULL, 0x0005000500050005ULL, },
+ { 0x0aaa0aaa0aaa0aaaULL, 0x0aaa0aaa0aaa0aaaULL, },
+ { 0x00010aaa00550001ULL, 0x0aaa005500010aaaULL, },
+ { 0x2aaa000500aa2aaaULL, 0x000500aa2aaa0005ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xfff3fff3fff3fff3ULL, 0xfff3fff3fff3fff3ULL, },
+ { 0xfe66fe66fe66fe66ULL, 0xfe66fe66fe66fe66ULL, },
+ { 0xfffcfffcfffcfffcULL, 0xfffcfffcfffcfffcULL, },
+ { 0xf999f999f999f999ULL, 0xf999f999f999f999ULL, },
+ { 0xfffff999ffccffffULL, 0xf999ffccfffff999ULL, },
+ { 0xe666fffcff99e666ULL, 0xfffcff99e666fffcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000c000c000c000cULL, 0x000c000c000c000cULL, },
+ { 0x0199019901990199ULL, 0x0199019901990199ULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x0666066606660666ULL, 0x0666066606660666ULL, },
+ { 0x0000066600330000ULL, 0x0666003300000666ULL, },
+ { 0x1999000300661999ULL, 0x0003006619990003ULL, },
+ { 0xffff0000ffffffffULL, 0x0000ffffffff0000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xfff8000effe3fff8ULL, 0x000effe3fff8000eULL, },
+ { 0xff1c01c7fc71ff1cULL, 0x01c7fc71ff1c01c7ULL, },
+ { 0xfffe0003fff8fffeULL, 0x0003fff8fffe0003ULL, },
+ { 0xfc71071cf1c7fc71ULL, 0x071cf1c7fc71071cULL, },
+ { 0xffff071cff8effffULL, 0x071cff8effff071cULL, },
+ { 0xf1c70003ff1cf1c7ULL, 0x0003ff1cf1c70003ULL, },
+ { 0x0000ffff00000000ULL, 0xffff00000000ffffULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0007fff1001c0007ULL, 0xfff1001c0007fff1ULL, },
+ { 0x00e3fe38038e00e3ULL, 0xfe38038e00e3fe38ULL, },
+ { 0x0001fffc00070001ULL, 0xfffc00070001fffcULL, },
+ { 0x038ef8e30e38038eULL, 0xf8e30e38038ef8e3ULL, },
+ { 0x0000f8e300710000ULL, 0xf8e300710000f8e3ULL, },
+ { 0x0e38fffc00e30e38ULL, 0xfffc00e30e38fffcULL, },
+ { 0xffe2fffe0a185540ULL, 0x00960000fffffffbULL, }, /* 64 */
+ { 0xfffefcd9050c0055ULL, 0x00960002fffffffbULL, },
+ { 0xffe2fff900005540ULL, 0x004b0000fffffb00ULL, },
+ { 0xffffffff14310001ULL, 0x25b3000bff9eb00cULL, },
+ { 0xfffe00001364c708ULL, 0x0025fffe00020005ULL, },
+ { 0xffff000c09b2ffc7ULL, 0x0025ffee00000005ULL, },
+ { 0xfffe00000000c708ULL, 0x0012ffff0002052fULL, },
+ { 0xffff000026c9ffffULL, 0x097bffbb054f52fcULL, },
+ { 0xffebfffaee738b80ULL, 0x004ffffffff50002ULL, }, /* 72 */
+ { 0xfffef5d5f739ff8bULL, 0x004ffff1ffff0002ULL, },
+ { 0xffebffebffff8b80ULL, 0x0027fffffff50251ULL, },
+ { 0xfffffffddce7fffeULL, 0x13ecffc6eaca2514ULL, },
+ { 0x001c0001178ce24eULL, 0xff1bfffefff5fffeULL, },
+ { 0x000102c90bc6ffe2ULL, 0xff1bffe2fffffffeULL, },
+ { 0x001c00050000e24eULL, 0xff8dfffffff5fe2aULL, },
+ { 0x000000002f18ffffULL, 0xc6f8ff88ea50e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_w.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_w.c
new file mode 100644
index 0000000000..f00da6d3d9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_sra_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRA.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRA.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffeaaaaaffeaaaaaULL, 0xffeaaaaaffeaaaaaULL, },
+ { 0xfffffd55fffffd55ULL, 0xfffffd55fffffd55ULL, },
+ { 0xfffaaaaafffaaaaaULL, 0xfffaaaaafffaaaaaULL, },
+ { 0xfffff555fffff555ULL, 0xfffff555fffff555ULL, },
+ { 0xf5555555fffeaaaaULL, 0xffffffaaf5555555ULL, },
+ { 0xfffffffaffffd555ULL, 0xff555555fffffffaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015555500155555ULL, 0x0015555500155555ULL, },
+ { 0x000002aa000002aaULL, 0x000002aa000002aaULL, },
+ { 0x0005555500055555ULL, 0x0005555500055555ULL, },
+ { 0x00000aaa00000aaaULL, 0x00000aaa00000aaaULL, },
+ { 0x0aaaaaaa00015555ULL, 0x000000550aaaaaaaULL, },
+ { 0x0000000500002aaaULL, 0x00aaaaaa00000005ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xfff33333fff33333ULL, 0xfff33333fff33333ULL, },
+ { 0xfffffe66fffffe66ULL, 0xfffffe66fffffe66ULL, },
+ { 0xfffcccccfffcccccULL, 0xfffcccccfffcccccULL, },
+ { 0xfffff999fffff999ULL, 0xfffff999fffff999ULL, },
+ { 0xf9999999ffff3333ULL, 0xffffffccf9999999ULL, },
+ { 0xfffffffcffffe666ULL, 0xff999999fffffffcULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000ccccc000cccccULL, 0x000ccccc000cccccULL, },
+ { 0x0000019900000199ULL, 0x0000019900000199ULL, },
+ { 0x0003333300033333ULL, 0x0003333300033333ULL, },
+ { 0x0000066600000666ULL, 0x0000066600000666ULL, },
+ { 0x066666660000ccccULL, 0x0000003306666666ULL, },
+ { 0x0000000300001999ULL, 0x0066666600000003ULL, },
+ { 0xffffffffffffffffULL, 0x00000000ffffffffULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xfff8e38effe38e38ULL, 0x000e38e3fff8e38eULL, },
+ { 0xffffff1cfffffc71ULL, 0x000001c7ffffff1cULL, },
+ { 0xfffe38e3fff8e38eULL, 0x00038e38fffe38e3ULL, },
+ { 0xfffffc71fffff1c7ULL, 0x0000071cfffffc71ULL, },
+ { 0xfc71c71cfffe38e3ULL, 0x00000038fc71c71cULL, },
+ { 0xfffffffeffffc71cULL, 0x0071c71cfffffffeULL, },
+ { 0x0000000000000000ULL, 0xffffffff00000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00071c71001c71c7ULL, 0xfff1c71c00071c71ULL, },
+ { 0x000000e30000038eULL, 0xfffffe38000000e3ULL, },
+ { 0x0001c71c00071c71ULL, 0xfffc71c70001c71cULL, },
+ { 0x0000038e00000e38ULL, 0xfffff8e30000038eULL, },
+ { 0x038e38e30001c71cULL, 0xffffffc7038e38e3ULL, },
+ { 0x00000001000038e3ULL, 0xff8e38e300000001ULL, },
+ { 0xfff886ae28625540ULL, 0x00000001ffffe7bbULL, }, /* 64 */
+ { 0xf10d5cd900286255ULL, 0x00000012ffffffffULL, },
+ { 0xffe21ab928625540ULL, 0x00000000ffffffe7ULL, },
+ { 0xfffc43570000a189ULL, 0x0000004bfe7bb00cULL, },
+ { 0xffffbbe04d93c708ULL, 0x00000000000153f5ULL, },
+ { 0xff77c00c004d93c7ULL, 0x0000000400000001ULL, },
+ { 0xfffeef804d93c708ULL, 0x0000000000000153ULL, },
+ { 0xffffddf00001364fULL, 0x00000012153f52fcULL, },
+ { 0xfffac5aab9cf8b80ULL, 0x00000000fffab2b2ULL, }, /* 72 */
+ { 0xf58b55d5ffb9cf8bULL, 0x00000009fffffffaULL, },
+ { 0xffeb16abb9cf8b80ULL, 0x00000000fffffab2ULL, },
+ { 0xfffd62d5fffee73eULL, 0x00000027ab2b2514ULL, },
+ { 0x000704f15e31e24eULL, 0xfffffffefffa942eULL, },
+ { 0x0e09e2c9005e31e2ULL, 0xffffffe3fffffffaULL, },
+ { 0x001c13c55e31e24eULL, 0xfffffffffffffa94ULL, },
+ { 0x00038278000178c7ULL, 0xffffff8da942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRA_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_b.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_b.c
new file mode 100644
index 0000000000..dcda9c2c95
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRAR.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRAR.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000ff0000ff0000ULL, 0xff0000ff0000ff00ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xebebebebebebebebULL, 0xebebebebebebebebULL, },
+ { 0xfdfdfdfdfdfdfdfdULL, 0xfdfdfdfdfdfdfdfdULL, },
+ { 0xfbfbfbfbfbfbfbfbULL, 0xfbfbfbfbfbfbfbfbULL, },
+ { 0xf5f5f5f5f5f5f5f5ULL, 0xf5f5f5f5f5f5f5f5ULL, },
+ { 0xf5ffaaf5ffaaf5ffULL, 0xaaf5ffaaf5ffaaf5ULL, },
+ { 0xfbd5fffbd5fffbd5ULL, 0xfffbd5fffbd5fffbULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1515151515151515ULL, 0x1515151515151515ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0b0b0b0b0b0b0b0bULL, 0x0b0b0b0b0b0b0b0bULL, },
+ { 0x0b01550b01550b01ULL, 0x550b01550b01550bULL, },
+ { 0x052b01052b01052bULL, 0x01052b01052b0105ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xf3f3f3f3f3f3f3f3ULL, 0xf3f3f3f3f3f3f3f3ULL, },
+ { 0xfefefefefefefefeULL, 0xfefefefefefefefeULL, },
+ { 0xfdfdfdfdfdfdfdfdULL, 0xfdfdfdfdfdfdfdfdULL, },
+ { 0xfafafafafafafafaULL, 0xfafafafafafafafaULL, },
+ { 0xfaffccfaffccfaffULL, 0xccfaffccfaffccfaULL, },
+ { 0xfde600fde600fde6ULL, 0x00fde600fde600fdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0d0d0d0d0d0d0d0dULL, 0x0d0d0d0d0d0d0d0dULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0x0601330601330601ULL, 0x3306013306013306ULL, },
+ { 0x031a00031a00031aULL, 0x00031a00031a0003ULL, },
+ { 0x00ff0000ff0000ffULL, 0x0000ff0000ff0000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xf9e40ef9e40ef9e4ULL, 0x0ef9e40ef9e40ef9ULL, },
+ { 0xfffc02fffc02fffcULL, 0x02fffc02fffc02ffULL, },
+ { 0xfef904fef904fef9ULL, 0x04fef904fef904feULL, },
+ { 0xfcf207fcf207fcf2ULL, 0x07fcf207fcf207fcULL, },
+ { 0xfcfe38fcfe38fcfeULL, 0x38fcfe38fcfe38fcULL, },
+ { 0xfec700fec700fec7ULL, 0x00fec700fec700feULL, },
+ { 0x0001000001000001ULL, 0x0000010000010000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x071cf2071cf2071cULL, 0xf2071cf2071cf207ULL, },
+ { 0x0104fe0104fe0104ULL, 0xfe0104fe0104fe01ULL, },
+ { 0x0207fc0207fc0207ULL, 0xfc0207fc0207fc02ULL, },
+ { 0x040ef9040ef9040eULL, 0xf9040ef9040ef904ULL, },
+ { 0x0402c70402c70402ULL, 0xc70402c70402c704ULL, },
+ { 0x0239000239000239ULL, 0x0002390002390002ULL, },
+ { 0x881b00fd28190340ULL, 0x09010101000fb001ULL, }, /* 64 */
+ { 0xf102e6fa010c0140ULL, 0x130101180001ec01ULL, },
+ { 0xf91b00f314010b40ULL, 0x01670001000ffe01ULL, },
+ { 0x880100fe01311501ULL, 0x02340b5eff1fec0cULL, },
+ { 0xfbf000064de5fe08ULL, 0x0200f70000085200ULL, },
+ { 0xffff000c02f20008ULL, 0x0500f70701001500ULL, },
+ { 0x00f0001927fff908ULL, 0x00f7ff0003080300ULL, },
+ { 0xfbff000301caf200ULL, 0x01fcbb1a0b1015fcULL, },
+ { 0xac17fffbb9f4fc80ULL, 0x0500f900ff052501ULL, }, /* 72 */
+ { 0xf601aef5fefaff80ULL, 0x0a00f900fd000901ULL, },
+ { 0xfb17ffebdd00f180ULL, 0x00d8ff00f5050101ULL, },
+ { 0xac01fffdffe8e3feULL, 0x01ecc6ffd60b0914ULL, },
+ { 0x701400055e0cff4eULL, 0xf200f1ffff08e2faULL, },
+ { 0x0e01160a0306004eULL, 0xe300f1f6fd01f9faULL, },
+ { 0x071400132f00fc4eULL, 0xfff1fe00f508fffaULL, },
+ { 0x700100020119f901ULL, 0xfcf988d8d511f9a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_d.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_d.c
new file mode 100644
index 0000000000..478098acd9
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRAR.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRAR.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffffffffffeaaaabULL, 0xffffffffffeaaaabULL, },
+ { 0xfffffd5555555555ULL, 0xfffffd5555555555ULL, },
+ { 0xfffaaaaaaaaaaaabULL, 0xfffaaaaaaaaaaaabULL, },
+ { 0xfffffffffffff555ULL, 0xfffffffffffff555ULL, },
+ { 0xfffeaaaaaaaaaaabULL, 0xfffffffff5555555ULL, },
+ { 0xffffffffffffd555ULL, 0xfffffffaaaaaaaabULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000155555ULL, 0x0000000000155555ULL, },
+ { 0x000002aaaaaaaaabULL, 0x000002aaaaaaaaabULL, },
+ { 0x0005555555555555ULL, 0x0005555555555555ULL, },
+ { 0x0000000000000aabULL, 0x0000000000000aabULL, },
+ { 0x0001555555555555ULL, 0x000000000aaaaaabULL, },
+ { 0x0000000000002aabULL, 0x0000000555555555ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xfffffffffff33333ULL, 0xfffffffffff33333ULL, },
+ { 0xfffffe6666666666ULL, 0xfffffe6666666666ULL, },
+ { 0xfffccccccccccccdULL, 0xfffccccccccccccdULL, },
+ { 0xfffffffffffff99aULL, 0xfffffffffffff99aULL, },
+ { 0xffff333333333333ULL, 0xfffffffff999999aULL, },
+ { 0xffffffffffffe666ULL, 0xfffffffccccccccdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x00000000000ccccdULL, 0x00000000000ccccdULL, },
+ { 0x000001999999999aULL, 0x000001999999999aULL, },
+ { 0x0003333333333333ULL, 0x0003333333333333ULL, },
+ { 0x0000000000000666ULL, 0x0000000000000666ULL, },
+ { 0x0000cccccccccccdULL, 0x0000000006666666ULL, },
+ { 0x000000000000199aULL, 0x0000000333333333ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xfffffffffff8e38eULL, 0x00000000000e38e4ULL, },
+ { 0xffffff1c71c71c72ULL, 0x000001c71c71c71cULL, },
+ { 0xfffe38e38e38e38eULL, 0x00038e38e38e38e4ULL, },
+ { 0xfffffffffffffc72ULL, 0x000000000000071cULL, },
+ { 0xffff8e38e38e38e4ULL, 0x00000000071c71c7ULL, },
+ { 0xfffffffffffff1c7ULL, 0x000000038e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000071c72ULL, 0xfffffffffff1c71cULL, },
+ { 0x000000e38e38e38eULL, 0xfffffe38e38e38e4ULL, },
+ { 0x0001c71c71c71c72ULL, 0xfffc71c71c71c71cULL, },
+ { 0x000000000000038eULL, 0xfffffffffffff8e4ULL, },
+ { 0x000071c71c71c71cULL, 0xfffffffff8e38e39ULL, },
+ { 0x0000000000000e39ULL, 0xfffffffc71c71c72ULL, },
+ { 0x886ae6cc28625540ULL, 0x0004b670b5efe7bbULL, }, /* 64 */
+ { 0xff886ae6cc286255ULL, 0x0000000000000005ULL, },
+ { 0x886ae6cc28625540ULL, 0x000004b670b5efe8ULL, },
+ { 0xfffe21ab9b30a189ULL, 0x000000004b670b5fULL, },
+ { 0xfbbe00634d93c708ULL, 0x00012f7bb1a153f5ULL, },
+ { 0xfffbbe00634d93c7ULL, 0x0000000000000001ULL, },
+ { 0xfbbe00634d93c708ULL, 0x0000012f7bb1a154ULL, },
+ { 0xffffeef8018d364fULL, 0x0000000012f7bb1aULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x00027d8c6ffab2b2ULL, }, /* 72 */
+ { 0xffac5aaeaab9cf8cULL, 0x0000000000000002ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x0000027d8c6ffab3ULL, },
+ { 0xfffeb16abaaae73eULL, 0x0000000027d8c700ULL, },
+ { 0x704f164d5e31e24eULL, 0xfff8df188d8a942eULL, },
+ { 0x00704f164d5e31e2ULL, 0xfffffffffffffff9ULL, },
+ { 0x704f164d5e31e24eULL, 0xfffff8df188d8a94ULL, },
+ { 0x0001c13c593578c8ULL, 0xffffffff8df188d9ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_h.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_h.c
new file mode 100644
index 0000000000..a30025548c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRAR.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRAR.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffebffebffebffebULL, 0xffebffebffebffebULL, },
+ { 0xfd55fd55fd55fd55ULL, 0xfd55fd55fd55fd55ULL, },
+ { 0xfffbfffbfffbfffbULL, 0xfffbfffbfffbfffbULL, },
+ { 0xf555f555f555f555ULL, 0xf555f555f555f555ULL, },
+ { 0xfffff555ffabffffULL, 0xf555ffabfffff555ULL, },
+ { 0xd555fffbff55d555ULL, 0xfffbff55d555fffbULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015001500150015ULL, 0x0015001500150015ULL, },
+ { 0x02ab02ab02ab02abULL, 0x02ab02ab02ab02abULL, },
+ { 0x0005000500050005ULL, 0x0005000500050005ULL, },
+ { 0x0aab0aab0aab0aabULL, 0x0aab0aab0aab0aabULL, },
+ { 0x00010aab00550001ULL, 0x0aab005500010aabULL, },
+ { 0x2aab000500ab2aabULL, 0x000500ab2aab0005ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xfff3fff3fff3fff3ULL, 0xfff3fff3fff3fff3ULL, },
+ { 0xfe66fe66fe66fe66ULL, 0xfe66fe66fe66fe66ULL, },
+ { 0xfffdfffdfffdfffdULL, 0xfffdfffdfffdfffdULL, },
+ { 0xf99af99af99af99aULL, 0xf99af99af99af99aULL, },
+ { 0xfffff99affcdffffULL, 0xf99affcdfffff99aULL, },
+ { 0xe666fffdff9ae666ULL, 0xfffdff9ae666fffdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000d000d000d000dULL, 0x000d000d000d000dULL, },
+ { 0x019a019a019a019aULL, 0x019a019a019a019aULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x0666066606660666ULL, 0x0666066606660666ULL, },
+ { 0x0001066600330001ULL, 0x0666003300010666ULL, },
+ { 0x199a00030066199aULL, 0x00030066199a0003ULL, },
+ { 0x00000000ffff0000ULL, 0x0000ffff00000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xfff9000effe4fff9ULL, 0x000effe4fff9000eULL, },
+ { 0xff1c01c7fc72ff1cULL, 0x01c7fc72ff1c01c7ULL, },
+ { 0xfffe0004fff9fffeULL, 0x0004fff9fffe0004ULL, },
+ { 0xfc72071cf1c7fc72ULL, 0x071cf1c7fc72071cULL, },
+ { 0x0000071cff8e0000ULL, 0x071cff8e0000071cULL, },
+ { 0xf1c70004ff1cf1c7ULL, 0x0004ff1cf1c70004ULL, },
+ { 0x0000000000010000ULL, 0x0000000100000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0007fff2001c0007ULL, 0xfff2001c0007fff2ULL, },
+ { 0x00e4fe39038e00e4ULL, 0xfe39038e00e4fe39ULL, },
+ { 0x0002fffc00070002ULL, 0xfffc00070002fffcULL, },
+ { 0x038ef8e40e39038eULL, 0xf8e40e39038ef8e4ULL, },
+ { 0x0000f8e400720000ULL, 0xf8e400720000f8e4ULL, },
+ { 0x0e39fffc00e40e39ULL, 0xfffc00e40e39fffcULL, },
+ { 0xffe2fffe0a195540ULL, 0x009700000000fffbULL, }, /* 64 */
+ { 0xfffefcda050c0055ULL, 0x009700030000fffbULL, },
+ { 0xffe2fffa00005540ULL, 0x004b00000000fb01ULL, },
+ { 0xffffffff14310001ULL, 0x25b4000bff9fb00cULL, },
+ { 0xffff00001365c708ULL, 0x0026ffff00030005ULL, },
+ { 0x0000000c09b2ffc7ULL, 0x0026ffef00000005ULL, },
+ { 0xffff00000001c708ULL, 0x0013ffff00030530ULL, },
+ { 0x0000000026caffffULL, 0x097cffbb055052fcULL, },
+ { 0xffebfffbee748b80ULL, 0x0050fffffff50002ULL, }, /* 72 */
+ { 0xfffff5d5f73aff8cULL, 0x0050fff2ffff0002ULL, },
+ { 0xffebffecffff8b80ULL, 0x00280000fff50251ULL, },
+ { 0xfffffffddce8fffeULL, 0x13ecffc7eacb2514ULL, },
+ { 0x001c0001178ce24eULL, 0xff1cfffefff5fffeULL, },
+ { 0x000202ca0bc6ffe2ULL, 0xff1cffe2fffffffeULL, },
+ { 0x001c00060001e24eULL, 0xff8efffffff5fe2aULL, },
+ { 0x000100012f190000ULL, 0xc6f9ff89ea51e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_w.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_w.c
new file mode 100644
index 0000000000..027d4ce565
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srar_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRAR.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRAR.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0xffeaaaabffeaaaabULL, 0xffeaaaabffeaaaabULL, },
+ { 0xfffffd55fffffd55ULL, 0xfffffd55fffffd55ULL, },
+ { 0xfffaaaabfffaaaabULL, 0xfffaaaabfffaaaabULL, },
+ { 0xfffff555fffff555ULL, 0xfffff555fffff555ULL, },
+ { 0xf5555555fffeaaabULL, 0xffffffabf5555555ULL, },
+ { 0xfffffffbffffd555ULL, 0xff555555fffffffbULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015555500155555ULL, 0x0015555500155555ULL, },
+ { 0x000002ab000002abULL, 0x000002ab000002abULL, },
+ { 0x0005555500055555ULL, 0x0005555500055555ULL, },
+ { 0x00000aab00000aabULL, 0x00000aab00000aabULL, },
+ { 0x0aaaaaab00015555ULL, 0x000000550aaaaaabULL, },
+ { 0x0000000500002aabULL, 0x00aaaaab00000005ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0xfff33333fff33333ULL, 0xfff33333fff33333ULL, },
+ { 0xfffffe66fffffe66ULL, 0xfffffe66fffffe66ULL, },
+ { 0xfffccccdfffccccdULL, 0xfffccccdfffccccdULL, },
+ { 0xfffff99afffff99aULL, 0xfffff99afffff99aULL, },
+ { 0xf999999affff3333ULL, 0xffffffcdf999999aULL, },
+ { 0xfffffffdffffe666ULL, 0xff99999afffffffdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000ccccd000ccccdULL, 0x000ccccd000ccccdULL, },
+ { 0x0000019a0000019aULL, 0x0000019a0000019aULL, },
+ { 0x0003333300033333ULL, 0x0003333300033333ULL, },
+ { 0x0000066600000666ULL, 0x0000066600000666ULL, },
+ { 0x066666660000cccdULL, 0x0000003306666666ULL, },
+ { 0x000000030000199aULL, 0x0066666600000003ULL, },
+ { 0x00000000ffffffffULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0xfff8e38effe38e39ULL, 0x000e38e4fff8e38eULL, },
+ { 0xffffff1cfffffc72ULL, 0x000001c7ffffff1cULL, },
+ { 0xfffe38e4fff8e38eULL, 0x00038e39fffe38e4ULL, },
+ { 0xfffffc72fffff1c7ULL, 0x0000071cfffffc72ULL, },
+ { 0xfc71c71cfffe38e4ULL, 0x00000039fc71c71cULL, },
+ { 0xfffffffeffffc71cULL, 0x0071c71cfffffffeULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00071c72001c71c7ULL, 0xfff1c71c00071c72ULL, },
+ { 0x000000e40000038eULL, 0xfffffe39000000e4ULL, },
+ { 0x0001c71c00071c72ULL, 0xfffc71c70001c71cULL, },
+ { 0x0000038e00000e39ULL, 0xfffff8e40000038eULL, },
+ { 0x038e38e40001c71cULL, 0xffffffc7038e38e4ULL, },
+ { 0x00000002000038e4ULL, 0xff8e38e400000002ULL, },
+ { 0xfff886ae28625540ULL, 0x00000001ffffe7bbULL, }, /* 64 */
+ { 0xf10d5cda00286255ULL, 0x0000001300000000ULL, },
+ { 0xffe21aba28625540ULL, 0x00000001ffffffe8ULL, },
+ { 0xfffc43570000a189ULL, 0x0000004bfe7bb00cULL, },
+ { 0xffffbbe04d93c708ULL, 0x00000000000153f5ULL, },
+ { 0xff77c00c004d93c7ULL, 0x0000000500000001ULL, },
+ { 0xfffeef804d93c708ULL, 0x0000000000000154ULL, },
+ { 0xffffddf00001364fULL, 0x00000013153f52fcULL, },
+ { 0xfffac5abb9cf8b80ULL, 0x00000001fffab2b2ULL, }, /* 72 */
+ { 0xf58b55d5ffb9cf8cULL, 0x0000000afffffffbULL, },
+ { 0xffeb16acb9cf8b80ULL, 0x00000000fffffab3ULL, },
+ { 0xfffd62d5fffee73eULL, 0x00000028ab2b2514ULL, },
+ { 0x000704f15e31e24eULL, 0xfffffffefffa942eULL, },
+ { 0x0e09e2ca005e31e2ULL, 0xffffffe3fffffffbULL, },
+ { 0x001c13c65e31e24eULL, 0xfffffffffffffa94ULL, },
+ { 0x00038279000178c8ULL, 0xffffff8ea942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRAR_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_b.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_b.c
new file mode 100644
index 0000000000..0e7c453cec
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRL.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRL.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x3f3f3f3f3f3f3f3fULL, 0x3f3f3f3f3f3f3f3fULL, },
+ { 0x0707070707070707ULL, 0x0707070707070707ULL, },
+ { 0x0f0f0f0f0f0f0f0fULL, 0x0f0f0f0f0f0f0f0fULL, },
+ { 0x1f1f1f1f1f1f1f1fULL, 0x1f1f1f1f1f1f1f1fULL, },
+ { 0x1f03ff1f03ff1f03ULL, 0xff1f03ff1f03ff1fULL, },
+ { 0x0f7f010f7f010f7fULL, 0x010f7f010f7f010fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2a2a2a2a2a2a2a2aULL, 0x2a2a2a2a2a2a2a2aULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0a0a0a0a0a0a0a0aULL, 0x0a0a0a0a0a0a0a0aULL, },
+ { 0x1515151515151515ULL, 0x1515151515151515ULL, },
+ { 0x1502aa1502aa1502ULL, 0xaa1502aa1502aa15ULL, },
+ { 0x0a55010a55010a55ULL, 0x010a55010a55010aULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1515151515151515ULL, 0x1515151515151515ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0a0a0a0a0a0a0a0aULL, 0x0a0a0a0a0a0a0a0aULL, },
+ { 0x0a01550a01550a01ULL, 0x550a01550a01550aULL, },
+ { 0x052a00052a00052aULL, 0x00052a00052a0005ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0x0c0c0c0c0c0c0c0cULL, 0x0c0c0c0c0c0c0c0cULL, },
+ { 0x1919191919191919ULL, 0x1919191919191919ULL, },
+ { 0x1903cc1903cc1903ULL, 0xcc1903cc1903cc19ULL, },
+ { 0x0c66010c66010c66ULL, 0x010c66010c66010cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0c0c0c0c0c0c0c0cULL, 0x0c0c0c0c0c0c0c0cULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0x0600330600330600ULL, 0x3306003306003306ULL, },
+ { 0x0319000319000319ULL, 0x0003190003190003ULL, },
+ { 0x0101000101000101ULL, 0x0001010001010001ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x38230e38230e3823ULL, 0x0e38230e38230e38ULL, },
+ { 0x0704010704010704ULL, 0x0107040107040107ULL, },
+ { 0x0e08030e08030e08ULL, 0x030e08030e08030eULL, },
+ { 0x1c11071c11071c11ULL, 0x071c11071c11071cULL, },
+ { 0x1c02381c02381c02ULL, 0x381c02381c02381cULL, },
+ { 0x0e47000e47000e47ULL, 0x000e47000e47000eULL, },
+ { 0x0000010000010000ULL, 0x0100000100000100ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x071c31071c31071cULL, 0x31071c31071c3107ULL, },
+ { 0x0003060003060003ULL, 0x0600030600030600ULL, },
+ { 0x01070c01070c0107ULL, 0x0c01070c01070c01ULL, },
+ { 0x030e18030e18030eULL, 0x18030e18030e1803ULL, },
+ { 0x0301c70301c70301ULL, 0xc70301c70301c703ULL, },
+ { 0x0138010138010138ULL, 0x0101380101380101ULL, },
+ { 0x881a030c28180240ULL, 0x09000101030fb000ULL, }, /* 64 */
+ { 0x1101e619010c0040ULL, 0x1200011707002c00ULL, },
+ { 0x081a033314000a40ULL, 0x006700001f0f0500ULL, },
+ { 0x8800030600311501ULL, 0x02330b5e7f1e2c0cULL, },
+ { 0xfb2f00064d240608ULL, 0x020117000007520fULL, },
+ { 0x1f02000c02120108ULL, 0x040117060000140fULL, },
+ { 0x0f2f001826011808ULL, 0x00f702000207020fULL, },
+ { 0xfb01000301493100ULL, 0x007bbb1a0a0f14fcULL, },
+ { 0xac16020ab9330480ULL, 0x0401180302052501ULL, }, /* 72 */
+ { 0x1501ae1505190180ULL, 0x0901183f05000901ULL, },
+ { 0x0a16022a5c011180ULL, 0x00d8030115050101ULL, },
+ { 0xac00020502672202ULL, 0x016cc6ff550a0914ULL, },
+ { 0x701300045e0c074eULL, 0x110111030208e20aULL, },
+ { 0x0e0116090206014eULL, 0x230111360500380aULL, },
+ { 0x071300132f001c4eULL, 0x01f102011508070aULL, },
+ { 0x7000000201183801ULL, 0x047888d8541038a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_d.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_d.c
new file mode 100644
index 0000000000..f6351f875a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRL.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRL.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x00000000003fffffULL, 0x00000000003fffffULL, },
+ { 0x000007ffffffffffULL, 0x000007ffffffffffULL, },
+ { 0x000fffffffffffffULL, 0x000fffffffffffffULL, },
+ { 0x0000000000001fffULL, 0x0000000000001fffULL, },
+ { 0x0003ffffffffffffULL, 0x000000001fffffffULL, },
+ { 0x0000000000007fffULL, 0x0000000fffffffffULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x00000000002aaaaaULL, 0x00000000002aaaaaULL, },
+ { 0x0000055555555555ULL, 0x0000055555555555ULL, },
+ { 0x000aaaaaaaaaaaaaULL, 0x000aaaaaaaaaaaaaULL, },
+ { 0x0000000000001555ULL, 0x0000000000001555ULL, },
+ { 0x0002aaaaaaaaaaaaULL, 0x0000000015555555ULL, },
+ { 0x0000000000005555ULL, 0x0000000aaaaaaaaaULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000155555ULL, 0x0000000000155555ULL, },
+ { 0x000002aaaaaaaaaaULL, 0x000002aaaaaaaaaaULL, },
+ { 0x0005555555555555ULL, 0x0005555555555555ULL, },
+ { 0x0000000000000aaaULL, 0x0000000000000aaaULL, },
+ { 0x0001555555555555ULL, 0x000000000aaaaaaaULL, },
+ { 0x0000000000002aaaULL, 0x0000000555555555ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000333333ULL, 0x0000000000333333ULL, },
+ { 0x0000066666666666ULL, 0x0000066666666666ULL, },
+ { 0x000cccccccccccccULL, 0x000cccccccccccccULL, },
+ { 0x0000000000001999ULL, 0x0000000000001999ULL, },
+ { 0x0003333333333333ULL, 0x0000000019999999ULL, },
+ { 0x0000000000006666ULL, 0x0000000cccccccccULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x00000000000cccccULL, 0x00000000000cccccULL, },
+ { 0x0000019999999999ULL, 0x0000019999999999ULL, },
+ { 0x0003333333333333ULL, 0x0003333333333333ULL, },
+ { 0x0000000000000666ULL, 0x0000000000000666ULL, },
+ { 0x0000ccccccccccccULL, 0x0000000006666666ULL, },
+ { 0x0000000000001999ULL, 0x0000000333333333ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x000000000038e38eULL, 0x00000000000e38e3ULL, },
+ { 0x0000071c71c71c71ULL, 0x000001c71c71c71cULL, },
+ { 0x000e38e38e38e38eULL, 0x00038e38e38e38e3ULL, },
+ { 0x0000000000001c71ULL, 0x000000000000071cULL, },
+ { 0x00038e38e38e38e3ULL, 0x00000000071c71c7ULL, },
+ { 0x00000000000071c7ULL, 0x000000038e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000001ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000071c71ULL, 0x000000000031c71cULL, },
+ { 0x000000e38e38e38eULL, 0x00000638e38e38e3ULL, },
+ { 0x0001c71c71c71c71ULL, 0x000c71c71c71c71cULL, },
+ { 0x000000000000038eULL, 0x00000000000018e3ULL, },
+ { 0x000071c71c71c71cULL, 0x0000000018e38e38ULL, },
+ { 0x0000000000000e38ULL, 0x0000000c71c71c71ULL, },
+ { 0x886ae6cc28625540ULL, 0x0004b670b5efe7bbULL, }, /* 64 */
+ { 0x00886ae6cc286255ULL, 0x0000000000000004ULL, },
+ { 0x886ae6cc28625540ULL, 0x000004b670b5efe7ULL, },
+ { 0x000221ab9b30a189ULL, 0x000000004b670b5eULL, },
+ { 0xfbbe00634d93c708ULL, 0x00012f7bb1a153f5ULL, },
+ { 0x00fbbe00634d93c7ULL, 0x0000000000000001ULL, },
+ { 0xfbbe00634d93c708ULL, 0x0000012f7bb1a153ULL, },
+ { 0x0003eef8018d364fULL, 0x0000000012f7bb1aULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x00027d8c6ffab2b2ULL, }, /* 72 */
+ { 0x00ac5aaeaab9cf8bULL, 0x0000000000000002ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x0000027d8c6ffab2ULL, },
+ { 0x0002b16abaaae73eULL, 0x0000000027d8c6ffULL, },
+ { 0x704f164d5e31e24eULL, 0x0008df188d8a942eULL, },
+ { 0x00704f164d5e31e2ULL, 0x0000000000000008ULL, },
+ { 0x704f164d5e31e24eULL, 0x000008df188d8a94ULL, },
+ { 0x0001c13c593578c7ULL, 0x000000008df188d8ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_h.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_h.c
new file mode 100644
index 0000000000..93394ef47a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRL.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRL.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x003f003f003f003fULL, 0x003f003f003f003fULL, },
+ { 0x07ff07ff07ff07ffULL, 0x07ff07ff07ff07ffULL, },
+ { 0x000f000f000f000fULL, 0x000f000f000f000fULL, },
+ { 0x1fff1fff1fff1fffULL, 0x1fff1fff1fff1fffULL, },
+ { 0x00031fff00ff0003ULL, 0x1fff00ff00031fffULL, },
+ { 0x7fff000f01ff7fffULL, 0x000f01ff7fff000fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x002a002a002a002aULL, 0x002a002a002a002aULL, },
+ { 0x0555055505550555ULL, 0x0555055505550555ULL, },
+ { 0x000a000a000a000aULL, 0x000a000a000a000aULL, },
+ { 0x1555155515551555ULL, 0x1555155515551555ULL, },
+ { 0x0002155500aa0002ULL, 0x155500aa00021555ULL, },
+ { 0x5555000a01555555ULL, 0x000a01555555000aULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015001500150015ULL, 0x0015001500150015ULL, },
+ { 0x02aa02aa02aa02aaULL, 0x02aa02aa02aa02aaULL, },
+ { 0x0005000500050005ULL, 0x0005000500050005ULL, },
+ { 0x0aaa0aaa0aaa0aaaULL, 0x0aaa0aaa0aaa0aaaULL, },
+ { 0x00010aaa00550001ULL, 0x0aaa005500010aaaULL, },
+ { 0x2aaa000500aa2aaaULL, 0x000500aa2aaa0005ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x0666066606660666ULL, 0x0666066606660666ULL, },
+ { 0x000c000c000c000cULL, 0x000c000c000c000cULL, },
+ { 0x1999199919991999ULL, 0x1999199919991999ULL, },
+ { 0x0003199900cc0003ULL, 0x199900cc00031999ULL, },
+ { 0x6666000c01996666ULL, 0x000c01996666000cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000c000c000c000cULL, 0x000c000c000c000cULL, },
+ { 0x0199019901990199ULL, 0x0199019901990199ULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x0666066606660666ULL, 0x0666066606660666ULL, },
+ { 0x0000066600330000ULL, 0x0666003300000666ULL, },
+ { 0x1999000300661999ULL, 0x0003006619990003ULL, },
+ { 0x0001000000010001ULL, 0x0000000100010000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0038000e00230038ULL, 0x000e00230038000eULL, },
+ { 0x071c01c70471071cULL, 0x01c70471071c01c7ULL, },
+ { 0x000e00030008000eULL, 0x00030008000e0003ULL, },
+ { 0x1c71071c11c71c71ULL, 0x071c11c71c71071cULL, },
+ { 0x0003071c008e0003ULL, 0x071c008e0003071cULL, },
+ { 0x71c70003011c71c7ULL, 0x0003011c71c70003ULL, },
+ { 0x0000000100000000ULL, 0x0001000000000001ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00070031001c0007ULL, 0x0031001c00070031ULL, },
+ { 0x00e30638038e00e3ULL, 0x0638038e00e30638ULL, },
+ { 0x0001000c00070001ULL, 0x000c00070001000cULL, },
+ { 0x038e18e30e38038eULL, 0x18e30e38038e18e3ULL, },
+ { 0x000018e300710000ULL, 0x18e30071000018e3ULL, },
+ { 0x0e38000c00e30e38ULL, 0x000c00e30e38000cULL, },
+ { 0x0022000e0a185540ULL, 0x00960000001f000bULL, }, /* 64 */
+ { 0x00021cd9050c0055ULL, 0x009600020001000bULL, },
+ { 0x0022003900005540ULL, 0x004b0000001f0b00ULL, },
+ { 0x0001000714310001ULL, 0x25b3000b3f9eb00cULL, },
+ { 0x003e00001364c708ULL, 0x0025000200020005ULL, },
+ { 0x0003000c09b200c7ULL, 0x0025002e00000005ULL, },
+ { 0x003e00000000c708ULL, 0x001200010002052fULL, },
+ { 0x0001000026c90003ULL, 0x097b00bb054f52fcULL, },
+ { 0x002b000a2e738b80ULL, 0x004f000300150002ULL, }, /* 72 */
+ { 0x000215d51739008bULL, 0x004f003100010002ULL, },
+ { 0x002b002b00018b80ULL, 0x0027000100150251ULL, },
+ { 0x000100055ce70002ULL, 0x13ec00c62aca2514ULL, },
+ { 0x001c0001178ce24eULL, 0x011b00020015000eULL, },
+ { 0x000102c90bc600e2ULL, 0x011b00220001000eULL, },
+ { 0x001c00050000e24eULL, 0x008d000100150e2aULL, },
+ { 0x000000002f180003ULL, 0x46f800882a50e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_w.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_w.c
new file mode 100644
index 0000000000..c18cd9892a
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srl_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRL.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRL.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x003fffff003fffffULL, 0x003fffff003fffffULL, },
+ { 0x000007ff000007ffULL, 0x000007ff000007ffULL, },
+ { 0x000fffff000fffffULL, 0x000fffff000fffffULL, },
+ { 0x00001fff00001fffULL, 0x00001fff00001fffULL, },
+ { 0x1fffffff0003ffffULL, 0x000000ff1fffffffULL, },
+ { 0x0000000f00007fffULL, 0x01ffffff0000000fULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x002aaaaa002aaaaaULL, 0x002aaaaa002aaaaaULL, },
+ { 0x0000055500000555ULL, 0x0000055500000555ULL, },
+ { 0x000aaaaa000aaaaaULL, 0x000aaaaa000aaaaaULL, },
+ { 0x0000155500001555ULL, 0x0000155500001555ULL, },
+ { 0x155555550002aaaaULL, 0x000000aa15555555ULL, },
+ { 0x0000000a00005555ULL, 0x015555550000000aULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015555500155555ULL, 0x0015555500155555ULL, },
+ { 0x000002aa000002aaULL, 0x000002aa000002aaULL, },
+ { 0x0005555500055555ULL, 0x0005555500055555ULL, },
+ { 0x00000aaa00000aaaULL, 0x00000aaa00000aaaULL, },
+ { 0x0aaaaaaa00015555ULL, 0x000000550aaaaaaaULL, },
+ { 0x0000000500002aaaULL, 0x00aaaaaa00000005ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0033333300333333ULL, 0x0033333300333333ULL, },
+ { 0x0000066600000666ULL, 0x0000066600000666ULL, },
+ { 0x000ccccc000cccccULL, 0x000ccccc000cccccULL, },
+ { 0x0000199900001999ULL, 0x0000199900001999ULL, },
+ { 0x1999999900033333ULL, 0x000000cc19999999ULL, },
+ { 0x0000000c00006666ULL, 0x019999990000000cULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000ccccc000cccccULL, 0x000ccccc000cccccULL, },
+ { 0x0000019900000199ULL, 0x0000019900000199ULL, },
+ { 0x0003333300033333ULL, 0x0003333300033333ULL, },
+ { 0x0000066600000666ULL, 0x0000066600000666ULL, },
+ { 0x066666660000ccccULL, 0x0000003306666666ULL, },
+ { 0x0000000300001999ULL, 0x0066666600000003ULL, },
+ { 0x0000000100000001ULL, 0x0000000000000001ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0038e38e00238e38ULL, 0x000e38e30038e38eULL, },
+ { 0x0000071c00000471ULL, 0x000001c70000071cULL, },
+ { 0x000e38e30008e38eULL, 0x00038e38000e38e3ULL, },
+ { 0x00001c71000011c7ULL, 0x0000071c00001c71ULL, },
+ { 0x1c71c71c000238e3ULL, 0x000000381c71c71cULL, },
+ { 0x0000000e0000471cULL, 0x0071c71c0000000eULL, },
+ { 0x0000000000000000ULL, 0x0000000100000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00071c71001c71c7ULL, 0x0031c71c00071c71ULL, },
+ { 0x000000e30000038eULL, 0x00000638000000e3ULL, },
+ { 0x0001c71c00071c71ULL, 0x000c71c70001c71cULL, },
+ { 0x0000038e00000e38ULL, 0x000018e30000038eULL, },
+ { 0x038e38e30001c71cULL, 0x000000c7038e38e3ULL, },
+ { 0x00000001000038e3ULL, 0x018e38e300000001ULL, },
+ { 0x000886ae28625540ULL, 0x00000001000fe7bbULL, }, /* 64 */
+ { 0x110d5cd900286255ULL, 0x000000120000000fULL, },
+ { 0x00221ab928625540ULL, 0x0000000000000fe7ULL, },
+ { 0x000443570000a189ULL, 0x0000004bfe7bb00cULL, },
+ { 0x000fbbe04d93c708ULL, 0x00000000000153f5ULL, },
+ { 0x1f77c00c004d93c7ULL, 0x0000000400000001ULL, },
+ { 0x003eef804d93c708ULL, 0x0000000000000153ULL, },
+ { 0x0007ddf00001364fULL, 0x00000012153f52fcULL, },
+ { 0x000ac5aab9cf8b80ULL, 0x00000000000ab2b2ULL, }, /* 72 */
+ { 0x158b55d500b9cf8bULL, 0x000000090000000aULL, },
+ { 0x002b16abb9cf8b80ULL, 0x0000000000000ab2ULL, },
+ { 0x000562d50002e73eULL, 0x00000027ab2b2514ULL, },
+ { 0x000704f15e31e24eULL, 0x00000002000a942eULL, },
+ { 0x0e09e2c9005e31e2ULL, 0x000000230000000aULL, },
+ { 0x001c13c55e31e24eULL, 0x0000000100000a94ULL, },
+ { 0x00038278000178c7ULL, 0x0000008da942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRL_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_b.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_b.c
new file mode 100644
index 0000000000..d173d8fa9c
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_b.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRLR.B
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRLR.B";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x4040404040404040ULL, 0x4040404040404040ULL, },
+ { 0x0808080808080808ULL, 0x0808080808080808ULL, },
+ { 0x1010101010101010ULL, 0x1010101010101010ULL, },
+ { 0x2020202020202020ULL, 0x2020202020202020ULL, },
+ { 0x2004ff2004ff2004ULL, 0xff2004ff2004ff20ULL, },
+ { 0x1080021080021080ULL, 0x0210800210800210ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x2b2b2b2b2b2b2b2bULL, 0x2b2b2b2b2b2b2b2bULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0b0b0b0b0b0b0b0bULL, 0x0b0b0b0b0b0b0b0bULL, },
+ { 0x1515151515151515ULL, 0x1515151515151515ULL, },
+ { 0x1503aa1503aa1503ULL, 0xaa1503aa1503aa15ULL, },
+ { 0x0b55010b55010b55ULL, 0x010b55010b55010bULL, },
+ { 0x0101010101010101ULL, 0x0101010101010101ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x1515151515151515ULL, 0x1515151515151515ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0505050505050505ULL, 0x0505050505050505ULL, },
+ { 0x0b0b0b0b0b0b0b0bULL, 0x0b0b0b0b0b0b0b0bULL, },
+ { 0x0b01550b01550b01ULL, 0x550b01550b01550bULL, },
+ { 0x052b01052b01052bULL, 0x01052b01052b0105ULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0x0d0d0d0d0d0d0d0dULL, 0x0d0d0d0d0d0d0d0dULL, },
+ { 0x1a1a1a1a1a1a1a1aULL, 0x1a1a1a1a1a1a1a1aULL, },
+ { 0x1a03cc1a03cc1a03ULL, 0xcc1a03cc1a03cc1aULL, },
+ { 0x0d66020d66020d66ULL, 0x020d66020d66020dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x0d0d0d0d0d0d0d0dULL, 0x0d0d0d0d0d0d0d0dULL, },
+ { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+ { 0x0303030303030303ULL, 0x0303030303030303ULL, },
+ { 0x0606060606060606ULL, 0x0606060606060606ULL, },
+ { 0x0601330601330601ULL, 0x3306013306013306ULL, },
+ { 0x031a00031a00031aULL, 0x00031a00031a0003ULL, },
+ { 0x0201000201000201ULL, 0x0002010002010002ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x39240e39240e3924ULL, 0x0e39240e39240e39ULL, },
+ { 0x0704020704020704ULL, 0x0207040207040207ULL, },
+ { 0x0e09040e09040e09ULL, 0x040e09040e09040eULL, },
+ { 0x1c12071c12071c12ULL, 0x071c12071c12071cULL, },
+ { 0x1c02381c02381c02ULL, 0x381c02381c02381cULL, },
+ { 0x0e47000e47000e47ULL, 0x000e47000e47000eULL, },
+ { 0x0001020001020001ULL, 0x0200010200010200ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x071c32071c32071cULL, 0x32071c32071c3207ULL, },
+ { 0x0104060104060104ULL, 0x0601040601040601ULL, },
+ { 0x02070c02070c0207ULL, 0x0c02070c02070c02ULL, },
+ { 0x040e19040e19040eULL, 0x19040e19040e1904ULL, },
+ { 0x0402c70402c70402ULL, 0xc70402c70402c704ULL, },
+ { 0x0239020239020239ULL, 0x0202390202390202ULL, },
+ { 0x881b040d28190340ULL, 0x09010101040fb001ULL, }, /* 64 */
+ { 0x1102e61a010c0140ULL, 0x1301011808012c01ULL, },
+ { 0x091b043314010b40ULL, 0x01670001200f0601ULL, },
+ { 0x8801040601311501ULL, 0x02340b5e7f1f2c0cULL, },
+ { 0xfb3000064d250608ULL, 0x0202170000085210ULL, },
+ { 0x1f03000c02120208ULL, 0x0502170701001510ULL, },
+ { 0x1030001927011908ULL, 0x00f7030003080310ULL, },
+ { 0xfb010003014a3200ULL, 0x017cbb1a0b1015fcULL, },
+ { 0xac17030bb9340480ULL, 0x0502190403052501ULL, }, /* 72 */
+ { 0x1601ae15061a0180ULL, 0x0a02194005000901ULL, },
+ { 0x0b17032b5d021180ULL, 0x00d8030215050101ULL, },
+ { 0xac01030503682302ULL, 0x016cc6ff560b0914ULL, },
+ { 0x701400055e0c074eULL, 0x120211030308e20aULL, },
+ { 0x0e01160a0306024eULL, 0x230211360501390aULL, },
+ { 0x071400132f001c4eULL, 0x01f102021508070aULL, },
+ { 0x7001000201193901ULL, 0x047988d8551139a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_B(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_B(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_d.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_d.c
new file mode 100644
index 0000000000..ecd7bd0c22
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_d.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRLR.D
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRLR.D";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0000000000400000ULL, 0x0000000000400000ULL, },
+ { 0x0000080000000000ULL, 0x0000080000000000ULL, },
+ { 0x0010000000000000ULL, 0x0010000000000000ULL, },
+ { 0x0000000000002000ULL, 0x0000000000002000ULL, },
+ { 0x0004000000000000ULL, 0x0000000020000000ULL, },
+ { 0x0000000000008000ULL, 0x0000001000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x00000000002aaaabULL, 0x00000000002aaaabULL, },
+ { 0x0000055555555555ULL, 0x0000055555555555ULL, },
+ { 0x000aaaaaaaaaaaabULL, 0x000aaaaaaaaaaaabULL, },
+ { 0x0000000000001555ULL, 0x0000000000001555ULL, },
+ { 0x0002aaaaaaaaaaabULL, 0x0000000015555555ULL, },
+ { 0x0000000000005555ULL, 0x0000000aaaaaaaabULL, },
+ { 0x0000000000000001ULL, 0x0000000000000001ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0000000000155555ULL, 0x0000000000155555ULL, },
+ { 0x000002aaaaaaaaabULL, 0x000002aaaaaaaaabULL, },
+ { 0x0005555555555555ULL, 0x0005555555555555ULL, },
+ { 0x0000000000000aabULL, 0x0000000000000aabULL, },
+ { 0x0001555555555555ULL, 0x000000000aaaaaabULL, },
+ { 0x0000000000002aabULL, 0x0000000555555555ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000002ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0000000000333333ULL, 0x0000000000333333ULL, },
+ { 0x0000066666666666ULL, 0x0000066666666666ULL, },
+ { 0x000ccccccccccccdULL, 0x000ccccccccccccdULL, },
+ { 0x000000000000199aULL, 0x000000000000199aULL, },
+ { 0x0003333333333333ULL, 0x000000001999999aULL, },
+ { 0x0000000000006666ULL, 0x0000000ccccccccdULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x00000000000ccccdULL, 0x00000000000ccccdULL, },
+ { 0x000001999999999aULL, 0x000001999999999aULL, },
+ { 0x0003333333333333ULL, 0x0003333333333333ULL, },
+ { 0x0000000000000666ULL, 0x0000000000000666ULL, },
+ { 0x0000cccccccccccdULL, 0x0000000006666666ULL, },
+ { 0x000000000000199aULL, 0x0000000333333333ULL, },
+ { 0x0000000000000002ULL, 0x0000000000000000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x000000000038e38eULL, 0x00000000000e38e4ULL, },
+ { 0x0000071c71c71c72ULL, 0x000001c71c71c71cULL, },
+ { 0x000e38e38e38e38eULL, 0x00038e38e38e38e4ULL, },
+ { 0x0000000000001c72ULL, 0x000000000000071cULL, },
+ { 0x00038e38e38e38e4ULL, 0x00000000071c71c7ULL, },
+ { 0x00000000000071c7ULL, 0x000000038e38e38eULL, },
+ { 0x0000000000000000ULL, 0x0000000000000002ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x0000000000071c72ULL, 0x000000000031c71cULL, },
+ { 0x000000e38e38e38eULL, 0x00000638e38e38e4ULL, },
+ { 0x0001c71c71c71c72ULL, 0x000c71c71c71c71cULL, },
+ { 0x000000000000038eULL, 0x00000000000018e4ULL, },
+ { 0x000071c71c71c71cULL, 0x0000000018e38e39ULL, },
+ { 0x0000000000000e39ULL, 0x0000000c71c71c72ULL, },
+ { 0x886ae6cc28625540ULL, 0x0004b670b5efe7bbULL, }, /* 64 */
+ { 0x00886ae6cc286255ULL, 0x0000000000000005ULL, },
+ { 0x886ae6cc28625540ULL, 0x000004b670b5efe8ULL, },
+ { 0x000221ab9b30a189ULL, 0x000000004b670b5fULL, },
+ { 0xfbbe00634d93c708ULL, 0x00012f7bb1a153f5ULL, },
+ { 0x00fbbe00634d93c7ULL, 0x0000000000000001ULL, },
+ { 0xfbbe00634d93c708ULL, 0x0000012f7bb1a154ULL, },
+ { 0x0003eef8018d364fULL, 0x0000000012f7bb1aULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x00027d8c6ffab2b2ULL, }, /* 72 */
+ { 0x00ac5aaeaab9cf8cULL, 0x0000000000000002ULL, },
+ { 0xac5aaeaab9cf8b80ULL, 0x0000027d8c6ffab3ULL, },
+ { 0x0002b16abaaae73eULL, 0x0000000027d8c700ULL, },
+ { 0x704f164d5e31e24eULL, 0x0008df188d8a942eULL, },
+ { 0x00704f164d5e31e2ULL, 0x0000000000000009ULL, },
+ { 0x704f164d5e31e24eULL, 0x000008df188d8a94ULL, },
+ { 0x0001c13c593578c8ULL, 0x000000008df188d9ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_D(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_D(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_h.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_h.c
new file mode 100644
index 0000000000..ca7fd75342
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_h.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRLR.H
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRLR.H";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0040004000400040ULL, 0x0040004000400040ULL, },
+ { 0x0800080008000800ULL, 0x0800080008000800ULL, },
+ { 0x0010001000100010ULL, 0x0010001000100010ULL, },
+ { 0x2000200020002000ULL, 0x2000200020002000ULL, },
+ { 0x0004200001000004ULL, 0x2000010000042000ULL, },
+ { 0x8000001002008000ULL, 0x0010020080000010ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x002b002b002b002bULL, 0x002b002b002b002bULL, },
+ { 0x0555055505550555ULL, 0x0555055505550555ULL, },
+ { 0x000b000b000b000bULL, 0x000b000b000b000bULL, },
+ { 0x1555155515551555ULL, 0x1555155515551555ULL, },
+ { 0x0003155500ab0003ULL, 0x155500ab00031555ULL, },
+ { 0x5555000b01555555ULL, 0x000b01555555000bULL, },
+ { 0x0001000100010001ULL, 0x0001000100010001ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015001500150015ULL, 0x0015001500150015ULL, },
+ { 0x02ab02ab02ab02abULL, 0x02ab02ab02ab02abULL, },
+ { 0x0005000500050005ULL, 0x0005000500050005ULL, },
+ { 0x0aab0aab0aab0aabULL, 0x0aab0aab0aab0aabULL, },
+ { 0x00010aab00550001ULL, 0x0aab005500010aabULL, },
+ { 0x2aab000500ab2aabULL, 0x000500ab2aab0005ULL, },
+ { 0x0002000200020002ULL, 0x0002000200020002ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+ { 0x0666066606660666ULL, 0x0666066606660666ULL, },
+ { 0x000d000d000d000dULL, 0x000d000d000d000dULL, },
+ { 0x199a199a199a199aULL, 0x199a199a199a199aULL, },
+ { 0x0003199a00cd0003ULL, 0x199a00cd0003199aULL, },
+ { 0x6666000d019a6666ULL, 0x000d019a6666000dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000d000d000d000dULL, 0x000d000d000d000dULL, },
+ { 0x019a019a019a019aULL, 0x019a019a019a019aULL, },
+ { 0x0003000300030003ULL, 0x0003000300030003ULL, },
+ { 0x0666066606660666ULL, 0x0666066606660666ULL, },
+ { 0x0001066600330001ULL, 0x0666003300010666ULL, },
+ { 0x199a00030066199aULL, 0x00030066199a0003ULL, },
+ { 0x0002000000010002ULL, 0x0000000100020000ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0039000e00240039ULL, 0x000e00240039000eULL, },
+ { 0x071c01c70472071cULL, 0x01c70472071c01c7ULL, },
+ { 0x000e00040009000eULL, 0x00040009000e0004ULL, },
+ { 0x1c72071c11c71c72ULL, 0x071c11c71c72071cULL, },
+ { 0x0004071c008e0004ULL, 0x071c008e0004071cULL, },
+ { 0x71c70004011c71c7ULL, 0x0004011c71c70004ULL, },
+ { 0x0000000200010000ULL, 0x0002000100000002ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00070032001c0007ULL, 0x0032001c00070032ULL, },
+ { 0x00e40639038e00e4ULL, 0x0639038e00e40639ULL, },
+ { 0x0002000c00070002ULL, 0x000c00070002000cULL, },
+ { 0x038e18e40e39038eULL, 0x18e40e39038e18e4ULL, },
+ { 0x000018e400720000ULL, 0x18e40072000018e4ULL, },
+ { 0x0e39000c00e40e39ULL, 0x000c00e40e39000cULL, },
+ { 0x0022000e0a195540ULL, 0x009700000020000bULL, }, /* 64 */
+ { 0x00021cda050c0055ULL, 0x009700030002000bULL, },
+ { 0x0022003a00005540ULL, 0x004b000000200b01ULL, },
+ { 0x0001000714310001ULL, 0x25b4000b3f9fb00cULL, },
+ { 0x003f00001365c708ULL, 0x0026000300030005ULL, },
+ { 0x0004000c09b200c7ULL, 0x0026002f00000005ULL, },
+ { 0x003f00000001c708ULL, 0x0013000100030530ULL, },
+ { 0x0002000026ca0003ULL, 0x097c00bb055052fcULL, },
+ { 0x002b000b2e748b80ULL, 0x0050000300150002ULL, }, /* 72 */
+ { 0x000315d5173a008cULL, 0x0050003200010002ULL, },
+ { 0x002b002c00018b80ULL, 0x0028000200150251ULL, },
+ { 0x000100055ce80002ULL, 0x13ec00c72acb2514ULL, },
+ { 0x001c0001178ce24eULL, 0x011c00020015000eULL, },
+ { 0x000202ca0bc600e2ULL, 0x011c00220001000eULL, },
+ { 0x001c00060001e24eULL, 0x008e000100150e2aULL, },
+ { 0x000100012f190004ULL, 0x46f900892a51e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_H(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_H(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_w.c b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_w.c
new file mode 100644
index 0000000000..ccbe6c0c84
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/shift/test_msa_srlr_w.c
@@ -0,0 +1,158 @@
+/*
+ * Test program for MSA instruction SRLR.W
+ *
+ * Copyright (C) 2019 Wave Computing, Inc.
+ * Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs_128.h"
+#include "../../../../include/test_utils_128.h"
+
+#define TEST_COUNT_TOTAL ( \
+ (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+ (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+ char *isa_ase_name = "MSA";
+ char *group_name = "Shift";
+ char *instruction_name = "SRLR.W";
+ int32_t ret;
+ uint32_t i, j;
+ struct timeval start, end;
+ double elapsed_time;
+
+ uint64_t b128_result[TEST_COUNT_TOTAL][2];
+ uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 0 */
+ { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
+ { 0x0040000000400000ULL, 0x0040000000400000ULL, },
+ { 0x0000080000000800ULL, 0x0000080000000800ULL, },
+ { 0x0010000000100000ULL, 0x0010000000100000ULL, },
+ { 0x0000200000002000ULL, 0x0000200000002000ULL, },
+ { 0x2000000000040000ULL, 0x0000010020000000ULL, },
+ { 0x0000001000008000ULL, 0x0200000000000010ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 16 */
+ { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+ { 0x002aaaab002aaaabULL, 0x002aaaab002aaaabULL, },
+ { 0x0000055500000555ULL, 0x0000055500000555ULL, },
+ { 0x000aaaab000aaaabULL, 0x000aaaab000aaaabULL, },
+ { 0x0000155500001555ULL, 0x0000155500001555ULL, },
+ { 0x155555550002aaabULL, 0x000000ab15555555ULL, },
+ { 0x0000000b00005555ULL, 0x015555550000000bULL, },
+ { 0x0000000100000001ULL, 0x0000000100000001ULL, }, /* 24 */
+ { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+ { 0x0015555500155555ULL, 0x0015555500155555ULL, },
+ { 0x000002ab000002abULL, 0x000002ab000002abULL, },
+ { 0x0005555500055555ULL, 0x0005555500055555ULL, },
+ { 0x00000aab00000aabULL, 0x00000aab00000aabULL, },
+ { 0x0aaaaaab00015555ULL, 0x000000550aaaaaabULL, },
+ { 0x0000000500002aabULL, 0x00aaaaab00000005ULL, },
+ { 0x0000000200000002ULL, 0x0000000200000002ULL, }, /* 32 */
+ { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+ { 0x0033333300333333ULL, 0x0033333300333333ULL, },
+ { 0x0000066600000666ULL, 0x0000066600000666ULL, },
+ { 0x000ccccd000ccccdULL, 0x000ccccd000ccccdULL, },
+ { 0x0000199a0000199aULL, 0x0000199a0000199aULL, },
+ { 0x1999999a00033333ULL, 0x000000cd1999999aULL, },
+ { 0x0000000d00006666ULL, 0x0199999a0000000dULL, },
+ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
+ { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+ { 0x000ccccd000ccccdULL, 0x000ccccd000ccccdULL, },
+ { 0x0000019a0000019aULL, 0x0000019a0000019aULL, },
+ { 0x0003333300033333ULL, 0x0003333300033333ULL, },
+ { 0x0000066600000666ULL, 0x0000066600000666ULL, },
+ { 0x066666660000cccdULL, 0x0000003306666666ULL, },
+ { 0x000000030000199aULL, 0x0066666600000003ULL, },
+ { 0x0000000200000001ULL, 0x0000000000000002ULL, }, /* 48 */
+ { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+ { 0x0038e38e00238e39ULL, 0x000e38e40038e38eULL, },
+ { 0x0000071c00000472ULL, 0x000001c70000071cULL, },
+ { 0x000e38e40008e38eULL, 0x00038e39000e38e4ULL, },
+ { 0x00001c72000011c7ULL, 0x0000071c00001c72ULL, },
+ { 0x1c71c71c000238e4ULL, 0x000000391c71c71cULL, },
+ { 0x0000000e0000471cULL, 0x0071c71c0000000eULL, },
+ { 0x0000000000000001ULL, 0x0000000200000000ULL, }, /* 56 */
+ { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+ { 0x00071c72001c71c7ULL, 0x0031c71c00071c72ULL, },
+ { 0x000000e40000038eULL, 0x00000639000000e4ULL, },
+ { 0x0001c71c00071c72ULL, 0x000c71c70001c71cULL, },
+ { 0x0000038e00000e39ULL, 0x000018e40000038eULL, },
+ { 0x038e38e40001c71cULL, 0x000000c7038e38e4ULL, },
+ { 0x00000002000038e4ULL, 0x018e38e400000002ULL, },
+ { 0x000886ae28625540ULL, 0x00000001000fe7bbULL, }, /* 64 */
+ { 0x110d5cda00286255ULL, 0x0000001300000010ULL, },
+ { 0x00221aba28625540ULL, 0x0000000100000fe8ULL, },
+ { 0x000443570000a189ULL, 0x0000004bfe7bb00cULL, },
+ { 0x000fbbe04d93c708ULL, 0x00000000000153f5ULL, },
+ { 0x1f77c00c004d93c7ULL, 0x0000000500000001ULL, },
+ { 0x003eef804d93c708ULL, 0x0000000000000154ULL, },
+ { 0x0007ddf00001364fULL, 0x00000013153f52fcULL, },
+ { 0x000ac5abb9cf8b80ULL, 0x00000001000ab2b2ULL, }, /* 72 */
+ { 0x158b55d500b9cf8cULL, 0x0000000a0000000bULL, },
+ { 0x002b16acb9cf8b80ULL, 0x0000000000000ab3ULL, },
+ { 0x000562d50002e73eULL, 0x00000028ab2b2514ULL, },
+ { 0x000704f15e31e24eULL, 0x00000002000a942eULL, },
+ { 0x0e09e2ca005e31e2ULL, 0x000000230000000bULL, },
+ { 0x001c13c65e31e24eULL, 0x0000000100000a94ULL, },
+ { 0x00038279000178c8ULL, 0x0000008ea942e2a0ULL, },
+ };
+
+ reset_msa_registers();
+
+ gettimeofday(&start, NULL);
+
+ for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_W(b128_pattern[i], b128_pattern[j],
+ b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+ for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+ do_msa_SRLR_W(b128_random[i], b128_random[j],
+ b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+ (PATTERN_INPUTS_SHORT_COUNT)) +
+ RANDOM_INPUTS_SHORT_COUNT * i + j]);
+ }
+ }
+
+ gettimeofday(&end, NULL);
+
+ elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+ elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+ ret = check_results_128(isa_ase_name, group_name, instruction_name,
+ TEST_COUNT_TOTAL, elapsed_time,
+ &b128_result[0][0], &b128_expect[0][0]);
+
+ return ret;
+}
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_compile_32r5eb.sh b/tests/tcg/mips/user/ase/msa/test_msa_compile_32r5eb.sh
new file mode 100755
index 0000000000..940cabe4d8
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_compile_32r5eb.sh
@@ -0,0 +1,917 @@
+
+#
+# Bit Count
+# ---------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_d_32r5eb
+
+#
+# Bit move
+# --------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_bmnz_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bmnz_v_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_bmz_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bmz_v_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_bsel_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bsel_v_32r5eb
+
+#
+# Bit Set
+# -------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_d_32r5eb
+
+#
+# Fixed Multiply
+# --------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_madd_q_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_madd_q_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddr_q_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddr_q_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msub_q_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msub_q_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubr_q_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubr_q_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mul_q_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mul_q_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulr_q_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulr_q_w_32r5eb
+
+#
+# Float Max Min
+# -------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_a_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_a_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_a_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_a_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_a_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_a_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_a_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_a_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_d_32r5eb
+
+#
+# Int Add
+# -------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_u_d_32r5eb
+
+#
+# Int Average
+# -----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_d_32r5eb
+
+#
+# Int Compare
+# -----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_d_32r5eb
+
+#
+# Int Divide
+# ----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_d_32r5eb
+
+#
+# Int Dot Product
+# ---------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_u_d_32r5eb
+
+#
+# Int Max Min
+# -----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_d_32r5eb
+
+#
+# Int Modulo
+# ----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_d_32r5eb
+
+#
+# Int Multiply
+# ------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_d_32r5eb
+
+#
+# Int Subtract
+# ------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_d_32r5eb
+
+#
+# Interleave
+# ----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_d_32r5eb
+
+#
+# Logic
+# -----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_and_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_and_v_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_nor_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nor_v_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_or_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_or_v_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_xor_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_xor_v_32r5eb
+
+#
+# Move
+# ----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc move/test_msa_move_v.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_move_v_32r5eb
+
+#
+# Pack
+# ----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_d_32r5eb
+
+#
+# Shift
+# -----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_d_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_b.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_b_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_h.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_h_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_w.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_w_32r5eb
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_d.c \
+-EB -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_d_32r5eb
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_compile_32r5el.sh b/tests/tcg/mips/user/ase/msa/test_msa_compile_32r5el.sh
new file mode 100755
index 0000000000..048b30b8d7
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_compile_32r5el.sh
@@ -0,0 +1,917 @@
+
+#
+# Bit Count
+# ---------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nloc_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nloc_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_nlzc_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nlzc_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-count/test_msa_pcnt_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pcnt_d_32r5el
+
+#
+# Bit move
+# --------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsl_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsl_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_binsr_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_binsr_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_bmnz_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bmnz_v_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_bmz_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bmz_v_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-move/test_msa_bsel_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bsel_v_32r5el
+
+#
+# Bit Set
+# -------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bclr_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bclr_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bneg_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bneg_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc bit-set/test_msa_bset_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_bset_d_32r5el
+
+#
+# Fixed Multiply
+# --------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_madd_q_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_madd_q_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddr_q_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddr_q_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msub_q_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msub_q_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubr_q_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubr_q_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mul_q_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mul_q_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulr_q_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulr_q_w_32r5el
+
+#
+# Float Max Min
+# -------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_a_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_a_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_a_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_a_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmax_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmax_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_a_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_a_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_a_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_a_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc float-max-min/test_msa_fmin_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_fmin_d_32r5el
+
+#
+# Int Add
+# -------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_add_a_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_add_a_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_a_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_a_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_adds_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_adds_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_addv_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_addv_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-add/test_msa_hadd_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hadd_u_d_32r5el
+
+#
+# Int Average
+# -----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_ave_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ave_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-average/test_msa_aver_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_aver_u_d_32r5el
+
+#
+# Int Compare
+# -----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_ceq_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ceq_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_cle_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_cle_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-compare/test_msa_clt_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_clt_u_d_32r5el
+
+#
+# Int Divide
+# ----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-divide/test_msa_div_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_div_u_d_32r5el
+
+#
+# Int Dot Product
+# ---------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dotp_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dotp_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpadd_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_dpsub_u_d_32r5el
+
+#
+# Int Max Min
+# -----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_a_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_a_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_max_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_max_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_a_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_a_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-max-min/test_msa_min_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_min_u_d_32r5el
+
+#
+# Int Modulo
+# ----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-modulo/test_msa_mod_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mod_u_d_32r5el
+
+#
+# Int Multiply
+# ------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_maddv_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_maddv_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_msubv_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_msubv_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-multiply/test_msa_mulv_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_mulv_d_32r5el
+
+#
+# Int Subtract
+# ------------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_asub_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_asub_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_hsub_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_hsub_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subs_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsus_u_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subsuu_s_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc int-subtract/test_msa_subv_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_subv_d_32r5el
+
+#
+# Interleave
+# ----------
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvev_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvev_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvod_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvod_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvl_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvl_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc interleave/test_msa_ilvr_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_ilvr_d_32r5el
+
+#
+# Logic
+# -----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_and_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_and_v_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_nor_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_nor_v_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_or_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_or_v_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc logic/test_msa_xor_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_xor_v_32r5el
+
+#
+# Move
+# ----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc move/test_msa_move_v.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_move_v_32r5el
+
+#
+# Pack
+# ----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckev_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckev_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_pckod_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_pckod_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc pack/test_msa_vshf_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_vshf_d_32r5el
+
+#
+# Shift
+# -----
+#
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sll_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sll_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_sra_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_sra_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srar_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srar_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srl_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srl_d_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_b.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_b_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_h.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_h_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_w.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_w_32r5el
+/opt/mti/bin/mips-mti-linux-gnu-gcc shift/test_msa_srlr_d.c \
+-EL -static -mabi=32 -march=mips32r5 -mmsa -mno-odd-spreg -mfp64 -mnan=2008 -o \
+ /tmp/test_msa_srlr_d_32r5el
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh b/tests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh
new file mode 100755
index 0000000000..6bc8907a53
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_compile_64r6eb.sh
@@ -0,0 +1,643 @@
+
+#
+# Bit Count
+# ---------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_d_64r6eb
+
+#
+# Bit move
+# --------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_bmnz_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bmnz_v_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_bmz_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bmz_v_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_bsel_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bsel_v_64r6eb
+
+#
+# Bit Set
+# -------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_d_64r6eb
+
+#
+# Fixed Multiply
+# --------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mul_q_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mul_q_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulr_q_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulr_q_w_64r6eb
+
+#
+# Float Max Min
+# -------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_a_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_a_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_a_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_a_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_a_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_a_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_a_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_a_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_d_64r6eb
+
+#
+# Int Add
+# -------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_u_d_64r6eb
+
+#
+# Int Average
+# -----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_d_64r6eb
+
+#
+# Int Compare
+# -----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_d_64r6eb
+
+#
+# Int Divide
+# ----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_d_64r6eb
+
+#
+# Int Dot Product
+# ---------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_u_d_64r6eb
+
+#
+# Int Max Min
+# -----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_d_64r6eb
+
+#
+# Int Modulo
+# ----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_d_64r6eb
+
+#
+# Int Multiply
+# ------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_d_64r6eb
+
+#
+# Int Subtract
+# ------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_d_64r6eb
+
+#
+# Interleave
+# ----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_d_64r6eb
+
+#
+# Logic
+# -----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_and_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_and_v_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_nor_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nor_v_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_or_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_or_v_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_xor_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_xor_v_64r6eb
+
+#
+# Move
+# ----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc move/test_msa_move_v.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_move_v_64r6eb
+
+#
+# Pack
+# ----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_d_64r6eb
+
+#
+# Shift
+# -----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_d_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_b.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_b_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_h.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_h_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_w.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_w_64r6eb
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_d.c \
+-EB -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_d_64r6eb
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh b/tests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh
new file mode 100755
index 0000000000..4a92c55a4e
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_compile_64r6el.sh
@@ -0,0 +1,643 @@
+
+#
+# Bit Count
+# ---------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nloc_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nloc_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_nlzc_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nlzc_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-count/test_msa_pcnt_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pcnt_d_64r6el
+
+#
+# Bit move
+# --------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsl_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsl_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_binsr_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_binsr_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_bmnz_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bmnz_v_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_bmz_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bmz_v_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-move/test_msa_bsel_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bsel_v_64r6el
+
+#
+# Bit Set
+# -------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bclr_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bclr_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bneg_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bneg_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc bit-set/test_msa_bset_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_bset_d_64r6el
+
+#
+# Fixed Multiply
+# --------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_madd_q_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_madd_q_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_maddr_q_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddr_q_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msub_q_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msub_q_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_msubr_q_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubr_q_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mul_q_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mul_q_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mul_q_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulr_q_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc fixed-multiply/test_msa_mulr_q_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulr_q_w_64r6el
+
+#
+# Float Max Min
+# -------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_a_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_a_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_a_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_a_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmax_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmax_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_a_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_a_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_a_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_a_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc float-max-min/test_msa_fmin_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_fmin_d_64r6el
+
+#
+# Int Add
+# -------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_add_a_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_add_a_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_a_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_a_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_adds_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_adds_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_addv_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_addv_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-add/test_msa_hadd_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hadd_u_d_64r6el
+
+#
+# Int Average
+# -----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_ave_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ave_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-average/test_msa_aver_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_aver_u_d_64r6el
+
+#
+# Int Compare
+# -----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_ceq_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ceq_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_cle_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_cle_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-compare/test_msa_clt_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_clt_u_d_64r6el
+
+#
+# Int Divide
+# ----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-divide/test_msa_div_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_div_u_d_64r6el
+
+#
+# Int Dot Product
+# ---------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dotp_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dotp_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpadd_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpadd_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-dot-product/test_msa_dpsub_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_dpsub_u_d_64r6el
+
+#
+# Int Max Min
+# -----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_a_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_a_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_max_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_max_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_a_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_a_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-max-min/test_msa_min_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_min_u_d_64r6el
+
+#
+# Int Modulo
+# ----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-modulo/test_msa_mod_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mod_u_d_64r6el
+
+#
+# Int Multiply
+# ------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_maddv_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_maddv_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_msubv_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_msubv_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-multiply/test_msa_mulv_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_mulv_d_64r6el
+
+#
+# Int Subtract
+# ------------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_asub_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_asub_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_hsub_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_hsub_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subs_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subs_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsus_u_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsus_u_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subsuu_s_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subsuu_s_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc int-subtract/test_msa_subv_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_subv_d_64r6el
+
+#
+# Interleave
+# ----------
+#
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvev_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvev_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvod_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvod_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvl_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvl_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc interleave/test_msa_ilvr_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_ilvr_d_64r6el
+
+#
+# Logic
+# -----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_and_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_and_v_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_nor_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_nor_v_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_or_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_or_v_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc logic/test_msa_xor_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_xor_v_64r6el
+
+#
+# Move
+# ----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc move/test_msa_move_v.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_move_v_64r6el
+
+#
+# Pack
+# ----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckev_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckev_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_pckod_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_pckod_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc pack/test_msa_vshf_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_vshf_d_64r6el
+
+#
+# Shift
+# -----
+#
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sll_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sll_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_sra_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_sra_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srar_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srar_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srl_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srl_d_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_b.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_b_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_h.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_h_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_w.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_w_64r6el
+/opt/img/bin/mips-img-linux-gnu-gcc shift/test_msa_srlr_d.c \
+-EL -static -mabi=64 -march=mips64r6 -mmsa -o /tmp/test_msa_srlr_d_64r6el
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_run_32r5eb.sh b/tests/tcg/mips/user/ase/msa/test_msa_run_32r5eb.sh
new file mode 100755
index 0000000000..32dbf31347
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_run_32r5eb.sh
@@ -0,0 +1,371 @@
+PATH_TO_QEMU="../../../../../../mips-linux-user/qemu-mips"
+
+
+#
+# Bit Count
+# ---------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_d_32r5eb
+
+#
+# Bit move
+# --------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bmnz_v_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bmz_v_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bsel_v_32r5eb
+
+#
+# Bit Set
+# -------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_d_32r5eb
+
+#
+# Fixed Multiply
+# --------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_madd_q_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_madd_q_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddr_q_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddr_q_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msub_q_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msub_q_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubr_q_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubr_q_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mul_q_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mul_q_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulr_q_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulr_q_w_32r5eb
+
+#
+# Float Max Min
+# -------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_a_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_a_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_a_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_a_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_d_32r5eb
+
+#
+# Int Add
+# -------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_u_d_32r5eb
+
+#
+# Int Average
+# -----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_d_32r5eb
+
+#
+# Int Compare
+# -----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_d_32r5eb
+
+#
+# Int Divide
+# ----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_d_32r5eb
+
+#
+# Int Dot Product
+# ---------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_u_d_32r5eb
+
+#
+# Int Max Min
+# -----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_d_32r5eb
+
+#
+# Int Modulo
+# ----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_d_32r5eb
+
+#
+# Int Multiply
+# ------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_d_32r5eb
+
+#
+# Int Subtract
+# ------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_d_32r5eb
+
+#
+# Interleave
+# ----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_d_32r5eb
+
+#
+# Logic
+# -----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_and_v_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nor_v_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_or_v_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_xor_v_32r5eb
+
+#
+# Move
+# ----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_move_v_32r5eb
+
+#
+# Pack
+# ----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_d_32r5eb
+
+#
+# Shift
+# -----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_d_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_b_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_h_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_w_32r5eb
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_d_32r5eb
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_run_32r5el.sh b/tests/tcg/mips/user/ase/msa/test_msa_run_32r5el.sh
new file mode 100755
index 0000000000..a2e6092522
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_run_32r5el.sh
@@ -0,0 +1,371 @@
+PATH_TO_QEMU="../../../../../../mipsel-linux-user/qemu-mipsel"
+
+
+#
+# Bit Count
+# ---------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nloc_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nlzc_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pcnt_d_32r5el
+
+#
+# Bit move
+# --------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsl_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_binsr_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bmnz_v_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bmz_v_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bsel_v_32r5el
+
+#
+# Bit Set
+# -------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bclr_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bneg_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_bset_d_32r5el
+
+#
+# Fixed Multiply
+# --------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_madd_q_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_madd_q_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddr_q_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddr_q_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msub_q_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msub_q_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubr_q_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubr_q_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mul_q_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mul_q_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulr_q_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulr_q_w_32r5el
+
+#
+# Float Max Min
+# -------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_a_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_a_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmax_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_a_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_a_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_fmin_d_32r5el
+
+#
+# Int Add
+# -------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_add_a_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_a_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_adds_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_addv_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hadd_u_d_32r5el
+
+#
+# Int Average
+# -----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ave_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_aver_u_d_32r5el
+
+#
+# Int Compare
+# -----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ceq_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_cle_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_clt_u_d_32r5el
+
+#
+# Int Divide
+# ----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_div_u_d_32r5el
+
+#
+# Int Dot Product
+# ---------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dotp_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpadd_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_dpsub_u_d_32r5el
+
+#
+# Int Max Min
+# -----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_a_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_max_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_a_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_min_u_d_32r5el
+
+#
+# Int Modulo
+# ----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mod_u_d_32r5el
+
+#
+# Int Multiply
+# ------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_maddv_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_msubv_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_mulv_d_32r5el
+
+#
+# Int Subtract
+# ------------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_asub_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_hsub_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subs_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsus_u_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subsuu_s_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_subv_d_32r5el
+
+#
+# Interleave
+# ----------
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvev_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvod_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvl_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_ilvr_d_32r5el
+
+#
+# Logic
+# -----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_and_v_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_nor_v_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_or_v_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_xor_v_32r5el
+
+#
+# Move
+# ----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_move_v_32r5el
+
+#
+# Pack
+# ----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckev_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_pckod_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_vshf_d_32r5el
+
+#
+# Shift
+# -----
+#
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sll_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_sra_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srar_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srl_d_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_b_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_h_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_w_32r5el
+$PATH_TO_QEMU -cpu P5600 /tmp/test_msa_srlr_d_32r5el
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh b/tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh
new file mode 100755
index 0000000000..6de6d7cacf
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_run_64r6eb.sh
@@ -0,0 +1,371 @@
+PATH_TO_QEMU="../../../../../../mips64-linux-user/qemu-mips64"
+
+
+#
+# Bit Count
+# ---------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_d_64r6eb
+
+#
+# Bit move
+# --------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bmnz_v_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bmz_v_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bsel_v_64r6eb
+
+#
+# Bit Set
+# -------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_d_64r6eb
+
+#
+# Fixed Multiply
+# --------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_w_64r6eb
+
+#
+# Float Max Min
+# -------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_a_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_a_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_a_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_a_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_d_64r6eb
+
+#
+# Int Add
+# -------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_u_d_64r6eb
+
+#
+# Int Average
+# -----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_d_64r6eb
+
+#
+# Int Compare
+# -----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_d_64r6eb
+
+#
+# Int Divide
+# ----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_d_64r6eb
+
+#
+# Int Dot Product
+# ---------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_u_d_64r6eb
+
+#
+# Int Max Min
+# -----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_d_64r6eb
+
+#
+# Int Modulo
+# ----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_d_64r6eb
+
+#
+# Int Multiply
+# ------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_d_64r6eb
+
+#
+# Int Subtract
+# ------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_d_64r6eb
+
+#
+# Interleave
+# ----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_d_64r6eb
+
+#
+# Logic
+# -----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_and_v_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nor_v_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_or_v_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_xor_v_64r6eb
+
+#
+# Move
+# ----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_move_v_64r6eb
+
+#
+# Pack
+# ----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_d_64r6eb
+
+#
+# Shift
+# -----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_d_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_b_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_h_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_w_64r6eb
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_d_64r6eb
diff --git a/tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh b/tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh
new file mode 100755
index 0000000000..979057df74
--- /dev/null
+++ b/tests/tcg/mips/user/ase/msa/test_msa_run_64r6el.sh
@@ -0,0 +1,371 @@
+PATH_TO_QEMU="../../../../../../mips64el-linux-user/qemu-mips64el"
+
+
+#
+# Bit Count
+# ---------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nloc_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nlzc_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pcnt_d_64r6el
+
+#
+# Bit move
+# --------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsl_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_binsr_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bmnz_v_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bmz_v_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bsel_v_64r6el
+
+#
+# Bit Set
+# -------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bclr_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bneg_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_bset_d_64r6el
+
+#
+# Fixed Multiply
+# --------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_madd_q_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddr_q_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msub_q_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubr_q_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mul_q_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulr_q_w_64r6el
+
+#
+# Float Max Min
+# -------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_a_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_a_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmax_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_a_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_a_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_fmin_d_64r6el
+
+#
+# Int Add
+# -------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_add_a_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_a_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_adds_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_addv_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hadd_u_d_64r6el
+
+#
+# Int Average
+# -----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ave_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_aver_u_d_64r6el
+
+#
+# Int Compare
+# -----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ceq_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_cle_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_clt_u_d_64r6el
+
+#
+# Int Divide
+# ----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_div_u_d_64r6el
+
+#
+# Int Dot Product
+# ---------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dotp_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpadd_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_dpsub_u_d_64r6el
+
+#
+# Int Max Min
+# -----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_a_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_max_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_a_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_min_u_d_64r6el
+
+#
+# Int Modulo
+# ----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mod_u_d_64r6el
+
+#
+# Int Multiply
+# ------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_maddv_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_msubv_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_mulv_d_64r6el
+
+#
+# Int Subtract
+# ------------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_asub_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_hsub_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subs_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsus_u_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subsuu_s_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_subv_d_64r6el
+
+#
+# Interleave
+# ----------
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvev_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvod_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvl_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_ilvr_d_64r6el
+
+#
+# Logic
+# -----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_and_v_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_nor_v_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_or_v_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_xor_v_64r6el
+
+#
+# Move
+# ----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_move_v_64r6el
+
+#
+# Pack
+# ----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckev_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_pckod_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_vshf_d_64r6el
+
+#
+# Shift
+# -----
+#
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sll_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_sra_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srar_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srl_d_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_b_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_h_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_w_64r6el
+$PATH_TO_QEMU -cpu I6400 /tmp/test_msa_srlr_d_64r6el