Skip to contentSkip to conversation

Initial Blackfin support (linux-user only)

PATCH In review Mike Frysinger 4 participants 10 messages Jun 17, 2013 – Jun 28, 2013 exec and binfmt

lore
Share & tools
lore
#0 lore raw

cover Initial Blackfin support (linux-user only)

I've cleaned up the code and removed all the debugging bits. This passes a good number of tests (both the ones included here as well as the ones included with binutils/gcc/etc...), and as long as you stay away from the DSP related insns, your experience should be pretty good. If you do need DSP insns, then you should probably stick with the GNU sim for now.

The port started off against a much older version, so I might have missed some stuff that needs to be done for the latest master branch.

Mike Frysinger (5):
Blackfin: add disassembler support
Blackfin: initial port
Blackfin: add linux-user support
Blackfin: add test suite
linux-user: add support for Blackfin syscalls

 MAINTAINERS                                 |    5 +
 configure                                   |    8 +
 cpu-exec.c                                  |    5 +-
 default-configs/bfin-linux-user.mak         |    1 +
 disas.c                                     |    9 +
 disas/Makefile.objs                         |    1 +
 disas/bfin.c                                | 4791 +++++++++++++++++++++++++++
 gdbstub.c                                   |  103 +
 include/disas/bfd.h                         |    3 +
 include/elf.h                               |    6 +
 linux-user/bfin/syscall.h                   |   59 +
 linux-user/bfin/syscall_nr.h                |  389 +++
 linux-user/bfin/target_flat.h               |   92 +
 linux-user/bfin/target_sigcontext.h         |   61 +
 linux-user/bfin/target_signal.h             |   31 +
 linux-user/bfin/termbits.h                  |  227 ++
 linux-user/elfload.c                        |   47 +
 linux-user/main.c                           |  160 +
 linux-user/qemu.h                           |    4 +
 linux-user/signal.c                         |  225 ++
 linux-user/strace.list                      |    9 +
 linux-user/syscall.c                        |   77 +-
 linux-user/syscall_defs.h                   |   65 +-
 linux-user/target_ucontext.h                |   14 +
 qapi-schema.json                            |    9 +-
 scripts/qemu-binfmt-conf.sh                 |    4 +
 target-bfin/Makefile.objs                   |    3 +
 target-bfin/README                          |   32 +
 target-bfin/TODO                            |   25 +
 target-bfin/bfin-sim.c                      | 3666 ++++++++++++++++++++
 target-bfin/bfin-tdep.h                     |   94 +
 target-bfin/cpu-qom.h                       |   61 +
 target-bfin/cpu.c                           |   55 +
 target-bfin/cpu.h                           |  236 ++
 target-bfin/helper.c                        |   37 +
 target-bfin/helper.h                        |   23 +
 target-bfin/linux-fixed-code.h              |   23 +
 target-bfin/op_helper.c                     |  229 ++
 target-bfin/opcode/bfin.h                   | 1754 ++++++++++
 target-bfin/translate.c                     | 1347 ++++++++
 tests/tcg/Makefile                          |    4 +
 tests/tcg/bfin/.gitignore                   |    2 +
 tests/tcg/bfin/10272_small.s                |   51 +
 tests/tcg/bfin/10436.s                      |   39 +
 tests/tcg/bfin/10622.s                      |   21 +
 tests/tcg/bfin/10742.s                      |   17 +
 tests/tcg/bfin/10799.s                      |   55 +
 tests/tcg/bfin/7641.s                       |   38 +
 tests/tcg/bfin/Makefile                     |   80 +
 tests/tcg/bfin/a0.s                         |   17 +
 tests/tcg/bfin/a1.s                         |   29 +
 tests/tcg/bfin/a10.s                        |  163 +
 tests/tcg/bfin/a2.s                         |  179 +
 tests/tcg/bfin/a24.s                        |   12 +
 tests/tcg/bfin/a25.s                        |   28 +
 tests/tcg/bfin/a26.s                        |   72 +
 tests/tcg/bfin/a3.s                         |  313 ++
 tests/tcg/bfin/a4.s                         |   36 +
 tests/tcg/bfin/a7.s                         |  179 +
 tests/tcg/bfin/a8.s                         |   41 +
 tests/tcg/bfin/a9.s                         |  205 ++
 tests/tcg/bfin/abs-2.S                      |   42 +
 tests/tcg/bfin/abs-3.S                      |   42 +
 tests/tcg/bfin/abs.S                        |   42 +
 tests/tcg/bfin/acc-rot.s                    |  129 +
 tests/tcg/bfin/acp5_19.s                    |   12 +
 tests/tcg/bfin/add_imm7.s                   |   38 +
 tests/tcg/bfin/algnbug1.s                   |   38 +
 tests/tcg/bfin/algnbug2.s                   |   69 +
 tests/tcg/bfin/b0.S                         |   51 +
 tests/tcg/bfin/b1.s                         |   12 +
 tests/tcg/bfin/b2.S                         |   26 +
 tests/tcg/bfin/brcc.s                       |  164 +
 tests/tcg/bfin/brevadd.s                    |   20 +
 tests/tcg/bfin/byteunpack.s                 |   45 +
 tests/tcg/bfin/c_alu2op_arith_r_sft.s       |  226 ++
 tests/tcg/bfin/c_alu2op_conv_b.s            |  211 ++
 tests/tcg/bfin/c_alu2op_conv_h.s            |  211 ++
 tests/tcg/bfin/c_alu2op_conv_mix.s          |  186 ++
 tests/tcg/bfin/c_alu2op_conv_neg.s          |  211 ++
 tests/tcg/bfin/c_alu2op_conv_toggle.s       |  211 ++
 tests/tcg/bfin/c_alu2op_conv_xb.s           |  211 ++
 tests/tcg/bfin/c_alu2op_conv_xh.s           |  212 ++
 tests/tcg/bfin/c_alu2op_divq.s              |  220 ++
 tests/tcg/bfin/c_alu2op_divs.s              |  220 ++
 tests/tcg/bfin/c_alu2op_log_l_sft.s         |  220 ++
 tests/tcg/bfin/c_alu2op_log_r_sft.s         |  217 ++
 tests/tcg/bfin/c_alu2op_shadd_1.s           |  209 ++
 tests/tcg/bfin/c_alu2op_shadd_2.s           |  209 ++
 tests/tcg/bfin/c_br_preg_killed_ac.s        |   82 +
 tests/tcg/bfin/c_br_preg_killed_ex1.s       |   85 +
 tests/tcg/bfin/c_br_preg_stall_ac.s         |   75 +
 tests/tcg/bfin/c_br_preg_stall_ex1.s        |   70 +
 tests/tcg/bfin/c_brcc_bp1.s                 |   45 +
 tests/tcg/bfin/c_brcc_bp2.s                 |   45 +
 tests/tcg/bfin/c_brcc_bp3.s                 |   47 +
 tests/tcg/bfin/c_brcc_bp4.s                 |   46 +
 tests/tcg/bfin/c_brcc_brf_bp.s              |   46 +
 tests/tcg/bfin/c_brcc_brf_brt_bp.s          |   47 +
 tests/tcg/bfin/c_brcc_brf_brt_nbp.s         |   46 +
 tests/tcg/bfin/c_brcc_brf_fbkwd.s           |   46 +
 tests/tcg/bfin/c_brcc_brf_nbp.s             |   45 +
 tests/tcg/bfin/c_brcc_brt_bp.s              |   46 +
 tests/tcg/bfin/c_brcc_brt_nbp.s             |   45 +
 tests/tcg/bfin/c_calla_ljump.s              |   31 +
 tests/tcg/bfin/c_calla_subr.s               |   28 +
 tests/tcg/bfin/c_cc2dreg.s                  |   56 +
 tests/tcg/bfin/c_cc2stat_cc_ac.S            |  240 ++
 tests/tcg/bfin/c_cc2stat_cc_an.s            |  243 ++
 tests/tcg/bfin/c_cc2stat_cc_aq.s            |  243 ++
 tests/tcg/bfin/c_cc2stat_cc_av0.S           |  241 ++
 tests/tcg/bfin/c_cc2stat_cc_av1.S           |  240 ++
 tests/tcg/bfin/c_cc2stat_cc_az.s            |  243 ++
 tests/tcg/bfin/c_cc_flag_ccmv_depend.S      |   82 +
 tests/tcg/bfin/c_cc_flagdreg_mvbrsft.s      |   87 +
 tests/tcg/bfin/c_cc_regmvlogi_mvbrsft.s     |   83 +
 tests/tcg/bfin/c_ccflag_dr_dr.s             |  299 ++
 tests/tcg/bfin/c_ccflag_dr_dr_uu.s          |  299 ++
 tests/tcg/bfin/c_ccflag_dr_imm3.s           |  224 ++
 tests/tcg/bfin/c_ccflag_dr_imm3_uu.s        |  221 ++
 tests/tcg/bfin/c_ccflag_pr_imm3.s           |  539 +++
 tests/tcg/bfin/c_ccflag_pr_imm3_uu.s        |  238 ++
 tests/tcg/bfin/c_ccflag_pr_pr.s             |  262 ++
 tests/tcg/bfin/c_ccflag_pr_pr_uu.s          |  212 ++
 tests/tcg/bfin/c_ccmv_cc_dr_dr.s            |  124 +
 tests/tcg/bfin/c_ccmv_cc_dr_pr.s            |   61 +
 tests/tcg/bfin/c_ccmv_cc_pr_pr.s            |  111 +
 tests/tcg/bfin/c_ccmv_ncc_dr_dr.s           |  123 +
 tests/tcg/bfin/c_ccmv_ncc_dr_pr.s           |   60 +
 tests/tcg/bfin/c_ccmv_ncc_pr_pr.s           |  111 +
 tests/tcg/bfin/c_comp3op_dr_and_dr.s        |  412 +++
 tests/tcg/bfin/c_comp3op_dr_minus_dr.s      |  412 +++
 tests/tcg/bfin/c_comp3op_dr_mix.s           |  237 ++
 tests/tcg/bfin/c_comp3op_dr_or_dr.s         |  412 +++
 tests/tcg/bfin/c_comp3op_dr_plus_dr.s       |  412 +++
 tests/tcg/bfin/c_comp3op_dr_xor_dr.s        |  412 +++
 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh1.s   |  302 ++
 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh2.s   |  302 ++
 tests/tcg/bfin/c_compi2opd_dr_add_i7_n.s    |  164 +
 tests/tcg/bfin/c_compi2opd_dr_add_i7_p.s    |  147 +
 tests/tcg/bfin/c_compi2opd_dr_eq_i7_n.s     |  166 +
 tests/tcg/bfin/c_compi2opd_dr_eq_i7_p.s     |  147 +
 tests/tcg/bfin/c_compi2opd_flags.S          |  600 ++++
 tests/tcg/bfin/c_compi2opd_flags_2.S        |  600 ++++
 tests/tcg/bfin/c_compi2opp_pr_add_i7_n.s    |  149 +
 tests/tcg/bfin/c_compi2opp_pr_add_i7_p.s    |  116 +
 tests/tcg/bfin/c_compi2opp_pr_eq_i7_n.s     |  161 +
 tests/tcg/bfin/c_compi2opp_pr_eq_i7_p.s     |  131 +
 tests/tcg/bfin/c_dagmodik_lnz_imgebl.s      |  290 ++
 tests/tcg/bfin/c_dagmodik_lnz_imltbl.s      |  289 ++
 tests/tcg/bfin/c_dagmodik_lz_inc_dec.s      |  140 +
 tests/tcg/bfin/c_dagmodim_lnz_imgebl.s      |  108 +
 tests/tcg/bfin/c_dagmodim_lnz_imltbl.s      |  109 +
 tests/tcg/bfin/c_dagmodim_lz_inc_dec.s      |   98 +
 tests/tcg/bfin/c_dsp32alu_a_neg_a.s         |   34 +
 tests/tcg/bfin/c_dsp32alu_aa_absabs.s       |   35 +
 tests/tcg/bfin/c_dsp32alu_aa_negneg.s       |   35 +
 tests/tcg/bfin/c_dsp32alu_abs.s             |   62 +
 tests/tcg/bfin/c_dsp32alu_absabs.s          |   62 +
 tests/tcg/bfin/c_dsp32alu_awx.s             |   54 +
 tests/tcg/bfin/c_dsp32alu_bytepack.s        |   77 +
 tests/tcg/bfin/c_dsp32alu_byteunpack.s      |  113 +
 tests/tcg/bfin/c_dsp32alu_disalnexcpt.s     |  255 ++
 tests/tcg/bfin/c_dsp32alu_max.s             |  261 ++
 tests/tcg/bfin/c_dsp32alu_maxmax.s          |  261 ++
 tests/tcg/bfin/c_dsp32alu_min.s             |  261 ++
 tests/tcg/bfin/c_dsp32alu_minmin.s          |  261 ++
 tests/tcg/bfin/c_dsp32alu_rr_lph_a1a0.s     |   33 +
 tests/tcg/bfin/c_dsp32alu_search.s          |   74 +
 tests/tcg/bfin/c_dsp32alu_sgn.s             |   39 +
 tests/tcg/bfin/c_dsp32mac_a1a0.s            |  255 ++
 tests/tcg/bfin/c_dsp32mac_pair_a0.s         |  129 +
 tests/tcg/bfin/c_dsp32mac_pair_a0_i.s       |  247 ++
 tests/tcg/bfin/c_dsp32mac_pair_a0_m.s       |  129 +
 tests/tcg/bfin/c_dsp32mac_pair_a1.s         |  127 +
 tests/tcg/bfin/c_dsp32mac_pair_a1_i.s       |  243 ++
 tests/tcg/bfin/c_dsp32mac_pair_a1_m.s       |  127 +
 tests/tcg/bfin/c_dsp32mult_pair_m.s         |  178 +
 tests/tcg/bfin/c_dsp32mult_pair_m_i.s       |  178 +
 tests/tcg/bfin/c_dsp32mult_pair_m_u.s       |  178 +
 tests/tcg/bfin/c_dsp32shift_a0alr.s         |   77 +
 tests/tcg/bfin/c_dsp32shift_af.s            |  186 ++
 tests/tcg/bfin/c_dsp32shift_ahalf_ln.s      |  423 +++
 tests/tcg/bfin/c_dsp32shift_ahalf_lp.s      |  423 +++
 tests/tcg/bfin/c_dsp32shift_ahalf_rn.s      |  423 +++
 tests/tcg/bfin/c_dsp32shift_ahalf_rn_s.s    |  424 +++
 tests/tcg/bfin/c_dsp32shift_ahalf_rp.s      |  423 +++
 tests/tcg/bfin/c_dsp32shift_ahalf_rp_s.s    |  423 +++
 tests/tcg/bfin/c_dsp32shift_align16.s       |  210 ++
 tests/tcg/bfin/c_dsp32shift_align24.s       |  210 ++
 tests/tcg/bfin/c_dsp32shift_align8.s        |  210 ++
 tests/tcg/bfin/c_dsp32shift_fdepx.s         |  210 ++
 tests/tcg/bfin/c_dsp32shift_fextx.s         |  210 ++
 tests/tcg/bfin/c_dsp32shift_lf.s            |  422 +++
 tests/tcg/bfin/c_dsp32shift_lhalf_ln.s      |  422 +++
 tests/tcg/bfin/c_dsp32shift_lhalf_lp.s      |  422 +++
 tests/tcg/bfin/c_dsp32shift_lhalf_rn.s      |  425 +++
 tests/tcg/bfin/c_dsp32shift_lhalf_rp.s      |  423 +++
 tests/tcg/bfin/c_dsp32shift_ones.s          |  214 ++
 tests/tcg/bfin/c_dsp32shift_pack.s          |  411 +++
 tests/tcg/bfin/c_dsp32shift_rot.s           |  427 +++
 tests/tcg/bfin/c_dsp32shift_rot_mix.s       |  375 +++
 tests/tcg/bfin/c_dsp32shift_signbits_r.s    |  214 ++
 tests/tcg/bfin/c_dsp32shift_signbits_rh.s   |  214 ++
 tests/tcg/bfin/c_dsp32shift_signbits_rl.s   |  210 ++
 tests/tcg/bfin/c_dsp32shift_vmax.s          |  113 +
 tests/tcg/bfin/c_dsp32shift_vmaxvmax.s      |  113 +
 tests/tcg/bfin/c_dsp32shiftim_a0alr.s       |  213 ++
 tests/tcg/bfin/c_dsp32shiftim_af.s          |   63 +
 tests/tcg/bfin/c_dsp32shiftim_af_s.s        |   37 +
 tests/tcg/bfin/c_dsp32shiftim_ahalf_ln.s    |  406 +++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_lp.s    |  418 +++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn.s    |  418 +++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn_s.s  |  418 +++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp.s    |  420 +++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp_s.s  |  422 +++
 tests/tcg/bfin/c_dsp32shiftim_ahh.s         |   65 +
 tests/tcg/bfin/c_dsp32shiftim_amix.s        |  124 +
 tests/tcg/bfin/c_dsp32shiftim_lf.s          |   63 +
 tests/tcg/bfin/c_dsp32shiftim_lhalf_ln.s    |  401 +++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_lp.s    |  418 +++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_rn.s    |  424 +++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_rp.s    |  421 +++
 tests/tcg/bfin/c_dsp32shiftim_lhh.s         |   65 +
 tests/tcg/bfin/c_dsp32shiftim_lmix.s        |  138 +
 tests/tcg/bfin/c_dsp32shiftim_rot.s         |   62 +
 tests/tcg/bfin/c_dspldst_ld_dr_i.s          |  168 +
 tests/tcg/bfin/c_dspldst_ld_dr_ipp.s        |  348 ++
 tests/tcg/bfin/c_dspldst_ld_dr_ippm.s       |  328 ++
 tests/tcg/bfin/c_dspldst_ld_drhi_i.s        |  168 +
 tests/tcg/bfin/c_dspldst_ld_drhi_ipp.s      |  364 ++
 tests/tcg/bfin/c_dspldst_ld_drlo_i.s        |  164 +
 tests/tcg/bfin/c_dspldst_ld_drlo_ipp.s      |  355 ++
 tests/tcg/bfin/c_dspldst_st_dr_i.s          |  185 ++
 tests/tcg/bfin/c_dspldst_st_dr_ipp.s        |  326 ++
 tests/tcg/bfin/c_dspldst_st_dr_ippm.s       |  279 ++
 tests/tcg/bfin/c_dspldst_st_drhi_i.s        |  161 +
 tests/tcg/bfin/c_dspldst_st_drhi_ipp.s      |  355 ++
 tests/tcg/bfin/c_dspldst_st_drlo_i.s        |  163 +
 tests/tcg/bfin/c_dspldst_st_drlo_ipp.s      |  351 ++
 tests/tcg/bfin/c_ldimmhalf_dreg.s           |   60 +
 tests/tcg/bfin/c_ldimmhalf_drhi.s           |   85 +
 tests/tcg/bfin/c_ldimmhalf_drlo.s           |   89 +
 tests/tcg/bfin/c_ldimmhalf_h_dr.s           |   82 +
 tests/tcg/bfin/c_ldimmhalf_h_ibml.s         |  165 +
 tests/tcg/bfin/c_ldimmhalf_h_pr.s           |   74 +
 tests/tcg/bfin/c_ldimmhalf_l_dr.s           |   82 +
 tests/tcg/bfin/c_ldimmhalf_l_ibml.s         |  165 +
 tests/tcg/bfin/c_ldimmhalf_l_pr.s           |   76 +
 tests/tcg/bfin/c_ldimmhalf_lz_dr.s          |   81 +
 tests/tcg/bfin/c_ldimmhalf_lz_ibml.s        |  168 +
 tests/tcg/bfin/c_ldimmhalf_lz_pr.s          |   72 +
 tests/tcg/bfin/c_ldimmhalf_lzhi_dr.s        |  113 +
 tests/tcg/bfin/c_ldimmhalf_lzhi_ibml.s      |  216 ++
 tests/tcg/bfin/c_ldimmhalf_lzhi_pr.s        |  102 +
 tests/tcg/bfin/c_ldimmhalf_pibml.s          |  212 ++
 tests/tcg/bfin/c_ldst_ld_d_p.s              |  372 +++
 tests/tcg/bfin/c_ldst_ld_d_p_b.s            |  353 ++
 tests/tcg/bfin/c_ldst_ld_d_p_h.s            |  351 ++
 tests/tcg/bfin/c_ldst_ld_d_p_mm.s           |  417 +++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_b.s         |  353 ++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_h.s         |  330 ++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_xb.s        |  341 ++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_xh.s        |  355 ++
 tests/tcg/bfin/c_ldst_ld_d_p_pp.s           |  371 +++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_b.s         |  324 ++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_h.s         |  350 ++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_xb.s        |  355 ++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_xh.s        |  333 ++
 tests/tcg/bfin/c_ldst_ld_d_p_ppmm_hbx.s     |  656 ++++
 tests/tcg/bfin/c_ldst_ld_d_p_xb.s           |  326 ++
 tests/tcg/bfin/c_ldst_ld_d_p_xh.s           |  354 ++
 tests/tcg/bfin/c_ldst_ld_p_p.s              |  327 ++
 tests/tcg/bfin/c_ldst_ld_p_p_mm.s           |  406 +++
 tests/tcg/bfin/c_ldst_ld_p_p_pp.s           |  335 ++
 tests/tcg/bfin/c_ldst_st_p_d.s              |  299 ++
 tests/tcg/bfin/c_ldst_st_p_d_b.s            |  300 ++
 tests/tcg/bfin/c_ldst_st_p_d_h.s            |  280 ++
 tests/tcg/bfin/c_ldst_st_p_d_mm.s           |  601 ++++
 tests/tcg/bfin/c_ldst_st_p_d_mm_b.s         |  498 +++
 tests/tcg/bfin/c_ldst_st_p_d_mm_h.s         |  554 ++++
 tests/tcg/bfin/c_ldst_st_p_d_pp.s           |  804 +++++
 tests/tcg/bfin/c_ldst_st_p_d_pp_b.s         |  455 +++
 tests/tcg/bfin/c_ldst_st_p_d_pp_h.s         |  457 +++
 tests/tcg/bfin/c_ldst_st_p_p.s              |  128 +
 tests/tcg/bfin/c_ldst_st_p_p_mm.s           |  428 +++
 tests/tcg/bfin/c_ldst_st_p_p_pp.s           |  397 +++
 tests/tcg/bfin/c_ldstidxl_ld_dr_b.s         |  554 ++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_h.s         |  595 ++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_xb.s        |  594 ++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_xh.s        |  595 ++++
 tests/tcg/bfin/c_ldstidxl_ld_dreg.s         |  554 ++++
 tests/tcg/bfin/c_ldstidxl_ld_preg.s         |  672 ++++
 tests/tcg/bfin/c_ldstidxl_st_dr_b.s         |  612 ++++
 tests/tcg/bfin/c_ldstidxl_st_dr_h.s         |  609 ++++
 tests/tcg/bfin/c_ldstidxl_st_dreg.s         |  780 +++++
 tests/tcg/bfin/c_ldstidxl_st_preg.s         |  709 ++++
 tests/tcg/bfin/c_ldstii_ld_dr_h.s           |  541 +++
 tests/tcg/bfin/c_ldstii_ld_dr_xh.s          |  541 +++
 tests/tcg/bfin/c_ldstii_ld_dreg.s           |  540 +++
 tests/tcg/bfin/c_ldstii_ld_preg.s           |  564 ++++
 tests/tcg/bfin/c_ldstii_st_dr_h.s           |  605 ++++
 tests/tcg/bfin/c_ldstii_st_dreg.s           |  640 ++++
 tests/tcg/bfin/c_ldstii_st_preg.s           |  603 ++++
 tests/tcg/bfin/c_ldstiifp_ld_dreg.s         |  528 +++
 tests/tcg/bfin/c_ldstiifp_ld_preg.s         |  511 +++
 tests/tcg/bfin/c_ldstiifp_st_dreg.s         |  641 ++++
 tests/tcg/bfin/c_ldstiifp_st_preg.s         |  618 ++++
 tests/tcg/bfin/c_ldstpmod_ld_dr_hi.s        |  411 +++
 tests/tcg/bfin/c_ldstpmod_ld_dr_lo.s        |  410 +++
 tests/tcg/bfin/c_ldstpmod_ld_dreg.s         |  462 +++
 tests/tcg/bfin/c_ldstpmod_ld_h_xh.s         |  458 +++
 tests/tcg/bfin/c_ldstpmod_ld_lohi.s         |  462 +++
 tests/tcg/bfin/c_ldstpmod_st_dr_hi.s        |  400 +++
 tests/tcg/bfin/c_ldstpmod_st_dr_lo.s        |  401 +++
 tests/tcg/bfin/c_ldstpmod_st_dreg.s         |  623 ++++
 tests/tcg/bfin/c_ldstpmod_st_lohi.s         |  625 ++++
 tests/tcg/bfin/c_linkage.s                  |   60 +
 tests/tcg/bfin/c_logi2op_alshft_mix.s       |  143 +
 tests/tcg/bfin/c_logi2op_arith_shft.s       |  223 ++
 tests/tcg/bfin/c_logi2op_bitclr.s           |   92 +
 tests/tcg/bfin/c_logi2op_bitset.s           |   92 +
 tests/tcg/bfin/c_logi2op_bittgl.s           |  165 +
 tests/tcg/bfin/c_logi2op_bittst.s           |  583 ++++
 tests/tcg/bfin/c_logi2op_log_l_shft.s       |  222 ++
 tests/tcg/bfin/c_logi2op_log_l_shft_astat.S |   82 +
 tests/tcg/bfin/c_logi2op_log_r_shft.s       |  222 ++
 tests/tcg/bfin/c_logi2op_log_r_shft_astat.S |   82 +
 tests/tcg/bfin/c_logi2op_nbittst.s          |  584 ++++
 tests/tcg/bfin/c_loopsetup_nested.s         |  166 +
 tests/tcg/bfin/c_loopsetup_nested_bot.s     |  165 +
 tests/tcg/bfin/c_loopsetup_nested_prelc.s   |  184 +
 tests/tcg/bfin/c_loopsetup_nested_top.s     |  166 +
 tests/tcg/bfin/c_loopsetup_overlap.s        |  167 +
 tests/tcg/bfin/c_loopsetup_preg_div2_lc0.s  |   95 +
 tests/tcg/bfin/c_loopsetup_preg_div2_lc1.s  |   94 +
 tests/tcg/bfin/c_loopsetup_preg_lc0.s       |   95 +
 tests/tcg/bfin/c_loopsetup_preg_lc1.s       |   93 +
 tests/tcg/bfin/c_loopsetup_prelc.s          |  145 +
 tests/tcg/bfin/c_loopsetup_topbotcntr.s     |  110 +
 tests/tcg/bfin/c_progctrl_call_pcpr.s       |   63 +
 tests/tcg/bfin/c_progctrl_call_pr.s         |   32 +
 tests/tcg/bfin/c_progctrl_jump_pcpr.s       |   58 +
 tests/tcg/bfin/c_progctrl_jump_pr.s         |   56 +
 tests/tcg/bfin/c_progctrl_nop.s             |   55 +
 tests/tcg/bfin/c_progctrl_rts.s             |   36 +
 tests/tcg/bfin/c_ptr2op_pr_neg_pr.s         |  163 +
 tests/tcg/bfin/c_ptr2op_pr_sft_2_1.s        |  162 +
 tests/tcg/bfin/c_ptr2op_pr_shadd_1_2.s      |  167 +
 tests/tcg/bfin/c_pushpopmultiple_dp.s       |  213 ++
 tests/tcg/bfin/c_pushpopmultiple_dp_pair.s  |  203 ++
 tests/tcg/bfin/c_pushpopmultiple_dreg.s     |  173 +
 tests/tcg/bfin/c_pushpopmultiple_preg.s     |   83 +
 tests/tcg/bfin/c_regmv_acc_acc.s            |  125 +
 tests/tcg/bfin/c_regmv_dag_lz_dep.s         |  148 +
 tests/tcg/bfin/c_regmv_dr_acc_acc.s         |  191 ++
 tests/tcg/bfin/c_regmv_dr_dep_nostall.s     |  245 ++
 tests/tcg/bfin/c_regmv_dr_dr.s              |  209 ++
 tests/tcg/bfin/c_regmv_dr_imlb.s            |  539 +++
 tests/tcg/bfin/c_regmv_dr_pr.s              |  107 +
 tests/tcg/bfin/c_regmv_imlb_dep_nostall.s   |  664 ++++
 tests/tcg/bfin/c_regmv_imlb_dep_stall.s     |  335 ++
 tests/tcg/bfin/c_regmv_imlb_dr.s            |  313 ++
 tests/tcg/bfin/c_regmv_imlb_imlb.s          |  925 ++++++
 tests/tcg/bfin/c_regmv_imlb_pr.s            |  302 ++
 tests/tcg/bfin/c_regmv_pr_dep_nostall.s     |  280 ++
 tests/tcg/bfin/c_regmv_pr_dep_stall.s       |  237 ++
 tests/tcg/bfin/c_regmv_pr_dr.s              |  147 +
 tests/tcg/bfin/c_regmv_pr_imlb.s            |  382 +++
 tests/tcg/bfin/c_regmv_pr_pr.s              |   95 +
 tests/tcg/bfin/c_ujump.s                    |   52 +
 tests/tcg/bfin/cc-astat-bits.s              |  101 +
 tests/tcg/bfin/cc1.s                        |   26 +
 tests/tcg/bfin/cir.s                        |   20 +
 tests/tcg/bfin/cir1.s                       |   84 +
 tests/tcg/bfin/cmpdreg.S                    |   40 +
 tests/tcg/bfin/compare.s                    |   15 +
 tests/tcg/bfin/d0.s                         |   31 +
 tests/tcg/bfin/d1.s                         |   17 +
 tests/tcg/bfin/d2.s                         |   56 +
 tests/tcg/bfin/div0.s                       |   37 +
 tests/tcg/bfin/divq.s                       | 1322 ++++++++
 tests/tcg/bfin/dotproduct.s                 |  304 ++
 tests/tcg/bfin/dotproduct2.s                |  299 ++
 tests/tcg/bfin/dsp_d0.s                     |   31 +
 tests/tcg/bfin/dsp_d1.s                     |  117 +
 tests/tcg/bfin/edn_snafu.s                  |   45 +
 tests/tcg/bfin/events.s                     |   44 +
 tests/tcg/bfin/fact.s                       |   47 +
 tests/tcg/bfin/fsm.s                        |   57 +
 tests/tcg/bfin/greg2.s                      |   18 +
 tests/tcg/bfin/hwloop-branch-in.s           |   99 +
 tests/tcg/bfin/hwloop-branch-out.s          |  129 +
 tests/tcg/bfin/hwloop-lt-bits.s             |   25 +
 tests/tcg/bfin/hwloop-nested.s              |   33 +
 tests/tcg/bfin/i0.s                         |   57 +
 tests/tcg/bfin/issue113.s                   |   18 +
 tests/tcg/bfin/issue126.s                   |   19 +
 tests/tcg/bfin/issue129.s                   |   36 +
 tests/tcg/bfin/issue144.s                   |   31 +
 tests/tcg/bfin/issue83.s                    |   93 +
 tests/tcg/bfin/issue89.s                    |   30 +
 tests/tcg/bfin/l0.s                         |  137 +
 tests/tcg/bfin/l0shift.s                    |   13 +
 tests/tcg/bfin/l2_loop.s                    |   28 +
 tests/tcg/bfin/link-2.s                     |   24 +
 tests/tcg/bfin/link.s                       |   67 +
 tests/tcg/bfin/load.s                       |  239 ++
 tests/tcg/bfin/logic.s                      |   64 +
 tests/tcg/bfin/loop_snafu.s                 |   28 +
 tests/tcg/bfin/loop_strncpy.s               |   76 +
 tests/tcg/bfin/lp0.s                        |   17 +
 tests/tcg/bfin/lp1.s                        |   16 +
 tests/tcg/bfin/lsetup.s                     |  109 +
 tests/tcg/bfin/m0boundary.s                 |   46 +
 tests/tcg/bfin/m17.s                        |   74 +
 tests/tcg/bfin/max_min_flags.s              |  275 ++
 tests/tcg/bfin/mem3.s                       |   42 +
 tests/tcg/bfin/move.s                       |   36 +
 tests/tcg/bfin/neg.S                        |   42 +
 tests/tcg/bfin/nshift.s                     |   33 +
 tests/tcg/bfin/pr.s                         |   81 +
 tests/tcg/bfin/push-pop-multiple.s          |  169 +
 tests/tcg/bfin/push-pop.s                   |   78 +
 tests/tcg/bfin/pushpopreg_1.s               |  292 ++
 tests/tcg/bfin/s0.s                         |   12 +
 tests/tcg/bfin/s1.s                         |   25 +
 tests/tcg/bfin/s10.s                        |   77 +
 tests/tcg/bfin/s15.s                        |  149 +
 tests/tcg/bfin/s16.s                        |  170 +
 tests/tcg/bfin/s17.s                        |   46 +
 tests/tcg/bfin/s2.s                         |   47 +
 tests/tcg/bfin/s20.s                        |   25 +
 tests/tcg/bfin/s21.s                        |  298 ++
 tests/tcg/bfin/s4.s                         |  214 ++
 tests/tcg/bfin/s5.s                         |  107 +
 tests/tcg/bfin/s6.s                         |   83 +
 tests/tcg/bfin/s7.s                         |   83 +
 tests/tcg/bfin/s8.s                         |   55 +
 tests/tcg/bfin/s9.s                         |  134 +
 tests/tcg/bfin/se_kills2.S                  |  148 +
 tests/tcg/bfin/se_rets_hazard.s             |   55 +
 tests/tcg/bfin/sign.s                       |   27 +
 tests/tcg/bfin/simple0.s                    |   10 +
 tests/tcg/bfin/stk.s                        |   78 +
 tests/tcg/bfin/stk2.s                       |  107 +
 tests/tcg/bfin/stk3.s                       |  106 +
 tests/tcg/bfin/stk4.s                       |  110 +
 tests/tcg/bfin/stk5.s                       |   34 +
 tests/tcg/bfin/stk6.s                       |   58 +
 tests/tcg/bfin/tar10622.s                   |   20 +
 tests/tcg/bfin/test.h                       |  134 +
 tests/tcg/bfin/testset.s                    |   73 +
 tests/tcg/bfin/testset2.s                   |   37 +
 tests/tcg/bfin/testutils.inc                |  258 ++
 tests/tcg/bfin/vec-abs.S                    |   42 +
 tests/tcg/bfin/vecadd.s                     |   65 +
 tests/tcg/bfin/vit_max.s                    |   57 +
 tests/tcg/bfin/wtf.s                        |   26 +
 tests/tcg/bfin/zcall.s                      |   44 +
 460 files changed, 101757 insertions(+), 8 deletions(-)
 create mode 100644 default-configs/bfin-linux-user.mak
 create mode 100644 disas/bfin.c
 create mode 100644 linux-user/bfin/syscall.h
 create mode 100644 linux-user/bfin/syscall_nr.h
 create mode 100644 linux-user/bfin/target_flat.h
 create mode 100644 linux-user/bfin/target_sigcontext.h
 create mode 100644 linux-user/bfin/target_signal.h
 create mode 100644 linux-user/bfin/termbits.h
 create mode 100644 linux-user/target_ucontext.h
 create mode 100644 target-bfin/Makefile.objs
 create mode 100644 target-bfin/README
 create mode 100644 target-bfin/TODO
 create mode 100644 target-bfin/bfin-sim.c
 create mode 100644 target-bfin/bfin-tdep.h
 create mode 100644 target-bfin/cpu-qom.h
 create mode 100644 target-bfin/cpu.c
 create mode 100644 target-bfin/cpu.h
 create mode 100644 target-bfin/helper.c
 create mode 100644 target-bfin/helper.h
 create mode 100644 target-bfin/linux-fixed-code.h
 create mode 100644 target-bfin/op_helper.c
 create mode 100644 target-bfin/opcode/bfin.h
 create mode 100644 target-bfin/translate.c
 create mode 100644 tests/tcg/bfin/.gitignore
 create mode 100644 tests/tcg/bfin/10272_small.s
 create mode 100644 tests/tcg/bfin/10436.s
 create mode 100644 tests/tcg/bfin/10622.s
 create mode 100644 tests/tcg/bfin/10742.s
 create mode 100644 tests/tcg/bfin/10799.s
 create mode 100644 tests/tcg/bfin/7641.s
 create mode 100644 tests/tcg/bfin/Makefile
 create mode 100644 tests/tcg/bfin/a0.s
 create mode 100644 tests/tcg/bfin/a1.s
 create mode 100644 tests/tcg/bfin/a10.s
 create mode 100644 tests/tcg/bfin/a2.s
 create mode 100644 tests/tcg/bfin/a24.s
 create mode 100644 tests/tcg/bfin/a25.s
 create mode 100644 tests/tcg/bfin/a26.s
 create mode 100644 tests/tcg/bfin/a3.s
 create mode 100644 tests/tcg/bfin/a4.s
 create mode 100644 tests/tcg/bfin/a7.s
 create mode 100644 tests/tcg/bfin/a8.s
 create mode 100644 tests/tcg/bfin/a9.s
 create mode 100644 tests/tcg/bfin/abs-2.S
 create mode 100644 tests/tcg/bfin/abs-3.S
 create mode 100644 tests/tcg/bfin/abs.S
 create mode 100644 tests/tcg/bfin/acc-rot.s
 create mode 100644 tests/tcg/bfin/acp5_19.s
 create mode 100644 tests/tcg/bfin/add_imm7.s
 create mode 100644 tests/tcg/bfin/algnbug1.s
 create mode 100644 tests/tcg/bfin/algnbug2.s
 create mode 100644 tests/tcg/bfin/b0.S
 create mode 100644 tests/tcg/bfin/b1.s
 create mode 100644 tests/tcg/bfin/b2.S
 create mode 100644 tests/tcg/bfin/brcc.s
 create mode 100644 tests/tcg/bfin/brevadd.s
 create mode 100644 tests/tcg/bfin/byteunpack.s
 create mode 100644 tests/tcg/bfin/c_alu2op_arith_r_sft.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_b.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_h.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_mix.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_neg.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_toggle.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_xb.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_xh.s
 create mode 100644 tests/tcg/bfin/c_alu2op_divq.s
 create mode 100644 tests/tcg/bfin/c_alu2op_divs.s
 create mode 100644 tests/tcg/bfin/c_alu2op_log_l_sft.s
 create mode 100644 tests/tcg/bfin/c_alu2op_log_r_sft.s
 create mode 100644 tests/tcg/bfin/c_alu2op_shadd_1.s
 create mode 100644 tests/tcg/bfin/c_alu2op_shadd_2.s
 create mode 100644 tests/tcg/bfin/c_br_preg_killed_ac.s
 create mode 100644 tests/tcg/bfin/c_br_preg_killed_ex1.s
 create mode 100644 tests/tcg/bfin/c_br_preg_stall_ac.s
 create mode 100644 tests/tcg/bfin/c_br_preg_stall_ex1.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp1.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp2.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp3.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp4.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_bp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_brt_bp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_brt_nbp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_fbkwd.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_nbp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brt_bp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brt_nbp.s
 create mode 100644 tests/tcg/bfin/c_calla_ljump.s
 create mode 100644 tests/tcg/bfin/c_calla_subr.s
 create mode 100644 tests/tcg/bfin/c_cc2dreg.s
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_ac.S
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_an.s
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_aq.s
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_av0.S
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_av1.S
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_az.s
 create mode 100644 tests/tcg/bfin/c_cc_flag_ccmv_depend.S
 create mode 100644 tests/tcg/bfin/c_cc_flagdreg_mvbrsft.s
 create mode 100644 tests/tcg/bfin/c_cc_regmvlogi_mvbrsft.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_dr_uu.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_imm3.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_imm3_uu.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_imm3.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_imm3_uu.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_pr_uu.s
 create mode 100644 tests/tcg/bfin/c_ccmv_cc_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_cc_dr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_cc_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_ncc_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_ncc_dr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_ncc_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_and_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_minus_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_mix.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_or_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_plus_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_xor_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh1.s
 create mode 100644 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh2.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_add_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_add_i7_p.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_eq_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_eq_i7_p.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_flags.S
 create mode 100644 tests/tcg/bfin/c_compi2opd_flags_2.S
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_add_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_add_i7_p.s
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_eq_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_eq_i7_p.s
 create mode 100644 tests/tcg/bfin/c_dagmodik_lnz_imgebl.s
 create mode 100644 tests/tcg/bfin/c_dagmodik_lnz_imltbl.s
 create mode 100644 tests/tcg/bfin/c_dagmodik_lz_inc_dec.s
 create mode 100644 tests/tcg/bfin/c_dagmodim_lnz_imgebl.s
 create mode 100644 tests/tcg/bfin/c_dagmodim_lnz_imltbl.s
 create mode 100644 tests/tcg/bfin/c_dagmodim_lz_inc_dec.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_a_neg_a.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_aa_absabs.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_aa_negneg.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_abs.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_absabs.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_awx.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_bytepack.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_byteunpack.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_disalnexcpt.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_max.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_maxmax.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_min.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_minmin.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_rr_lph_a1a0.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_search.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_sgn.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_a1a0.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a0.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a0_i.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a0_m.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a1.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a1_i.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a1_m.s
 create mode 100644 tests/tcg/bfin/c_dsp32mult_pair_m.s
 create mode 100644 tests/tcg/bfin/c_dsp32mult_pair_m_i.s
 create mode 100644 tests/tcg/bfin/c_dsp32mult_pair_m_u.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_a0alr.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_af.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rn_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rp_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_align16.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_align24.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_align8.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_fdepx.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_fextx.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lf.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ones.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_pack.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_rot.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_rot_mix.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_signbits_r.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_signbits_rh.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_signbits_rl.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_vmax.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_vmaxvmax.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_a0alr.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_af.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_af_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahh.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_amix.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lf.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhh.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lmix.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_rot.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_dr_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_dr_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_dr_ippm.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drhi_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drhi_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drlo_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drlo_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_dr_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_dr_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_dr_ippm.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drhi_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drhi_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drlo_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drlo_ipp.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_drhi.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_drlo.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_h_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_h_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_h_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_l_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_l_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_l_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lz_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lz_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lz_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lzhi_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lzhi_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lzhi_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_pibml.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_xb.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_xh.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_xb.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_xh.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_ppmm_hbx.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_xb.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_xh.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_p_p.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_p_p_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_p_p_pp.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_mm_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_mm_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_pp.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_pp_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_pp_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_p.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_p_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_p_pp.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_b.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_xb.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_xh.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_dr_b.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_dr_xh.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_st_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstii_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_st_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_ld_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_st_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_dr_hi.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_dr_lo.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_h_xh.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_lohi.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_dr_hi.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_dr_lo.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_lohi.s
 create mode 100644 tests/tcg/bfin/c_linkage.s
 create mode 100644 tests/tcg/bfin/c_logi2op_alshft_mix.s
 create mode 100644 tests/tcg/bfin/c_logi2op_arith_shft.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bitclr.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bitset.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bittgl.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bittst.s
 create mode 100644 tests/tcg/bfin/c_logi2op_log_l_shft.s
 create mode 100644 tests/tcg/bfin/c_logi2op_log_l_shft_astat.S
 create mode 100644 tests/tcg/bfin/c_logi2op_log_r_shft.s
 create mode 100644 tests/tcg/bfin/c_logi2op_log_r_shft_astat.S
 create mode 100644 tests/tcg/bfin/c_logi2op_nbittst.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested_bot.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested_prelc.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested_top.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_overlap.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_div2_lc0.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_div2_lc1.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_lc0.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_lc1.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_prelc.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_topbotcntr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_call_pcpr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_call_pr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_jump_pcpr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_jump_pr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_nop.s
 create mode 100644 tests/tcg/bfin/c_progctrl_rts.s
 create mode 100644 tests/tcg/bfin/c_ptr2op_pr_neg_pr.s
 create mode 100644 tests/tcg/bfin/c_ptr2op_pr_sft_2_1.s
 create mode 100644 tests/tcg/bfin/c_ptr2op_pr_shadd_1_2.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_dp.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_dp_pair.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_dreg.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_preg.s
 create mode 100644 tests/tcg/bfin/c_regmv_acc_acc.s
 create mode 100644 tests/tcg/bfin/c_regmv_dag_lz_dep.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_acc_acc.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_dep_nostall.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_imlb.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_pr.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_dep_nostall.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_dep_stall.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_dr.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_imlb.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_pr.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_dep_nostall.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_dep_stall.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_dr.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_imlb.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_ujump.s
 create mode 100644 tests/tcg/bfin/cc-astat-bits.s
 create mode 100644 tests/tcg/bfin/cc1.s
 create mode 100644 tests/tcg/bfin/cir.s
 create mode 100644 tests/tcg/bfin/cir1.s
 create mode 100644 tests/tcg/bfin/cmpdreg.S
 create mode 100644 tests/tcg/bfin/compare.s
 create mode 100644 tests/tcg/bfin/d0.s
 create mode 100644 tests/tcg/bfin/d1.s
 create mode 100644 tests/tcg/bfin/d2.s
 create mode 100644 tests/tcg/bfin/div0.s
 create mode 100644 tests/tcg/bfin/divq.s
 create mode 100644 tests/tcg/bfin/dotproduct.s
 create mode 100644 tests/tcg/bfin/dotproduct2.s
 create mode 100644 tests/tcg/bfin/dsp_d0.s
 create mode 100644 tests/tcg/bfin/dsp_d1.s
 create mode 100644 tests/tcg/bfin/edn_snafu.s
 create mode 100644 tests/tcg/bfin/events.s
 create mode 100644 tests/tcg/bfin/fact.s
 create mode 100644 tests/tcg/bfin/fsm.s
 create mode 100644 tests/tcg/bfin/greg2.s
 create mode 100644 tests/tcg/bfin/hwloop-branch-in.s
 create mode 100644 tests/tcg/bfin/hwloop-branch-out.s
 create mode 100644 tests/tcg/bfin/hwloop-lt-bits.s
 create mode 100644 tests/tcg/bfin/hwloop-nested.s
 create mode 100644 tests/tcg/bfin/i0.s
 create mode 100644 tests/tcg/bfin/issue113.s
 create mode 100644 tests/tcg/bfin/issue126.s
 create mode 100644 tests/tcg/bfin/issue129.s
 create mode 100644 tests/tcg/bfin/issue144.s
 create mode 100644 tests/tcg/bfin/issue83.s
 create mode 100644 tests/tcg/bfin/issue89.s
 create mode 100644 tests/tcg/bfin/l0.s
 create mode 100644 tests/tcg/bfin/l0shift.s
 create mode 100644 tests/tcg/bfin/l2_loop.s
 create mode 100644 tests/tcg/bfin/link-2.s
 create mode 100644 tests/tcg/bfin/link.s
 create mode 100644 tests/tcg/bfin/load.s
 create mode 100644 tests/tcg/bfin/logic.s
 create mode 100644 tests/tcg/bfin/loop_snafu.s
 create mode 100644 tests/tcg/bfin/loop_strncpy.s
 create mode 100644 tests/tcg/bfin/lp0.s
 create mode 100644 tests/tcg/bfin/lp1.s
 create mode 100644 tests/tcg/bfin/lsetup.s
 create mode 100644 tests/tcg/bfin/m0boundary.s
 create mode 100644 tests/tcg/bfin/m17.s
 create mode 100644 tests/tcg/bfin/max_min_flags.s
 create mode 100644 tests/tcg/bfin/mem3.s
 create mode 100644 tests/tcg/bfin/move.s
 create mode 100644 tests/tcg/bfin/neg.S
 create mode 100644 tests/tcg/bfin/nshift.s
 create mode 100644 tests/tcg/bfin/pr.s
 create mode 100644 tests/tcg/bfin/push-pop-multiple.s
 create mode 100644 tests/tcg/bfin/push-pop.s
 create mode 100644 tests/tcg/bfin/pushpopreg_1.s
 create mode 100644 tests/tcg/bfin/s0.s
 create mode 100644 tests/tcg/bfin/s1.s
 create mode 100644 tests/tcg/bfin/s10.s
 create mode 100644 tests/tcg/bfin/s15.s
 create mode 100644 tests/tcg/bfin/s16.s
 create mode 100644 tests/tcg/bfin/s17.s
 create mode 100644 tests/tcg/bfin/s2.s
 create mode 100644 tests/tcg/bfin/s20.s
 create mode 100644 tests/tcg/bfin/s21.s
 create mode 100644 tests/tcg/bfin/s4.s
 create mode 100644 tests/tcg/bfin/s5.s
 create mode 100644 tests/tcg/bfin/s6.s
 create mode 100644 tests/tcg/bfin/s7.s
 create mode 100644 tests/tcg/bfin/s8.s
 create mode 100644 tests/tcg/bfin/s9.s
 create mode 100644 tests/tcg/bfin/se_kills2.S
 create mode 100644 tests/tcg/bfin/se_rets_hazard.s
 create mode 100644 tests/tcg/bfin/sign.s
 create mode 100644 tests/tcg/bfin/simple0.s
 create mode 100644 tests/tcg/bfin/stk.s
 create mode 100644 tests/tcg/bfin/stk2.s
 create mode 100644 tests/tcg/bfin/stk3.s
 create mode 100644 tests/tcg/bfin/stk4.s
 create mode 100644 tests/tcg/bfin/stk5.s
 create mode 100644 tests/tcg/bfin/stk6.s
 create mode 100644 tests/tcg/bfin/tar10622.s
 create mode 100644 tests/tcg/bfin/test.h
 create mode 100644 tests/tcg/bfin/testset.s
 create mode 100644 tests/tcg/bfin/testset2.s
 create mode 100644 tests/tcg/bfin/testutils.inc
 create mode 100644 tests/tcg/bfin/vec-abs.S
 create mode 100644 tests/tcg/bfin/vecadd.s
 create mode 100644 tests/tcg/bfin/vit_max.s
 create mode 100644 tests/tcg/bfin/wtf.s
 create mode 100644 tests/tcg/bfin/zcall.s
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH 1/5 Blackfin: add disassembler support

---
 configure                 |    4 +
 disas.c                   |    9 +
 disas/Makefile.objs       |    1 +
 disas/bfin.c              | 4791 +++++++++++++++++++++++++++++++++++++++++++++
 include/disas/bfd.h       |    3 +
 target-bfin/opcode/bfin.h | 1754 +++++++++++++++++
 6 files changed, 6562 insertions(+)
 create mode 100644 disas/bfin.c
 create mode 100644 target-bfin/opcode/bfin.h
configure +4 -0
index 60b0811..bc7a9c0 100755
@@ -4331,6 +4331,10 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
     echo "CONFIG_ARM_DIS=y"  >> $config_target_mak
     echo "CONFIG_ARM_DIS=y"  >> config-all-disas.mak
   ;;
+  bfin)
+    echo "CONFIG_BFIN_DIS=y"  >> $config_target_mak
+    echo "CONFIG_BFIN_DIS=y"  >> config-all-disas.mak
+  ;;
   cris)
     echo "CONFIG_CRIS_DIS=y"  >> $config_target_mak
     echo "CONFIG_CRIS_DIS=y"  >> config-all-disas.mak
disas.c +9 -0
index e51127e..3748a30 100644
@@ -208,6 +208,9 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
         s.info.endian = BFD_ENDIAN_BIG;
 #endif
     }
+#elif defined(TARGET_BFIN)
+    s.info.mach = bfd_mach_bfin;
+    print_insn = print_insn_bfin;
 #elif defined(TARGET_SPARC)
     print_insn = print_insn_sparc;
 #ifdef TARGET_SPARC64
@@ -335,6 +338,9 @@ void disas(FILE *out, void *code, unsigned long size)
     s.info.mach = bfd_mach_sparc_v9b;
 #elif defined(__arm__)
     print_insn = print_insn_arm;
+#elif defined(__bfin__)
+    s.info.mach = bfd_mach_bfin;
+    print_insn = print_insn_bfin;
 #elif defined(__MIPSEB__)
     print_insn = print_insn_big_mips;
 #elif defined(__MIPSEL__)
@@ -439,6 +445,9 @@ void monitor_disas(Monitor *mon, CPUArchState *env,
     print_insn = print_insn_i386;
 #elif defined(TARGET_ARM)
     print_insn = print_insn_arm;
+#elif defined(TARGET_BFIN)
+    s.info.mach = bfd_mach_bfin;
+    print_insn = print_insn_bfin;
 #elif defined(TARGET_ALPHA)
     print_insn = print_insn_alpha;
 #elif defined(TARGET_SPARC)
disas/Makefile.objs +1 -0
index 3b1e77a..3f190c6 100644
@@ -1,5 +1,6 @@
 common-obj-$(CONFIG_ALPHA_DIS) += alpha.o
 common-obj-$(CONFIG_ARM_DIS) += arm.o
+common-obj-$(CONFIG_BFIN_DIS) += bfin.o
 common-obj-$(CONFIG_CRIS_DIS) += cris.o
 common-obj-$(CONFIG_HPPA_DIS) += hppa.o
 common-obj-$(CONFIG_I386_DIS) += i386.o
disas/bfin.c new file +4791 -0

2,957 lines not on this page · raw message

include/disas/bfd.h +3 -0
index 803b6ef..27dff70 100644

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

target-bfin/opcode/bfin.h new file +1754 -0

1,754 lines not on this page · raw message

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

Signature · 1 line
1.8.2.1

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

#2 lore raw

PATCH 2/5 Blackfin: initial port

In reply to Mike Frysinger

This is the core Blackfin support. While most things work that gcc will generate, there are notable things missing at this point:
- many dsp/alu/mac insns not supported
- no saturation support
- many astat flags not updated
- probably other stuff
Details as to what is missing "by design" vs "not done due to laziness" can be sorted out in the Blackfin README/TODO files.

FLAT and FDPIC ELFs however seem to work nicely, as do random samplings of apps from a typical build.

---
 MAINTAINERS                    |    5 +
 configure                      |    4 +
 cpu-exec.c                     |    5 +-
 gdbstub.c                      |  103 ++
 include/elf.h                  |    6 +
 qapi-schema.json               |    9 +-
 scripts/qemu-binfmt-conf.sh    |    4 +
 target-bfin/Makefile.objs      |    3 +
 target-bfin/README             |   32 +
 target-bfin/TODO               |   25 +
 target-bfin/bfin-sim.c         | 3666 ++++++++++++++++++++++++++++++++++++++++
 target-bfin/bfin-tdep.h        |   94 ++
 target-bfin/cpu-qom.h          |   61 +
 target-bfin/cpu.c              |   55 +
 target-bfin/cpu.h              |  236 +++
 target-bfin/helper.c           |   37 +
 target-bfin/helper.h           |   23 +
 target-bfin/linux-fixed-code.h |   23 +
 target-bfin/op_helper.c        |  229 +++
 target-bfin/translate.c        | 1347 +++++++++++++++
 20 files changed, 5962 insertions(+), 5 deletions(-)
 create mode 100644 target-bfin/Makefile.objs
 create mode 100644 target-bfin/README
 create mode 100644 target-bfin/TODO
 create mode 100644 target-bfin/bfin-sim.c
 create mode 100644 target-bfin/bfin-tdep.h
 create mode 100644 target-bfin/cpu-qom.h
 create mode 100644 target-bfin/cpu.c
 create mode 100644 target-bfin/cpu.h
 create mode 100644 target-bfin/helper.c
 create mode 100644 target-bfin/helper.h
 create mode 100644 target-bfin/linux-fixed-code.h
 create mode 100644 target-bfin/op_helper.c
 create mode 100644 target-bfin/translate.c
MAINTAINERS +5 -0
index 3412b07..9563bb7 100644
@@ -69,6 +69,11 @@ F: target-arm/
 F: hw/arm/
 F: hw/cpu/a*mpcore.c
 
+Blackfin
+M: Mike Frysinger <[email protected]>
+S: Maintained
+F: target-bfin/
+
 CRIS
 M: Edgar E. Iglesias <[email protected]>
 S: Maintained
configure +4 -0
index bc7a9c0..95dc66b 100755
@@ -4146,6 +4146,10 @@ case "$target_arch2" in
     target_nptl="yes"
     gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
   ;;
+  bfin)
+    bflt="yes"
+    target_phys_bits=32
+  ;;
   cris)
     target_nptl="yes"
   ;;
cpu-exec.c +4 -1
index ec46380..98a99d8 100644
@@ -249,6 +249,7 @@ int cpu_exec(CPUArchState *env)
 #elif defined(TARGET_MOXIE)
 #elif defined(TARGET_OPENRISC)
 #elif defined(TARGET_SH4)
+#elif defined(TARGET_BFIN)
 #elif defined(TARGET_CRIS)
 #elif defined(TARGET_S390X)
 #elif defined(TARGET_XTENSA)
@@ -302,7 +303,8 @@ int cpu_exec(CPUArchState *env)
                     }
 #if defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_MIPS) || \
     defined(TARGET_PPC) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) || \
-    defined(TARGET_MICROBLAZE) || defined(TARGET_LM32) || defined(TARGET_UNICORE32)
+    defined(TARGET_MICROBLAZE) || defined(TARGET_LM32) || defined(TARGET_UNICORE32) || \
+    defined(TARGET_BFIN)
                     if (interrupt_request & CPU_INTERRUPT_HALT) {
                         cpu->interrupt_request &= ~CPU_INTERRUPT_HALT;
                         cpu->halted = 1;
@@ -698,6 +700,7 @@ int cpu_exec(CPUArchState *env)
 #elif defined(TARGET_MOXIE)
 #elif defined(TARGET_OPENRISC)
 #elif defined(TARGET_SH4)
+#elif defined(TARGET_BFIN)
 #elif defined(TARGET_ALPHA)
 #elif defined(TARGET_CRIS)
 #elif defined(TARGET_S390X)
gdbstub.c +103 -0

115 lines not on this page · raw message

include/elf.h +6 -0
index cf0d3e2..110e7b8 100644
@@ -104,6 +104,7 @@ typedef int64_t  Elf64_Sxword;
 
 #define EM_H8_300H      47      /* Hitachi H8/300H */
 #define EM_H8S          48      /* Hitachi H8S     */
+#define EM_BLACKFIN	106	/* Analog Devices Blackfin */
 #define EM_LATTICEMICO32 138    /* LatticeMico32 */
 
 #define EM_OPENRISC     92        /* OpenCores OpenRISC */
@@ -848,6 +849,11 @@ typedef struct {
 
 #define EF_ALPHA_32BIT		1	/* All addresses are below 2GB */
 
+/* Blackfin specific definitions.  */
+
+#define EF_BFIN_PIC		0x00000001	/* -fpic */
+#define EF_BFIN_FDPIC		0x00000002      /* -mfdpic */
+
 /* HPPA specific definitions.  */
 
 /* Legal values for e_flags field of Elf32_Ehdr.  */
qapi-schema.json +5 -4
index 5ad6894..c7f4304 100644
@@ -3023,10 +3023,11 @@
 # Since: 1.2.0
 ##
 { 'enum': 'TargetType',
-  'data': [ 'alpha', 'arm', 'cris', 'i386', 'lm32', 'm68k', 'microblazeel',
-            'microblaze', 'mips64el', 'mips64', 'mipsel', 'mips', 'moxie',
-            'or32', 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb', 'sh4',
-            'sparc64', 'sparc', 'unicore32', 'x86_64', 'xtensaeb', 'xtensa' ] }
+  'data': [ 'alpha', 'arm', 'bfin', 'cris', 'i386', 'lm32', 'm68k',
+            'microblazeel', 'microblaze', 'mips64el', 'mips64', 'mipsel',
+            'mips', 'moxie', 'or32', 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb',
+            'sh4', 'sparc64', 'sparc', 'unicore32', 'x86_64', 'xtensaeb',
+            'xtensa' ] }
 
 ##
 # @TargetInfo:
scripts/qemu-binfmt-conf.sh +4 -0
index 0da2618..52b9ef7 100644
@@ -41,6 +41,10 @@ if [ $cpu != "arm" ] ; then
     echo   ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
     echo   ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
 fi
+if [ $cpu != "bfin" ] ; then
+    echo   ':bfin:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00''\x02\x00''\x6A\x00''::/usr/local/bin/qemu-bfin:' > /proc/sys/fs/binfmt_misc/register
+    echo   ':bfin-flat:M::bFLT\x00\x00\x00\x04::/usr/local/bin/qemu-bfin:' > /proc/sys/fs/binfmt_misc/register
+fi
 if [ $cpu != "sparc" ] ; then
     echo   ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
 fi
target-bfin/Makefile.objs new file +3 -0
new file mode 100644
index 0000000..7e6c528
@@ -0,0 +1,3 @@
+obj-y += translate.o op_helper.o helper.o cpu.o
+
+$(obj)/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
target-bfin/README new file +32 -0
new file mode 100644
index 0000000..25f7fde
@@ -0,0 +1,32 @@
+------------------
+Blackfin QEMU port
+------------------
+
+There are some things we don't bother handling in the port for speed reasons.
+If you want an accurate (but not as fast) simulator, then use the GNU sim as
+found in the GNU toolchain (part of gdb).
+
+Things we do not currently handle by design:
+
+	- invalid parallel instruction combinations
+		- no toolchain will output these
+		- things like jumps
+
+	- invalid register combinations
+		- some insns cannot have same register be both source and dest
+		- no toolchain will output these
+
+	- transactional parallel instructions
+		- on the hardware, if a load/store causes an exception, the other
+		  insns do not change register states either.  in qemu, they do,
+		  but since those exceptions will kill the program anyways, who
+		  cares.  no intermediate store buffers!
+
+	- AC0_COPY and V_COPY
+		- no one has ever used these instead of AC0 or V
+
+	- no support for RND_MOD
+
+There are a few insns/modes we don't currently handle, but it's more a matter
+of nothing really uses these, so we haven't bothered.  If these matter to you,
+then feel free to request support for them.
target-bfin/TODO new file +25 -0
new file mode 100644
index 0000000..80802bd
@@ -0,0 +1,25 @@
+CEC behavior in user-emulation (SP vs USP)
+
+see if making a global "0", "1", "2", and "4" register speeds things up
+
+TB chaining is not implemented
+
+we often over-translate code blocks.  consider a bfin mem/str func:
+	{
+	[1] setup code
+	[2] hwloop0
+	[3] some other stuff
+	[4] hwloop1
+	[5] clean up / return
+	}
+the first TB will go from the start to the end (since there are no
+unconditional branches).  then when we hit the hwloop bottom, we jump
+back up to the top of the hwloop and a new TB which goes all the way
+to the end of the func.  so we end up with the TBs covering:
+	{1-5} {2-5} {3-5} {4-5} {5-5}
+In reality, we probably want to have the TBs to be like:
+	{[1] to LSETUP then to LT0 (usually the same)}
+	{[2] LT0 to LB0}
+	{[3] to LSETUP then to LT1 (usually the same)}
+	{[4] LT1 to LB1}
+	{[5]}
target-bfin/bfin-sim.c new file +3666 -0

2,738 lines not on this page · raw message

target-bfin/bfin-tdep.h new file +94 -0

94 lines not on this page · raw message

target-bfin/cpu-qom.h new file +61 -0

61 lines not on this page · raw message

target-bfin/cpu.c new file +55 -0

55 lines not on this page · raw message

target-bfin/cpu.h new file +236 -0

236 lines not on this page · raw message

target-bfin/helper.c new file +37 -0
new file mode 100644
index 0000000..79a15cf

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

target-bfin/helper.h new file +23 -0
new file mode 100644
index 0000000..9596721

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

target-bfin/linux-fixed-code.h new file +23 -0
new file mode 100644
index 0000000..a6dddc4

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

target-bfin/op_helper.c new file +229 -0

229 lines not on this page · raw message

target-bfin/translate.c new file +1347 -0

1,347 lines not on this page · raw message

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

Signature · 1 line
1.8.2.1

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

#3 lore raw

PATCH 3/5 Blackfin: add linux-user support

---
 default-configs/bfin-linux-user.mak |   1 +
 linux-user/bfin/syscall.h           |  59 ++++++
 linux-user/bfin/syscall_nr.h        | 389 ++++++++++++++++++++++++++++++++++++
 linux-user/bfin/target_flat.h       |  92 +++++++++
 linux-user/bfin/target_sigcontext.h |  61 ++++++
 linux-user/bfin/target_signal.h     |  31 +++
 linux-user/bfin/termbits.h          | 227 +++++++++++++++++++++
 linux-user/elfload.c                |  47 +++++
 linux-user/main.c                   | 160 +++++++++++++++
 linux-user/qemu.h                   |   4 +
 linux-user/signal.c                 | 225 +++++++++++++++++++++
 linux-user/syscall.c                |   3 +-
 linux-user/syscall_defs.h           |  65 +++++-
 linux-user/target_ucontext.h        |  14 ++
 14 files changed, 1375 insertions(+), 3 deletions(-)
 create mode 100644 default-configs/bfin-linux-user.mak
 create mode 100644 linux-user/bfin/syscall.h
 create mode 100644 linux-user/bfin/syscall_nr.h
 create mode 100644 linux-user/bfin/target_flat.h
 create mode 100644 linux-user/bfin/target_sigcontext.h
 create mode 100644 linux-user/bfin/target_signal.h
 create mode 100644 linux-user/bfin/termbits.h
 create mode 100644 linux-user/target_ucontext.h
default-configs/bfin-linux-user.mak new file +1 -0
new file mode 100644
index 0000000..5f7aefb
@@ -0,0 +1 @@
+# Default configuration for bfin-linux-user
linux-user/bfin/syscall.h new file +59 -0

59 lines not on this page · raw message

linux-user/bfin/syscall_nr.h new file +389 -0

389 lines not on this page · raw message

linux-user/bfin/target_flat.h new file +92 -0

92 lines not on this page · raw message

linux-user/bfin/target_sigcontext.h new file +61 -0

61 lines not on this page · raw message

linux-user/bfin/target_signal.h new file +31 -0
new file mode 100644
index 0000000..7367c0a
@@ -0,0 +1,31 @@
+#ifndef TARGET_SIGNAL_H
+#define TARGET_SIGNAL_H
+
+#include "cpu.h"
+
+/* this struct defines a stack used during syscall handling */
+
+typedef struct target_sigaltstack {
+	abi_ulong ss_sp;
+	abi_long ss_flags;
+	abi_ulong ss_size;
+} target_stack_t;
+
+
+/*
+ * sigaltstack controls
+ */
+#define TARGET_SS_ONSTACK	1
+#define TARGET_SS_DISABLE	2
+
+#define TARGET_MINSIGSTKSZ	2048
+#define TARGET_SIGSTKSZ		8192
+
+static inline abi_ulong get_sp_from_cpustate(CPUArchState *env)
+{
+	return env->spreg;
+}
+
+#define TARGET_SIGRETURN_STUB	0x400
+
+#endif /* TARGET_SIGNAL_H */
linux-user/bfin/termbits.h new file +227 -0

227 lines not on this page · raw message

linux-user/elfload.c +47 -0

59 lines not on this page · raw message

linux-user/main.c +160 -0

172 lines not on this page · raw message

linux-user/qemu.h +4 -0
index b10e957..819f268 100644
@@ -26,6 +26,10 @@
 #define THREAD
 #endif
 
+#ifdef TARGET_BFIN
+#define CONFIG_USE_FDPIC
+#endif
+
 /* This struct is used to hold certain information about the image.
  * Basically, it replicates in user space what would be certain
  * task_struct fields in the kernel
linux-user/signal.c +225 -0

231 lines not on this page · raw message

linux-user/syscall.c +2 -1
index cdd0c28..a9dce35 100644
@@ -7444,7 +7444,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_sigaltstack:
 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) || \
     defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA) || \
-    defined(TARGET_M68K) || defined(TARGET_S390X) || defined(TARGET_OPENRISC)
+    defined(TARGET_M68K) || defined(TARGET_S390X) || defined(TARGET_OPENRISC) || \
+    defined(TARGET_BFIN)
         ret = do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env));
         break;
 #else
linux-user/syscall_defs.h +63 -2

83 lines not on this page · raw message

linux-user/target_ucontext.h new file +14 -0
new file mode 100644
index 0000000..49706b4
@@ -0,0 +1,14 @@
+/* This is the asm-generic/ucontext.h version */
+
+#ifndef TARGET_UCONTEXT_H
+#define TARGET_UCONTEXT_H
+
+struct target_ucontext {
+    abi_ulong                tuc_flags;
+    abi_ulong                tuc_link;
+    target_stack_t           tuc_stack;
+    struct target_sigcontext tuc_mcontext;
+    target_sigset_t          tuc_sigmask;    /* mask last for extensibility */
+};
+
+#endif
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH 4/5 Blackfin: add test suite

In reply to Mike Frysinger

To run it, simply add the bfin-elf compiler to your PATH and do:
make -C tests/tcg/bfin

---
Deleted test content due to size (~2 MiB). It's all just Blackfin assembly at any rate.

Code can be found here:
git://sources.blackfin.uclinux.org/git/users/vapier/qemu.git
http://blackfin.uclinux.org/git/?p=users/vapier/qemu.git

 tests/tcg/Makefile                          |    4 +
 tests/tcg/bfin/.gitignore                   |    2 +
 tests/tcg/bfin/10272_small.s                |   51 ++
 tests/tcg/bfin/10436.s                      |   39 +
 tests/tcg/bfin/10622.s                      |   21 +
 tests/tcg/bfin/10742.s                      |   17 +
 tests/tcg/bfin/10799.s                      |   55 ++
 tests/tcg/bfin/7641.s                       |   38 +
 tests/tcg/bfin/Makefile                     |   80 ++
 tests/tcg/bfin/a0.s                         |   17 +
 tests/tcg/bfin/a1.s                         |   29 +
 tests/tcg/bfin/a10.s                        |  163 ++++
 tests/tcg/bfin/a2.s                         |  179 ++++
 tests/tcg/bfin/a24.s                        |   12 +
 tests/tcg/bfin/a25.s                        |   28 +
 tests/tcg/bfin/a26.s                        |   72 ++
 tests/tcg/bfin/a3.s                         |  313 +++++++
 tests/tcg/bfin/a4.s                         |   36 +
 tests/tcg/bfin/a7.s                         |  179 ++++
 tests/tcg/bfin/a8.s                         |   41 +
 tests/tcg/bfin/a9.s                         |  205 +++++
 tests/tcg/bfin/abs-2.S                      |   42 +
 tests/tcg/bfin/abs-3.S                      |   42 +
 tests/tcg/bfin/abs.S                        |   42 +
 tests/tcg/bfin/acc-rot.s                    |  129 +++
 tests/tcg/bfin/acp5_19.s                    |   12 +
 tests/tcg/bfin/add_imm7.s                   |   38 +
 tests/tcg/bfin/algnbug1.s                   |   38 +
 tests/tcg/bfin/algnbug2.s                   |   69 ++
 tests/tcg/bfin/b0.S                         |   51 ++
 tests/tcg/bfin/b1.s                         |   12 +
 tests/tcg/bfin/b2.S                         |   26 +
 tests/tcg/bfin/brcc.s                       |  164 ++++
 tests/tcg/bfin/brevadd.s                    |   20 +
 tests/tcg/bfin/byteunpack.s                 |   45 +
 tests/tcg/bfin/c_alu2op_arith_r_sft.s       |  226 +++++
 tests/tcg/bfin/c_alu2op_conv_b.s            |  211 +++++
 tests/tcg/bfin/c_alu2op_conv_h.s            |  211 +++++
 tests/tcg/bfin/c_alu2op_conv_mix.s          |  186 ++++
 tests/tcg/bfin/c_alu2op_conv_neg.s          |  211 +++++
 tests/tcg/bfin/c_alu2op_conv_toggle.s       |  211 +++++
 tests/tcg/bfin/c_alu2op_conv_xb.s           |  211 +++++
 tests/tcg/bfin/c_alu2op_conv_xh.s           |  212 +++++
 tests/tcg/bfin/c_alu2op_divq.s              |  220 +++++
 tests/tcg/bfin/c_alu2op_divs.s              |  220 +++++
 tests/tcg/bfin/c_alu2op_log_l_sft.s         |  220 +++++
 tests/tcg/bfin/c_alu2op_log_r_sft.s         |  217 +++++
 tests/tcg/bfin/c_alu2op_shadd_1.s           |  209 +++++
 tests/tcg/bfin/c_alu2op_shadd_2.s           |  209 +++++
 tests/tcg/bfin/c_br_preg_killed_ac.s        |   82 ++
 tests/tcg/bfin/c_br_preg_killed_ex1.s       |   85 ++
 tests/tcg/bfin/c_br_preg_stall_ac.s         |   75 ++
 tests/tcg/bfin/c_br_preg_stall_ex1.s        |   70 ++
 tests/tcg/bfin/c_brcc_bp1.s                 |   45 +
 tests/tcg/bfin/c_brcc_bp2.s                 |   45 +
 tests/tcg/bfin/c_brcc_bp3.s                 |   47 +
 tests/tcg/bfin/c_brcc_bp4.s                 |   46 +
 tests/tcg/bfin/c_brcc_brf_bp.s              |   46 +
 tests/tcg/bfin/c_brcc_brf_brt_bp.s          |   47 +
 tests/tcg/bfin/c_brcc_brf_brt_nbp.s         |   46 +
 tests/tcg/bfin/c_brcc_brf_fbkwd.s           |   46 +
 tests/tcg/bfin/c_brcc_brf_nbp.s             |   45 +
 tests/tcg/bfin/c_brcc_brt_bp.s              |   46 +
 tests/tcg/bfin/c_brcc_brt_nbp.s             |   45 +
 tests/tcg/bfin/c_calla_ljump.s              |   31 +
 tests/tcg/bfin/c_calla_subr.s               |   28 +
 tests/tcg/bfin/c_cc2dreg.s                  |   56 ++
 tests/tcg/bfin/c_cc2stat_cc_ac.S            |  240 +++++
 tests/tcg/bfin/c_cc2stat_cc_an.s            |  243 +++++
 tests/tcg/bfin/c_cc2stat_cc_aq.s            |  243 +++++
 tests/tcg/bfin/c_cc2stat_cc_av0.S           |  241 +++++
 tests/tcg/bfin/c_cc2stat_cc_av1.S           |  240 +++++
 tests/tcg/bfin/c_cc2stat_cc_az.s            |  243 +++++
 tests/tcg/bfin/c_cc_flag_ccmv_depend.S      |   82 ++
 tests/tcg/bfin/c_cc_flagdreg_mvbrsft.s      |   87 ++
 tests/tcg/bfin/c_cc_regmvlogi_mvbrsft.s     |   83 ++
 tests/tcg/bfin/c_ccflag_dr_dr.s             |  299 ++++++
 tests/tcg/bfin/c_ccflag_dr_dr_uu.s          |  299 ++++++
 tests/tcg/bfin/c_ccflag_dr_imm3.s           |  224 +++++
 tests/tcg/bfin/c_ccflag_dr_imm3_uu.s        |  221 +++++
 tests/tcg/bfin/c_ccflag_pr_imm3.s           |  539 +++++++++++
 tests/tcg/bfin/c_ccflag_pr_imm3_uu.s        |  238 +++++
 tests/tcg/bfin/c_ccflag_pr_pr.s             |  262 ++++++
 tests/tcg/bfin/c_ccflag_pr_pr_uu.s          |  212 +++++
 tests/tcg/bfin/c_ccmv_cc_dr_dr.s            |  124 +++
 tests/tcg/bfin/c_ccmv_cc_dr_pr.s            |   61 ++
 tests/tcg/bfin/c_ccmv_cc_pr_pr.s            |  111 +++
 tests/tcg/bfin/c_ccmv_ncc_dr_dr.s           |  123 +++
 tests/tcg/bfin/c_ccmv_ncc_dr_pr.s           |   60 ++
 tests/tcg/bfin/c_ccmv_ncc_pr_pr.s           |  111 +++
 tests/tcg/bfin/c_comp3op_dr_and_dr.s        |  412 +++++++++
 tests/tcg/bfin/c_comp3op_dr_minus_dr.s      |  412 +++++++++
 tests/tcg/bfin/c_comp3op_dr_mix.s           |  237 +++++
 tests/tcg/bfin/c_comp3op_dr_or_dr.s         |  412 +++++++++
 tests/tcg/bfin/c_comp3op_dr_plus_dr.s       |  412 +++++++++
 tests/tcg/bfin/c_comp3op_dr_xor_dr.s        |  412 +++++++++
 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh1.s   |  302 ++++++
 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh2.s   |  302 ++++++
 tests/tcg/bfin/c_compi2opd_dr_add_i7_n.s    |  164 ++++
 tests/tcg/bfin/c_compi2opd_dr_add_i7_p.s    |  147 +++
 tests/tcg/bfin/c_compi2opd_dr_eq_i7_n.s     |  166 ++++
 tests/tcg/bfin/c_compi2opd_dr_eq_i7_p.s     |  147 +++
 tests/tcg/bfin/c_compi2opd_flags.S          |  600 ++++++++++++
 tests/tcg/bfin/c_compi2opd_flags_2.S        |  600 ++++++++++++
 tests/tcg/bfin/c_compi2opp_pr_add_i7_n.s    |  149 +++
 tests/tcg/bfin/c_compi2opp_pr_add_i7_p.s    |  116 +++
 tests/tcg/bfin/c_compi2opp_pr_eq_i7_n.s     |  161 ++++
 tests/tcg/bfin/c_compi2opp_pr_eq_i7_p.s     |  131 +++
 tests/tcg/bfin/c_dagmodik_lnz_imgebl.s      |  290 ++++++
 tests/tcg/bfin/c_dagmodik_lnz_imltbl.s      |  289 ++++++
 tests/tcg/bfin/c_dagmodik_lz_inc_dec.s      |  140 +++
 tests/tcg/bfin/c_dagmodim_lnz_imgebl.s      |  108 +++
 tests/tcg/bfin/c_dagmodim_lnz_imltbl.s      |  109 +++
 tests/tcg/bfin/c_dagmodim_lz_inc_dec.s      |   98 ++
 tests/tcg/bfin/c_dsp32alu_a_neg_a.s         |   34 +
 tests/tcg/bfin/c_dsp32alu_aa_absabs.s       |   35 +
 tests/tcg/bfin/c_dsp32alu_aa_negneg.s       |   35 +
 tests/tcg/bfin/c_dsp32alu_abs.s             |   62 ++
 tests/tcg/bfin/c_dsp32alu_absabs.s          |   62 ++
 tests/tcg/bfin/c_dsp32alu_awx.s             |   54 ++
 tests/tcg/bfin/c_dsp32alu_bytepack.s        |   77 ++
 tests/tcg/bfin/c_dsp32alu_byteunpack.s      |  113 +++
 tests/tcg/bfin/c_dsp32alu_disalnexcpt.s     |  255 ++++++
 tests/tcg/bfin/c_dsp32alu_max.s             |  261 ++++++
 tests/tcg/bfin/c_dsp32alu_maxmax.s          |  261 ++++++
 tests/tcg/bfin/c_dsp32alu_min.s             |  261 ++++++
 tests/tcg/bfin/c_dsp32alu_minmin.s          |  261 ++++++
 tests/tcg/bfin/c_dsp32alu_rr_lph_a1a0.s     |   33 +
 tests/tcg/bfin/c_dsp32alu_search.s          |   74 ++
 tests/tcg/bfin/c_dsp32alu_sgn.s             |   39 +
 tests/tcg/bfin/c_dsp32mac_a1a0.s            |  255 ++++++
 tests/tcg/bfin/c_dsp32mac_pair_a0.s         |  129 +++
 tests/tcg/bfin/c_dsp32mac_pair_a0_i.s       |  247 +++++
 tests/tcg/bfin/c_dsp32mac_pair_a0_m.s       |  129 +++
 tests/tcg/bfin/c_dsp32mac_pair_a1.s         |  127 +++
 tests/tcg/bfin/c_dsp32mac_pair_a1_i.s       |  243 +++++
 tests/tcg/bfin/c_dsp32mac_pair_a1_m.s       |  127 +++
 tests/tcg/bfin/c_dsp32mult_pair_m.s         |  178 ++++
 tests/tcg/bfin/c_dsp32mult_pair_m_i.s       |  178 ++++
 tests/tcg/bfin/c_dsp32mult_pair_m_u.s       |  178 ++++
 tests/tcg/bfin/c_dsp32shift_a0alr.s         |   77 ++
 tests/tcg/bfin/c_dsp32shift_af.s            |  186 ++++
 tests/tcg/bfin/c_dsp32shift_ahalf_ln.s      |  423 +++++++++
 tests/tcg/bfin/c_dsp32shift_ahalf_lp.s      |  423 +++++++++
 tests/tcg/bfin/c_dsp32shift_ahalf_rn.s      |  423 +++++++++
 tests/tcg/bfin/c_dsp32shift_ahalf_rn_s.s    |  424 +++++++++
 tests/tcg/bfin/c_dsp32shift_ahalf_rp.s      |  423 +++++++++
 tests/tcg/bfin/c_dsp32shift_ahalf_rp_s.s    |  423 +++++++++
 tests/tcg/bfin/c_dsp32shift_align16.s       |  210 +++++
 tests/tcg/bfin/c_dsp32shift_align24.s       |  210 +++++
 tests/tcg/bfin/c_dsp32shift_align8.s        |  210 +++++
 tests/tcg/bfin/c_dsp32shift_fdepx.s         |  210 +++++
 tests/tcg/bfin/c_dsp32shift_fextx.s         |  210 +++++
 tests/tcg/bfin/c_dsp32shift_lf.s            |  422 +++++++++
 tests/tcg/bfin/c_dsp32shift_lhalf_ln.s      |  422 +++++++++
 tests/tcg/bfin/c_dsp32shift_lhalf_lp.s      |  422 +++++++++
 tests/tcg/bfin/c_dsp32shift_lhalf_rn.s      |  425 +++++++++
 tests/tcg/bfin/c_dsp32shift_lhalf_rp.s      |  423 +++++++++
 tests/tcg/bfin/c_dsp32shift_ones.s          |  214 +++++
 tests/tcg/bfin/c_dsp32shift_pack.s          |  411 +++++++++
 tests/tcg/bfin/c_dsp32shift_rot.s           |  427 +++++++++
 tests/tcg/bfin/c_dsp32shift_rot_mix.s       |  375 ++++++++
 tests/tcg/bfin/c_dsp32shift_signbits_r.s    |  214 +++++
 tests/tcg/bfin/c_dsp32shift_signbits_rh.s   |  214 +++++
 tests/tcg/bfin/c_dsp32shift_signbits_rl.s   |  210 +++++
 tests/tcg/bfin/c_dsp32shift_vmax.s          |  113 +++
 tests/tcg/bfin/c_dsp32shift_vmaxvmax.s      |  113 +++
 tests/tcg/bfin/c_dsp32shiftim_a0alr.s       |  213 +++++
 tests/tcg/bfin/c_dsp32shiftim_af.s          |   63 ++
 tests/tcg/bfin/c_dsp32shiftim_af_s.s        |   37 +
 tests/tcg/bfin/c_dsp32shiftim_ahalf_ln.s    |  406 ++++++++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_lp.s    |  418 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn.s    |  418 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn_s.s  |  418 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp.s    |  420 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp_s.s  |  422 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_ahh.s         |   65 ++
 tests/tcg/bfin/c_dsp32shiftim_amix.s        |  124 +++
 tests/tcg/bfin/c_dsp32shiftim_lf.s          |   63 ++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_ln.s    |  401 ++++++++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_lp.s    |  418 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_rn.s    |  424 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_lhalf_rp.s    |  421 +++++++++
 tests/tcg/bfin/c_dsp32shiftim_lhh.s         |   65 ++
 tests/tcg/bfin/c_dsp32shiftim_lmix.s        |  138 +++
 tests/tcg/bfin/c_dsp32shiftim_rot.s         |   62 ++
 tests/tcg/bfin/c_dspldst_ld_dr_i.s          |  168 ++++
 tests/tcg/bfin/c_dspldst_ld_dr_ipp.s        |  348 +++++++
 tests/tcg/bfin/c_dspldst_ld_dr_ippm.s       |  328 +++++++
 tests/tcg/bfin/c_dspldst_ld_drhi_i.s        |  168 ++++
 tests/tcg/bfin/c_dspldst_ld_drhi_ipp.s      |  364 ++++++++
 tests/tcg/bfin/c_dspldst_ld_drlo_i.s        |  164 ++++
 tests/tcg/bfin/c_dspldst_ld_drlo_ipp.s      |  355 +++++++
 tests/tcg/bfin/c_dspldst_st_dr_i.s          |  185 ++++
 tests/tcg/bfin/c_dspldst_st_dr_ipp.s        |  326 +++++++
 tests/tcg/bfin/c_dspldst_st_dr_ippm.s       |  279 ++++++
 tests/tcg/bfin/c_dspldst_st_drhi_i.s        |  161 ++++
 tests/tcg/bfin/c_dspldst_st_drhi_ipp.s      |  355 +++++++
 tests/tcg/bfin/c_dspldst_st_drlo_i.s        |  163 ++++
 tests/tcg/bfin/c_dspldst_st_drlo_ipp.s      |  351 +++++++
 tests/tcg/bfin/c_ldimmhalf_dreg.s           |   60 ++
 tests/tcg/bfin/c_ldimmhalf_drhi.s           |   85 ++
 tests/tcg/bfin/c_ldimmhalf_drlo.s           |   89 ++
 tests/tcg/bfin/c_ldimmhalf_h_dr.s           |   82 ++
 tests/tcg/bfin/c_ldimmhalf_h_ibml.s         |  165 ++++
 tests/tcg/bfin/c_ldimmhalf_h_pr.s           |   74 ++
 tests/tcg/bfin/c_ldimmhalf_l_dr.s           |   82 ++
 tests/tcg/bfin/c_ldimmhalf_l_ibml.s         |  165 ++++
 tests/tcg/bfin/c_ldimmhalf_l_pr.s           |   76 ++
 tests/tcg/bfin/c_ldimmhalf_lz_dr.s          |   81 ++
 tests/tcg/bfin/c_ldimmhalf_lz_ibml.s        |  168 ++++
 tests/tcg/bfin/c_ldimmhalf_lz_pr.s          |   72 ++
 tests/tcg/bfin/c_ldimmhalf_lzhi_dr.s        |  113 +++
 tests/tcg/bfin/c_ldimmhalf_lzhi_ibml.s      |  216 +++++
 tests/tcg/bfin/c_ldimmhalf_lzhi_pr.s        |  102 +++
 tests/tcg/bfin/c_ldimmhalf_pibml.s          |  212 +++++
 tests/tcg/bfin/c_ldst_ld_d_p.s              |  372 ++++++++
 tests/tcg/bfin/c_ldst_ld_d_p_b.s            |  353 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_h.s            |  351 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_mm.s           |  417 +++++++++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_b.s         |  353 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_h.s         |  330 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_xb.s        |  341 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_mm_xh.s        |  355 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_pp.s           |  371 ++++++++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_b.s         |  324 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_h.s         |  350 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_xb.s        |  355 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_pp_xh.s        |  333 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_ppmm_hbx.s     |  656 +++++++++++++
 tests/tcg/bfin/c_ldst_ld_d_p_xb.s           |  326 +++++++
 tests/tcg/bfin/c_ldst_ld_d_p_xh.s           |  354 +++++++
 tests/tcg/bfin/c_ldst_ld_p_p.s              |  327 +++++++
 tests/tcg/bfin/c_ldst_ld_p_p_mm.s           |  406 ++++++++
 tests/tcg/bfin/c_ldst_ld_p_p_pp.s           |  335 +++++++
 tests/tcg/bfin/c_ldst_st_p_d.s              |  299 ++++++
 tests/tcg/bfin/c_ldst_st_p_d_b.s            |  300 ++++++
 tests/tcg/bfin/c_ldst_st_p_d_h.s            |  280 ++++++
 tests/tcg/bfin/c_ldst_st_p_d_mm.s           |  601 ++++++++++++
 tests/tcg/bfin/c_ldst_st_p_d_mm_b.s         |  498 ++++++++++
 tests/tcg/bfin/c_ldst_st_p_d_mm_h.s         |  554 +++++++++++
 tests/tcg/bfin/c_ldst_st_p_d_pp.s           |  804 ++++++++++++++++
 tests/tcg/bfin/c_ldst_st_p_d_pp_b.s         |  455 +++++++++
 tests/tcg/bfin/c_ldst_st_p_d_pp_h.s         |  457 +++++++++
 tests/tcg/bfin/c_ldst_st_p_p.s              |  128 +++
 tests/tcg/bfin/c_ldst_st_p_p_mm.s           |  428 +++++++++
 tests/tcg/bfin/c_ldst_st_p_p_pp.s           |  397 ++++++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_b.s         |  554 +++++++++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_h.s         |  595 ++++++++++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_xb.s        |  594 ++++++++++++
 tests/tcg/bfin/c_ldstidxl_ld_dr_xh.s        |  595 ++++++++++++
 tests/tcg/bfin/c_ldstidxl_ld_dreg.s         |  554 +++++++++++
 tests/tcg/bfin/c_ldstidxl_ld_preg.s         |  672 ++++++++++++++
 tests/tcg/bfin/c_ldstidxl_st_dr_b.s         |  612 +++++++++++++
 tests/tcg/bfin/c_ldstidxl_st_dr_h.s         |  609 ++++++++++++
 tests/tcg/bfin/c_ldstidxl_st_dreg.s         |  780 ++++++++++++++++
 tests/tcg/bfin/c_ldstidxl_st_preg.s         |  709 ++++++++++++++
 tests/tcg/bfin/c_ldstii_ld_dr_h.s           |  541 +++++++++++
 tests/tcg/bfin/c_ldstii_ld_dr_xh.s          |  541 +++++++++++
 tests/tcg/bfin/c_ldstii_ld_dreg.s           |  540 +++++++++++
 tests/tcg/bfin/c_ldstii_ld_preg.s           |  564 ++++++++++++
 tests/tcg/bfin/c_ldstii_st_dr_h.s           |  605 ++++++++++++
 tests/tcg/bfin/c_ldstii_st_dreg.s           |  640 +++++++++++++
 tests/tcg/bfin/c_ldstii_st_preg.s           |  603 ++++++++++++
 tests/tcg/bfin/c_ldstiifp_ld_dreg.s         |  528 +++++++++++
 tests/tcg/bfin/c_ldstiifp_ld_preg.s         |  511 +++++++++++
 tests/tcg/bfin/c_ldstiifp_st_dreg.s         |  641 +++++++++++++
 tests/tcg/bfin/c_ldstiifp_st_preg.s         |  618 +++++++++++++
 tests/tcg/bfin/c_ldstpmod_ld_dr_hi.s        |  411 +++++++++
 tests/tcg/bfin/c_ldstpmod_ld_dr_lo.s        |  410 +++++++++
 tests/tcg/bfin/c_ldstpmod_ld_dreg.s         |  462 ++++++++++
 tests/tcg/bfin/c_ldstpmod_ld_h_xh.s         |  458 ++++++++++
 tests/tcg/bfin/c_ldstpmod_ld_lohi.s         |  462 ++++++++++
 tests/tcg/bfin/c_ldstpmod_st_dr_hi.s        |  400 ++++++++
 tests/tcg/bfin/c_ldstpmod_st_dr_lo.s        |  401 ++++++++
 tests/tcg/bfin/c_ldstpmod_st_dreg.s         |  623 +++++++++++++
 tests/tcg/bfin/c_ldstpmod_st_lohi.s         |  625 +++++++++++++
 tests/tcg/bfin/c_linkage.s                  |   60 ++
 tests/tcg/bfin/c_logi2op_alshft_mix.s       |  143 +++
 tests/tcg/bfin/c_logi2op_arith_shft.s       |  223 +++++
 tests/tcg/bfin/c_logi2op_bitclr.s           |   92 ++
 tests/tcg/bfin/c_logi2op_bitset.s           |   92 ++
 tests/tcg/bfin/c_logi2op_bittgl.s           |  165 ++++
 tests/tcg/bfin/c_logi2op_bittst.s           |  583 ++++++++++++
 tests/tcg/bfin/c_logi2op_log_l_shft.s       |  222 +++++
 tests/tcg/bfin/c_logi2op_log_l_shft_astat.S |   82 ++
 tests/tcg/bfin/c_logi2op_log_r_shft.s       |  222 +++++
 tests/tcg/bfin/c_logi2op_log_r_shft_astat.S |   82 ++
 tests/tcg/bfin/c_logi2op_nbittst.s          |  584 ++++++++++++
 tests/tcg/bfin/c_loopsetup_nested.s         |  166 ++++
 tests/tcg/bfin/c_loopsetup_nested_bot.s     |  165 ++++
 tests/tcg/bfin/c_loopsetup_nested_prelc.s   |  184 ++++
 tests/tcg/bfin/c_loopsetup_nested_top.s     |  166 ++++
 tests/tcg/bfin/c_loopsetup_overlap.s        |  167 ++++
 tests/tcg/bfin/c_loopsetup_preg_div2_lc0.s  |   95 ++
 tests/tcg/bfin/c_loopsetup_preg_div2_lc1.s  |   94 ++
 tests/tcg/bfin/c_loopsetup_preg_lc0.s       |   95 ++
 tests/tcg/bfin/c_loopsetup_preg_lc1.s       |   93 ++
 tests/tcg/bfin/c_loopsetup_prelc.s          |  145 +++
 tests/tcg/bfin/c_loopsetup_topbotcntr.s     |  110 +++
 tests/tcg/bfin/c_progctrl_call_pcpr.s       |   63 ++
 tests/tcg/bfin/c_progctrl_call_pr.s         |   32 +
 tests/tcg/bfin/c_progctrl_jump_pcpr.s       |   58 ++
 tests/tcg/bfin/c_progctrl_jump_pr.s         |   56 ++
 tests/tcg/bfin/c_progctrl_nop.s             |   55 ++
 tests/tcg/bfin/c_progctrl_rts.s             |   36 +
 tests/tcg/bfin/c_ptr2op_pr_neg_pr.s         |  163 ++++
 tests/tcg/bfin/c_ptr2op_pr_sft_2_1.s        |  162 ++++
 tests/tcg/bfin/c_ptr2op_pr_shadd_1_2.s      |  167 ++++
 tests/tcg/bfin/c_pushpopmultiple_dp.s       |  213 +++++
 tests/tcg/bfin/c_pushpopmultiple_dp_pair.s  |  203 ++++
 tests/tcg/bfin/c_pushpopmultiple_dreg.s     |  173 ++++
 tests/tcg/bfin/c_pushpopmultiple_preg.s     |   83 ++
 tests/tcg/bfin/c_regmv_acc_acc.s            |  125 +++
 tests/tcg/bfin/c_regmv_dag_lz_dep.s         |  148 +++
 tests/tcg/bfin/c_regmv_dr_acc_acc.s         |  191 ++++
 tests/tcg/bfin/c_regmv_dr_dep_nostall.s     |  245 +++++
 tests/tcg/bfin/c_regmv_dr_dr.s              |  209 +++++
 tests/tcg/bfin/c_regmv_dr_imlb.s            |  539 +++++++++++
 tests/tcg/bfin/c_regmv_dr_pr.s              |  107 +++
 tests/tcg/bfin/c_regmv_imlb_dep_nostall.s   |  664 ++++++++++++++
 tests/tcg/bfin/c_regmv_imlb_dep_stall.s     |  335 +++++++
 tests/tcg/bfin/c_regmv_imlb_dr.s            |  313 +++++++
 tests/tcg/bfin/c_regmv_imlb_imlb.s          |  925 +++++++++++++++++++
 tests/tcg/bfin/c_regmv_imlb_pr.s            |  302 ++++++
 tests/tcg/bfin/c_regmv_pr_dep_nostall.s     |  280 ++++++
 tests/tcg/bfin/c_regmv_pr_dep_stall.s       |  237 +++++
 tests/tcg/bfin/c_regmv_pr_dr.s              |  147 +++
 tests/tcg/bfin/c_regmv_pr_imlb.s            |  382 ++++++++
 tests/tcg/bfin/c_regmv_pr_pr.s              |   95 ++
 tests/tcg/bfin/c_ujump.s                    |   52 ++
 tests/tcg/bfin/cc-astat-bits.s              |  101 ++
 tests/tcg/bfin/cc1.s                        |   26 +
 tests/tcg/bfin/cir.s                        |   20 +
 tests/tcg/bfin/cir1.s                       |   84 ++
 tests/tcg/bfin/cmpdreg.S                    |   40 +
 tests/tcg/bfin/compare.s                    |   15 +
 tests/tcg/bfin/d0.s                         |   31 +
 tests/tcg/bfin/d1.s                         |   17 +
 tests/tcg/bfin/d2.s                         |   56 ++
 tests/tcg/bfin/div0.s                       |   37 +
 tests/tcg/bfin/divq.s                       | 1322 +++++++++++++++++++++++++++
 tests/tcg/bfin/dotproduct.s                 |  304 ++++++
 tests/tcg/bfin/dotproduct2.s                |  299 ++++++
 tests/tcg/bfin/dsp_d0.s                     |   31 +
 tests/tcg/bfin/dsp_d1.s                     |  117 +++
 tests/tcg/bfin/edn_snafu.s                  |   45 +
 tests/tcg/bfin/events.s                     |   44 +
 tests/tcg/bfin/fact.s                       |   47 +
 tests/tcg/bfin/fsm.s                        |   57 ++
 tests/tcg/bfin/greg2.s                      |   18 +
 tests/tcg/bfin/hwloop-branch-in.s           |   99 ++
 tests/tcg/bfin/hwloop-branch-out.s          |  129 +++
 tests/tcg/bfin/hwloop-lt-bits.s             |   25 +
 tests/tcg/bfin/hwloop-nested.s              |   33 +
 tests/tcg/bfin/i0.s                         |   57 ++
 tests/tcg/bfin/issue113.s                   |   18 +
 tests/tcg/bfin/issue126.s                   |   19 +
 tests/tcg/bfin/issue129.s                   |   36 +
 tests/tcg/bfin/issue144.s                   |   31 +
 tests/tcg/bfin/issue83.s                    |   93 ++
 tests/tcg/bfin/issue89.s                    |   30 +
 tests/tcg/bfin/l0.s                         |  137 +++
 tests/tcg/bfin/l0shift.s                    |   13 +
 tests/tcg/bfin/l2_loop.s                    |   28 +
 tests/tcg/bfin/link-2.s                     |   24 +
 tests/tcg/bfin/link.s                       |   67 ++
 tests/tcg/bfin/load.s                       |  239 +++++
 tests/tcg/bfin/logic.s                      |   64 ++
 tests/tcg/bfin/loop_snafu.s                 |   28 +
 tests/tcg/bfin/loop_strncpy.s               |   76 ++
 tests/tcg/bfin/lp0.s                        |   17 +
 tests/tcg/bfin/lp1.s                        |   16 +
 tests/tcg/bfin/lsetup.s                     |  109 +++
 tests/tcg/bfin/m0boundary.s                 |   46 +
 tests/tcg/bfin/m17.s                        |   74 ++
 tests/tcg/bfin/max_min_flags.s              |  275 ++++++
 tests/tcg/bfin/mem3.s                       |   42 +
 tests/tcg/bfin/move.s                       |   36 +
 tests/tcg/bfin/neg.S                        |   42 +
 tests/tcg/bfin/nshift.s                     |   33 +
 tests/tcg/bfin/pr.s                         |   81 ++
 tests/tcg/bfin/push-pop-multiple.s          |  169 ++++
 tests/tcg/bfin/push-pop.s                   |   78 ++
 tests/tcg/bfin/pushpopreg_1.s               |  292 ++++++
 tests/tcg/bfin/s0.s                         |   12 +
 tests/tcg/bfin/s1.s                         |   25 +
 tests/tcg/bfin/s10.s                        |   77 ++
 tests/tcg/bfin/s15.s                        |  149 +++
 tests/tcg/bfin/s16.s                        |  170 ++++
 tests/tcg/bfin/s17.s                        |   46 +
 tests/tcg/bfin/s2.s                         |   47 +
 tests/tcg/bfin/s20.s                        |   25 +
 tests/tcg/bfin/s21.s                        |  298 ++++++
 tests/tcg/bfin/s4.s                         |  214 +++++
 tests/tcg/bfin/s5.s                         |  107 +++
 tests/tcg/bfin/s6.s                         |   83 ++
 tests/tcg/bfin/s7.s                         |   83 ++
 tests/tcg/bfin/s8.s                         |   55 ++
 tests/tcg/bfin/s9.s                         |  134 +++
 tests/tcg/bfin/se_kills2.S                  |  148 +++
 tests/tcg/bfin/se_rets_hazard.s             |   55 ++
 tests/tcg/bfin/sign.s                       |   27 +
 tests/tcg/bfin/simple0.s                    |   10 +
 tests/tcg/bfin/stk.s                        |   78 ++
 tests/tcg/bfin/stk2.s                       |  107 +++
 tests/tcg/bfin/stk3.s                       |  106 +++
 tests/tcg/bfin/stk4.s                       |  110 +++
 tests/tcg/bfin/stk5.s                       |   34 +
 tests/tcg/bfin/stk6.s                       |   58 ++
 tests/tcg/bfin/tar10622.s                   |   20 +
 tests/tcg/bfin/test.h                       |  134 +++
 tests/tcg/bfin/testset.s                    |   73 ++
 tests/tcg/bfin/testset2.s                   |   37 +
 tests/tcg/bfin/testutils.inc                |  258 ++++++
 tests/tcg/bfin/vec-abs.S                    |   42 +
 tests/tcg/bfin/vecadd.s                     |   65 ++
 tests/tcg/bfin/vit_max.s                    |   57 ++
 tests/tcg/bfin/wtf.s                        |   26 +
 tests/tcg/bfin/zcall.s                      |   44 +
 420 files changed, 87775 insertions(+)
 create mode 100644 tests/tcg/bfin/.gitignore
 create mode 100644 tests/tcg/bfin/10272_small.s
 create mode 100644 tests/tcg/bfin/10436.s
 create mode 100644 tests/tcg/bfin/10622.s
 create mode 100644 tests/tcg/bfin/10742.s
 create mode 100644 tests/tcg/bfin/10799.s
 create mode 100644 tests/tcg/bfin/7641.s
 create mode 100644 tests/tcg/bfin/Makefile
 create mode 100644 tests/tcg/bfin/a0.s
 create mode 100644 tests/tcg/bfin/a1.s
 create mode 100644 tests/tcg/bfin/a10.s
 create mode 100644 tests/tcg/bfin/a2.s
 create mode 100644 tests/tcg/bfin/a24.s
 create mode 100644 tests/tcg/bfin/a25.s
 create mode 100644 tests/tcg/bfin/a26.s
 create mode 100644 tests/tcg/bfin/a3.s
 create mode 100644 tests/tcg/bfin/a4.s
 create mode 100644 tests/tcg/bfin/a7.s
 create mode 100644 tests/tcg/bfin/a8.s
 create mode 100644 tests/tcg/bfin/a9.s
 create mode 100644 tests/tcg/bfin/abs-2.S
 create mode 100644 tests/tcg/bfin/abs-3.S
 create mode 100644 tests/tcg/bfin/abs.S
 create mode 100644 tests/tcg/bfin/acc-rot.s
 create mode 100644 tests/tcg/bfin/acp5_19.s
 create mode 100644 tests/tcg/bfin/add_imm7.s
 create mode 100644 tests/tcg/bfin/algnbug1.s
 create mode 100644 tests/tcg/bfin/algnbug2.s
 create mode 100644 tests/tcg/bfin/b0.S
 create mode 100644 tests/tcg/bfin/b1.s
 create mode 100644 tests/tcg/bfin/b2.S
 create mode 100644 tests/tcg/bfin/brcc.s
 create mode 100644 tests/tcg/bfin/brevadd.s
 create mode 100644 tests/tcg/bfin/byteunpack.s
 create mode 100644 tests/tcg/bfin/c_alu2op_arith_r_sft.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_b.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_h.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_mix.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_neg.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_toggle.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_xb.s
 create mode 100644 tests/tcg/bfin/c_alu2op_conv_xh.s
 create mode 100644 tests/tcg/bfin/c_alu2op_divq.s
 create mode 100644 tests/tcg/bfin/c_alu2op_divs.s
 create mode 100644 tests/tcg/bfin/c_alu2op_log_l_sft.s
 create mode 100644 tests/tcg/bfin/c_alu2op_log_r_sft.s
 create mode 100644 tests/tcg/bfin/c_alu2op_shadd_1.s
 create mode 100644 tests/tcg/bfin/c_alu2op_shadd_2.s
 create mode 100644 tests/tcg/bfin/c_br_preg_killed_ac.s
 create mode 100644 tests/tcg/bfin/c_br_preg_killed_ex1.s
 create mode 100644 tests/tcg/bfin/c_br_preg_stall_ac.s
 create mode 100644 tests/tcg/bfin/c_br_preg_stall_ex1.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp1.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp2.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp3.s
 create mode 100644 tests/tcg/bfin/c_brcc_bp4.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_bp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_brt_bp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_brt_nbp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_fbkwd.s
 create mode 100644 tests/tcg/bfin/c_brcc_brf_nbp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brt_bp.s
 create mode 100644 tests/tcg/bfin/c_brcc_brt_nbp.s
 create mode 100644 tests/tcg/bfin/c_calla_ljump.s
 create mode 100644 tests/tcg/bfin/c_calla_subr.s
 create mode 100644 tests/tcg/bfin/c_cc2dreg.s
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_ac.S
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_an.s
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_aq.s
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_av0.S
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_av1.S
 create mode 100644 tests/tcg/bfin/c_cc2stat_cc_az.s
 create mode 100644 tests/tcg/bfin/c_cc_flag_ccmv_depend.S
 create mode 100644 tests/tcg/bfin/c_cc_flagdreg_mvbrsft.s
 create mode 100644 tests/tcg/bfin/c_cc_regmvlogi_mvbrsft.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_dr_uu.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_imm3.s
 create mode 100644 tests/tcg/bfin/c_ccflag_dr_imm3_uu.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_imm3.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_imm3_uu.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccflag_pr_pr_uu.s
 create mode 100644 tests/tcg/bfin/c_ccmv_cc_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_cc_dr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_cc_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_ncc_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_ncc_dr_pr.s
 create mode 100644 tests/tcg/bfin/c_ccmv_ncc_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_and_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_minus_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_mix.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_or_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_plus_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_dr_xor_dr.s
 create mode 100644 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh1.s
 create mode 100644 tests/tcg/bfin/c_comp3op_pr_plus_pr_sh2.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_add_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_add_i7_p.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_eq_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_dr_eq_i7_p.s
 create mode 100644 tests/tcg/bfin/c_compi2opd_flags.S
 create mode 100644 tests/tcg/bfin/c_compi2opd_flags_2.S
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_add_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_add_i7_p.s
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_eq_i7_n.s
 create mode 100644 tests/tcg/bfin/c_compi2opp_pr_eq_i7_p.s
 create mode 100644 tests/tcg/bfin/c_dagmodik_lnz_imgebl.s
 create mode 100644 tests/tcg/bfin/c_dagmodik_lnz_imltbl.s
 create mode 100644 tests/tcg/bfin/c_dagmodik_lz_inc_dec.s
 create mode 100644 tests/tcg/bfin/c_dagmodim_lnz_imgebl.s
 create mode 100644 tests/tcg/bfin/c_dagmodim_lnz_imltbl.s
 create mode 100644 tests/tcg/bfin/c_dagmodim_lz_inc_dec.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_a_neg_a.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_aa_absabs.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_aa_negneg.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_abs.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_absabs.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_awx.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_bytepack.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_byteunpack.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_disalnexcpt.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_max.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_maxmax.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_min.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_minmin.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_rr_lph_a1a0.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_search.s
 create mode 100644 tests/tcg/bfin/c_dsp32alu_sgn.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_a1a0.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a0.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a0_i.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a0_m.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a1.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a1_i.s
 create mode 100644 tests/tcg/bfin/c_dsp32mac_pair_a1_m.s
 create mode 100644 tests/tcg/bfin/c_dsp32mult_pair_m.s
 create mode 100644 tests/tcg/bfin/c_dsp32mult_pair_m_i.s
 create mode 100644 tests/tcg/bfin/c_dsp32mult_pair_m_u.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_a0alr.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_af.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rn_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ahalf_rp_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_align16.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_align24.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_align8.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_fdepx.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_fextx.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lf.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_lhalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_ones.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_pack.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_rot.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_rot_mix.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_signbits_r.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_signbits_rh.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_signbits_rl.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_vmax.s
 create mode 100644 tests/tcg/bfin/c_dsp32shift_vmaxvmax.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_a0alr.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_af.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_af_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rn_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahalf_rp_s.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_ahh.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_amix.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lf.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_ln.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_lp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_rn.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhalf_rp.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lhh.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_lmix.s
 create mode 100644 tests/tcg/bfin/c_dsp32shiftim_rot.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_dr_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_dr_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_dr_ippm.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drhi_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drhi_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drlo_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_ld_drlo_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_dr_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_dr_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_dr_ippm.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drhi_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drhi_ipp.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drlo_i.s
 create mode 100644 tests/tcg/bfin/c_dspldst_st_drlo_ipp.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_drhi.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_drlo.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_h_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_h_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_h_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_l_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_l_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_l_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lz_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lz_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lz_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lzhi_dr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lzhi_ibml.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_lzhi_pr.s
 create mode 100644 tests/tcg/bfin/c_ldimmhalf_pibml.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_xb.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_mm_xh.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_xb.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_pp_xh.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_ppmm_hbx.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_xb.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_d_p_xh.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_p_p.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_p_p_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_ld_p_p_pp.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_mm_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_mm_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_pp.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_pp_b.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_d_pp_h.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_p.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_p_mm.s
 create mode 100644 tests/tcg/bfin/c_ldst_st_p_p_pp.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_b.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_xb.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dr_xh.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_ld_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_dr_b.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstidxl_st_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_dr_xh.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_ld_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_st_dr_h.s
 create mode 100644 tests/tcg/bfin/c_ldstii_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstii_st_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_ld_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstiifp_st_preg.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_dr_hi.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_dr_lo.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_h_xh.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_ld_lohi.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_dr_hi.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_dr_lo.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_dreg.s
 create mode 100644 tests/tcg/bfin/c_ldstpmod_st_lohi.s
 create mode 100644 tests/tcg/bfin/c_linkage.s
 create mode 100644 tests/tcg/bfin/c_logi2op_alshft_mix.s
 create mode 100644 tests/tcg/bfin/c_logi2op_arith_shft.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bitclr.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bitset.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bittgl.s
 create mode 100644 tests/tcg/bfin/c_logi2op_bittst.s
 create mode 100644 tests/tcg/bfin/c_logi2op_log_l_shft.s
 create mode 100644 tests/tcg/bfin/c_logi2op_log_l_shft_astat.S
 create mode 100644 tests/tcg/bfin/c_logi2op_log_r_shft.s
 create mode 100644 tests/tcg/bfin/c_logi2op_log_r_shft_astat.S
 create mode 100644 tests/tcg/bfin/c_logi2op_nbittst.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested_bot.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested_prelc.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_nested_top.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_overlap.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_div2_lc0.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_div2_lc1.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_lc0.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_preg_lc1.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_prelc.s
 create mode 100644 tests/tcg/bfin/c_loopsetup_topbotcntr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_call_pcpr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_call_pr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_jump_pcpr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_jump_pr.s
 create mode 100644 tests/tcg/bfin/c_progctrl_nop.s
 create mode 100644 tests/tcg/bfin/c_progctrl_rts.s
 create mode 100644 tests/tcg/bfin/c_ptr2op_pr_neg_pr.s
 create mode 100644 tests/tcg/bfin/c_ptr2op_pr_sft_2_1.s
 create mode 100644 tests/tcg/bfin/c_ptr2op_pr_shadd_1_2.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_dp.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_dp_pair.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_dreg.s
 create mode 100644 tests/tcg/bfin/c_pushpopmultiple_preg.s
 create mode 100644 tests/tcg/bfin/c_regmv_acc_acc.s
 create mode 100644 tests/tcg/bfin/c_regmv_dag_lz_dep.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_acc_acc.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_dep_nostall.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_dr.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_imlb.s
 create mode 100644 tests/tcg/bfin/c_regmv_dr_pr.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_dep_nostall.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_dep_stall.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_dr.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_imlb.s
 create mode 100644 tests/tcg/bfin/c_regmv_imlb_pr.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_dep_nostall.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_dep_stall.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_dr.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_imlb.s
 create mode 100644 tests/tcg/bfin/c_regmv_pr_pr.s
 create mode 100644 tests/tcg/bfin/c_ujump.s
 create mode 100644 tests/tcg/bfin/cc-astat-bits.s
 create mode 100644 tests/tcg/bfin/cc1.s
 create mode 100644 tests/tcg/bfin/cir.s
 create mode 100644 tests/tcg/bfin/cir1.s
 create mode 100644 tests/tcg/bfin/cmpdreg.S
 create mode 100644 tests/tcg/bfin/compare.s
 create mode 100644 tests/tcg/bfin/d0.s
 create mode 100644 tests/tcg/bfin/d1.s
 create mode 100644 tests/tcg/bfin/d2.s
 create mode 100644 tests/tcg/bfin/div0.s
 create mode 100644 tests/tcg/bfin/divq.s
 create mode 100644 tests/tcg/bfin/dotproduct.s
 create mode 100644 tests/tcg/bfin/dotproduct2.s
 create mode 100644 tests/tcg/bfin/dsp_d0.s
 create mode 100644 tests/tcg/bfin/dsp_d1.s
 create mode 100644 tests/tcg/bfin/edn_snafu.s
 create mode 100644 tests/tcg/bfin/events.s
 create mode 100644 tests/tcg/bfin/fact.s
 create mode 100644 tests/tcg/bfin/fsm.s
 create mode 100644 tests/tcg/bfin/greg2.s
 create mode 100644 tests/tcg/bfin/hwloop-branch-in.s
 create mode 100644 tests/tcg/bfin/hwloop-branch-out.s
 create mode 100644 tests/tcg/bfin/hwloop-lt-bits.s
 create mode 100644 tests/tcg/bfin/hwloop-nested.s
 create mode 100644 tests/tcg/bfin/i0.s
 create mode 100644 tests/tcg/bfin/issue113.s
 create mode 100644 tests/tcg/bfin/issue126.s
 create mode 100644 tests/tcg/bfin/issue129.s
 create mode 100644 tests/tcg/bfin/issue144.s
 create mode 100644 tests/tcg/bfin/issue83.s
 create mode 100644 tests/tcg/bfin/issue89.s
 create mode 100644 tests/tcg/bfin/l0.s
 create mode 100644 tests/tcg/bfin/l0shift.s
 create mode 100644 tests/tcg/bfin/l2_loop.s
 create mode 100644 tests/tcg/bfin/link-2.s
 create mode 100644 tests/tcg/bfin/link.s
 create mode 100644 tests/tcg/bfin/load.s
 create mode 100644 tests/tcg/bfin/logic.s
 create mode 100644 tests/tcg/bfin/loop_snafu.s
 create mode 100644 tests/tcg/bfin/loop_strncpy.s
 create mode 100644 tests/tcg/bfin/lp0.s
 create mode 100644 tests/tcg/bfin/lp1.s
 create mode 100644 tests/tcg/bfin/lsetup.s
 create mode 100644 tests/tcg/bfin/m0boundary.s
 create mode 100644 tests/tcg/bfin/m17.s
 create mode 100644 tests/tcg/bfin/max_min_flags.s
 create mode 100644 tests/tcg/bfin/mem3.s
 create mode 100644 tests/tcg/bfin/move.s
 create mode 100644 tests/tcg/bfin/neg.S
 create mode 100644 tests/tcg/bfin/nshift.s
 create mode 100644 tests/tcg/bfin/pr.s
 create mode 100644 tests/tcg/bfin/push-pop-multiple.s
 create mode 100644 tests/tcg/bfin/push-pop.s
 create mode 100644 tests/tcg/bfin/pushpopreg_1.s
 create mode 100644 tests/tcg/bfin/s0.s
 create mode 100644 tests/tcg/bfin/s1.s
 create mode 100644 tests/tcg/bfin/s10.s
 create mode 100644 tests/tcg/bfin/s15.s
 create mode 100644 tests/tcg/bfin/s16.s
 create mode 100644 tests/tcg/bfin/s17.s
 create mode 100644 tests/tcg/bfin/s2.s
 create mode 100644 tests/tcg/bfin/s20.s
 create mode 100644 tests/tcg/bfin/s21.s
 create mode 100644 tests/tcg/bfin/s4.s
 create mode 100644 tests/tcg/bfin/s5.s
 create mode 100644 tests/tcg/bfin/s6.s
 create mode 100644 tests/tcg/bfin/s7.s
 create mode 100644 tests/tcg/bfin/s8.s
 create mode 100644 tests/tcg/bfin/s9.s
 create mode 100644 tests/tcg/bfin/se_kills2.S
 create mode 100644 tests/tcg/bfin/se_rets_hazard.s
 create mode 100644 tests/tcg/bfin/sign.s
 create mode 100644 tests/tcg/bfin/simple0.s
 create mode 100644 tests/tcg/bfin/stk.s
 create mode 100644 tests/tcg/bfin/stk2.s
 create mode 100644 tests/tcg/bfin/stk3.s
 create mode 100644 tests/tcg/bfin/stk4.s
 create mode 100644 tests/tcg/bfin/stk5.s
 create mode 100644 tests/tcg/bfin/stk6.s
 create mode 100644 tests/tcg/bfin/tar10622.s
 create mode 100644 tests/tcg/bfin/test.h
 create mode 100644 tests/tcg/bfin/testset.s
 create mode 100644 tests/tcg/bfin/testset2.s
 create mode 100644 tests/tcg/bfin/testutils.inc
 create mode 100644 tests/tcg/bfin/vec-abs.S
 create mode 100644 tests/tcg/bfin/vecadd.s
 create mode 100644 tests/tcg/bfin/vit_max.s
 create mode 100644 tests/tcg/bfin/wtf.s
 create mode 100644 tests/tcg/bfin/zcall.s
tests/tcg/Makefile +4 -0
index 24e3154..da49378 100644
@@ -153,6 +153,10 @@ test-cris:
 test-lm32:
 	$(MAKE) -C lm32 check
 
+# testsuite for the Blackfin port.
+test-bfin:
+	$(MAKE) -C bfin check
+
 clean:
 	rm -f *~ *.o test-i386.out test-i386.ref \
            test-x86_64.log test-x86_64.ref qruncom $(TESTS)
tests/tcg/bfin/.gitignore new file +2 -0
new file mode 100644
index 0000000..788ebb9
@@ -0,0 +1,2 @@
+*.x
+*.X
Signature · 1 line
1.8.2.1
#5 lore raw

PATCH 5/5 linux-user: add support for Blackfin syscalls

In reply to Mike Frysinger

The Blackfin arch supports a simple sram allocator for userspace, as well as a DMA memcpy function to access the sram.

---
 linux-user/strace.list |  9 ++++++
 linux-user/syscall.c   | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)
linux-user/strace.list +9 -0
index 08f115d..cf093cc 100644
@@ -105,6 +105,9 @@
 #ifdef TARGET_NR_dipc
 { TARGET_NR_dipc, "dipc" , NULL, NULL, NULL },
 #endif
+#ifdef TARGET_NR_dma_memcpy
+{ TARGET_NR_dma_memcpy, "dma_memcpy" , NULL, NULL, NULL },
+#endif
 #ifdef TARGET_NR_dup
 { TARGET_NR_dup, "dup" , NULL, NULL, NULL },
 #endif
@@ -1299,6 +1302,12 @@
 #ifdef TARGET_NR_splice
 { TARGET_NR_splice, "splice" , NULL, NULL, NULL },
 #endif
+#ifdef TARGET_NR_sram_alloc
+{ TARGET_NR_sram_alloc, "sram_alloc" , NULL, NULL, NULL },
+#endif
+#ifdef TARGET_NR_sram_free
+{ TARGET_NR_sram_free, "sram_free" , NULL, NULL, NULL },
+#endif
 #ifdef TARGET_NR_ssetmask
 { TARGET_NR_ssetmask, "ssetmask" , NULL, NULL, NULL },
 #endif
linux-user/syscall.c +74 -0

86 lines not on this page · raw message

Signature · 1 line
1.8.2.1
#6 lore raw

Re: [Qemu-devel] [PATCH 2/5] Blackfin: initial port

In reply to Mike Frysinger

target-bfin/bfin-sim.c

Quoted 1 line
target-bfin/bfin-sim.c +0 -0

Why this separate file from translate.c?

target-bfin/bfin-sim.c line 15

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>

Certainly you shouldn't need these, since this isn't a separately compiled object -- you're included from translate.c.

target-bfin/bfin-sim.c line 32

Quoted 4 lines
target-bfin/bfin-sim.c +4 -0
+static void
+unhandled_instruction(DisasContext *dc, const char *insn)
+{
+    fprintf(stderr, "unhandled insn: %s\n", insn);

Use LOG_UNIMP.

Quoted 1 line

+#define HOST_LONG_WORD_SIZE (sizeof(long) * 8)

You mean TCG_TARGET_REG_BITS?

target-bfin/bfin-sim.c line 202

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+static TCGv
+get_allreg(DisasContext *dc, int grp, int reg)
+{
+    TCGv *ret = cpu_regs[(grp << 3) | reg];
+    if (ret) {
+       return *ret;
+    }
+    abort();
+    illegal_instruction(dc);
+}

Well, which is it? abort or illegal_instruction. And come to that, how is abort any better than SEGV from dereferecing the null? Certainly the later will generate a faster translator...

target-bfin/bfin-sim.c line 225

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+decode_multfunc_tl(DisasContext *dc, int h0, int h1, int src0, int src1,
+                   int mmod, int MM, TCGv psat)
+{
+    TCGv s0, s1, val;
+
+    s0 = tcg_temp_local_new();

You'll really want to avoid local temps and branches, if at all possible. For some of the more complex stuff that you're open-coding, you may be better off with helper functions instead.

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+        l = gen_new_label();
+        endl = gen_new_label();
+
+        tcg_gen_brcondi_tl(TCG_COND_NE, val, 0x40000000, l);
+        if (mmod == M_W32) {
+            tcg_gen_movi_tl(val, 0x7fffffff);

target-bfin/bfin-sim.c line 287

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+        } else {
+            tcg_gen_movi_tl(val, 0x80000000);
+        }
+        tcg_gen_movi_tl(psat, 1);
+        tcg_gen_br(endl);
+
+        gen_set_label(l);
+        tcg_gen_shli_tl(val, val, 1);
+
+        gen_set_label(endl);

Certainly possible here with 2 movcond, or 1 movcond, 1 setcond + 1 or.

target-bfin/bfin-sim.c line 314

Quoted 4 lines
target-bfin/bfin-sim.c +4 -0
+    l = gen_new_label();
+    tcg_gen_brcondi_tl(TCG_COND_EQ, psat, 0, l);
+    tcg_gen_ext32u_i64(val1, val1);
+    gen_set_label(l);

movcond again.

target-bfin/bfin-sim.c line 320

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+static void
+saturate_s32(TCGv_i64 val, TCGv overflow)

I shall now stop mentioning movcond. I sense there are many locations to come.

target-bfin/bfin-sim.c line 469

Quoted 8 lines
target-bfin/bfin-sim.c +8 -0
+    } else if (prgfunc == 11 && poprnd < 6) {
+        /* TESTSET (Preg{poprnd}); */
+        TCGv tmp = tcg_temp_new();
+        tcg_gen_qemu_ld8u(tmp, cpu_preg[poprnd], dc->mem_idx);
+        tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_cc, tmp, 0);
+        tcg_gen_ori_tl(tmp, tmp, 0x80);
+        tcg_gen_qemu_st8(tmp, cpu_preg[poprnd], dc->mem_idx);
+        tcg_temp_free(tmp);

I'll note that this is fine for system code, but for user code ought to be atomic. There are a bunch of really bad examples in the tree, and no real good solutions atm.

target-bfin/bfin-sim.c line 523

Quoted 3 lines
target-bfin/bfin-sim.c +3 -0
+    /* Can't push/pop reserved registers */
+    /*if (reg_is_reserved(grp, reg))
+        illegal_instruction(dc);*/

No commented out code like this.

target-bfin/bfin-sim.c

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+    /* Everything here needs to be aligned, so check once */
+    gen_align_check(dc, cpu_spreg, 4, false);

You ought not need to generate explicit alignment checks. Yes, we don't do that correctly for user-mode, but we do for system mode.

My hope is that user mode eventually has the option of using the system mode page tables too -- there are just too many things that don't work correctly when host and target page sizes don't match, or the host and target don't have the same unaligned access characteristics.

target-bfin/bfin-sim.c line 554

Quoted 13 lines
target-bfin/bfin-sim.c +13 -0
+        } else if (grp == 4 && (reg == 0 || reg == 2)) {
+            /* Pop A#.X */
+            tmp = tcg_temp_new();
+            tcg_gen_qemu_ld32u(tmp, cpu_spreg, dc->mem_idx);
+            tcg_gen_andi_tl(tmp, tmp, 0xff);
+            tmp64 = tcg_temp_new_i64();
+            tcg_gen_extu_i32_i64(tmp64, tmp);
+            tcg_temp_free(tmp);
+
+            tcg_gen_andi_i64(cpu_areg[reg >> 1], cpu_areg[reg >> 1], 0xffffffff);
+            tcg_gen_shli_i64(tmp64, tmp64, 32);
+            tcg_gen_or_i64(cpu_areg[reg >> 1], cpu_areg[reg >> 1], tmp64);
+            tcg_temp_free_i64(tmp64);

Drop the andi with 0xff and use

tcg_gen_deposit_i64(cpu_areg[reg >> 1], cpu_areg[reg >> 1], tmp64, 32, 8)

target-bfin/bfin-sim.c line 564

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+        } else if (grp == 4 && (reg == 1 || reg == 3)) {
+            /* Pop A#.W */
+            tcg_gen_andi_i64(cpu_areg[reg >> 1], cpu_areg[reg >> 1], 0xff00000000);
+            tmp = tcg_temp_new();
+            tcg_gen_qemu_ld32u(tmp, cpu_spreg, dc->mem_idx);
+            tmp64 = tcg_temp_new_i64();
+            tcg_gen_extu_i32_i64(tmp64, tmp);
+            tcg_temp_free(tmp);
+            tcg_gen_or_i64(cpu_areg[reg >> 1], cpu_areg[reg >> 1], tmp64);
+            tcg_temp_free_i64(tmp64);

And then this one becomes deposit(areg, areg, tmp64, 0, 32).

target-bfin/bfin-sim.c line 594

Quoted 8 lines
target-bfin/bfin-sim.c +8 -0
+        } else if (grp == 4 && (reg == 0 || reg == 2)) {
+            /* Push A#.X */
+            tmp64 = tcg_temp_new_i64();
+            tcg_gen_shri_i64(tmp64, cpu_areg[reg >> 1], 32);
+            tmp = tcg_temp_new();
+            tcg_gen_trunc_i64_i32(tmp, tmp64);
+            tcg_temp_free_i64(tmp64);
+            tcg_gen_andi_tl(tmp, tmp, 0xff);

Do we ever allow the high 24 bits to be non-zero? Is this andi actually redundant?

target-bfin/bfin-sim.c line 641

Quoted 8 lines
target-bfin/bfin-sim.c +8 -0
+    if (W == 1) {
+        /* [--SP] = ({d}R7:imm{dr}, {p}P5:imm{pr}); */
+        if (d) {
+            for (i = dr; i < 8; i++) {
+                tcg_gen_subi_tl(cpu_spreg, cpu_spreg, 4);
+                tcg_gen_qemu_st32(cpu_dreg[i], cpu_spreg, dc->mem_idx);
+            }
+        }

What's the cpu exception effect of the second store causing a page fault? Normally one needs to do the address increment in a temporary and only update the real SP register at the end, so that the instruction can be restarted.

target-bfin/bfin-sim.c line 825

Quoted 3 lines
target-bfin/bfin-sim.c +3 -0
+    /* CC = CC; is invalid.  */
+    if (cbit == 5)
+        illegal_instruction(dc);

Please handle all checkpatch.pl style errors.

Quoted 4 lines
target-bfin/bfin-sim.c +4 -0
+    if (opc == 0) {
+        /* CC = ! BITTST (Dreg{dst}, imm{uimm}); */
+        tmp = tcg_temp_new();
+        tcg_gen_movi_tl(tmp, 1 << uimm);

target-bfin/bfin-sim.c line 1173

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+        tcg_gen_and_tl(tmp, tmp, cpu_dreg[dst]);
+        tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_cc, tmp, 0);
+        tcg_temp_free(tmp);
+    } else if (opc == 1) {
+        /* CC = BITTST (Dreg{dst}, imm{uimm}); */
+        tmp = tcg_temp_new();
+        tcg_gen_movi_tl(tmp, 1 << uimm);
+        tcg_gen_and_tl(tmp, tmp, cpu_dreg[dst]);
+        tcg_gen_setcondi_tl(TCG_COND_NE, cpu_cc, tmp, 0);
+        tcg_temp_free(tmp);

You're writing

	(x & (1 << I)) != 0

whereas the alternative

	(x >> I) & 1

does not require the setcond, and will be faster on most hosts.

target-bfin/bfin-sim.c line 1330

Quoted 7 lines
target-bfin/bfin-sim.c +7 -0
+    if (aop == 1 && W == 0 && idx == ptr) {
+        /* Dreg_lo{reg} = W[Preg{ptr}]; */
+        tmp = tcg_temp_local_new();
+        tcg_gen_andi_tl(cpu_dreg[reg], cpu_dreg[reg], 0xffff0000);
+        gen_aligned_qemu_ld16u(dc, tmp, cpu_preg[ptr]);
+        tcg_gen_or_tl(cpu_dreg[reg], cpu_dreg[reg], tmp);
+        tcg_temp_free(tmp);

Deposit again. Lots of instances in this function.

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+        /* LINK imm{framesize}; */
+        int size = uimm16s4(framesize);
+        tcg_gen_subi_tl(cpu_spreg, cpu_spreg, 4);
+        tcg_gen_qemu_st32(cpu_rets, cpu_spreg, dc->mem_idx);
+        tcg_gen_subi_tl(cpu_spreg, cpu_spreg, 4);
+        tcg_gen_qemu_st32(cpu_fpreg, cpu_spreg, dc->mem_idx);

target-bfin/bfin-sim.c line 1975

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+        tcg_gen_mov_tl(cpu_fpreg, cpu_spreg);
+        tcg_gen_subi_tl(cpu_spreg, cpu_spreg, size);
+    } else if (framesize == 0) {
+        /* UNLINK; */
+        /* Restore SP from FP.  */
+        tcg_gen_mov_tl(cpu_spreg, cpu_fpreg);
+        tcg_gen_qemu_ld32u(cpu_fpreg, cpu_spreg, dc->mem_idx);
+        tcg_gen_addi_tl(cpu_spreg, cpu_spreg, 4);
+        tcg_gen_qemu_ld32u(cpu_rets, cpu_spreg, dc->mem_idx);
+        tcg_gen_addi_tl(cpu_spreg, cpu_spreg, 4);

Similarly to push/pop multiple wrt intermediate SP.

target-bfin/bfin-sim.c line 2162

Quoted 9 lines
target-bfin/bfin-sim.c +9 -0
+    if ((aop == 0 || aop == 2) && aopcde == 9 && HL == 0 && s == 0) {
+        int a = aop >> 1;
+        /* Areg_lo{a} = Dreg_lo{src0}; */
+        tcg_gen_andi_i64(cpu_areg[a], cpu_areg[a], ~0xffff);
+        tmp64 = tcg_temp_new_i64();
+        tcg_gen_extu_i32_i64(tmp64, cpu_dreg[src0]);
+        tcg_gen_andi_i64(tmp64, tmp64, 0xffff);
+        tcg_gen_or_i64(cpu_areg[a], cpu_areg[a], tmp64);
+        tcg_temp_free_i64(tmp64);

More deposits in this function. I'll stop mentioning them, but pretty much every place you touch aregs can use this.

Quoted 5 lines
target-bfin/bfin-sim.c +5 -0
+#include "linux-fixed-code.h"
+
+static uint32_t bfin_lduw_code(DisasContext *dc, target_ulong pc)
+{
+#ifdef CONFIG_USER_ONLY

target-bfin/bfin-sim.c line 3535

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+    /* Intercept jump to the magic kernel page */
+    if (((dc->env->personality & 0xff/*PER_MASK*/) == 0/*PER_LINUX*/) &&
+        (pc & 0xFFFFFF00) == 0x400) {
+        uint32_t off = pc - 0x400;
+        if (off < sizeof(bfin_linux_fixed_code)) {
+            return ((uint16_t)bfin_linux_fixed_code[off + 1] << 8) |
+                   bfin_linux_fixed_code[off];
+        }
+    }
+#endif

Surely this memory setup belongs in linux-user/.

target-bfin/bfin-sim.c line 3656

Quoted 5 lines
target-bfin/bfin-sim.c +5 -0
+/* Interpret a single Blackfin insn; breaks up parallel insns */
+static void
+interp_insn_bfin(DisasContext *dc)
+{
+    _interp_insn_bfin(dc, dc->pc);

I'd prefer a suffix like "1" rather than a prefix of "_".

target-bfin/bfin-sim.c

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+typedef struct CPUBfinState {
+    CPU_COMMON

COMMON should come last, or just about. Certainly the cpu registers should come first, for most efficient translation access on the host.

target-bfin/bfin-sim.c

Quoted 5 lines
target-bfin/bfin-sim.c +5 -0
+static inline void bfin_astat_write(CPUArchState *env, uint32_t astat)
+{
+    unsigned int i;
+    for (i = 0; i < 32; ++i)
+        env->astat[i] = !!(astat & (1 << i));

= (astat >> i) & 1

Quoted 13 lines
target-bfin/bfin-sim.c +13 -0
+typedef void (*hwloop_callback)(struct DisasContext *dc, int loop);
+
+typedef struct DisasContext {
+    CPUArchState *env;
+    struct TranslationBlock *tb;
+    /* The current PC we're decoding (could be middle of parallel insn) */
+    target_ulong pc;
+    /* Length of current insn (2/4/8) */
+    target_ulong insn_len;
+
+    /* For delayed ASTAT handling */
+    enum astat_ops astat_op;
+

target-bfin/bfin-sim.c

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+    /* For hardware lop processing */
+    hwloop_callback hwloop_callback;
+    void *hwloop_data;
+
+    /* Was a DISALGNEXCPT used in this parallel insn ? */
+    int disalgnexcpt;
+
+    int is_jmp;
+    int mem_idx;
+} DisasContext;

Really, this type should be private to translate.c.

target-bfin/bfin-sim.c

Quoted 7 lines
target-bfin/bfin-sim.c +7 -0
+static inline void cpu_get_tb_cpu_state(CPUArchState *env, target_ulong *pc,
+                                        target_ulong *cs_base, int *flags)
+{
+    *pc = cpu_get_pc(env);
+    *cs_base = 0;
+    *flags = env->astat[ASTAT_RND_MOD];
+}

You'll probably be better off with a bit that notes whether the loop registers are active, or something, so that you don't have to always generate code that handles them.

Quoted 1 line

+DEF_HELPER_3(raise_exception, void, env, i32, i32)

Lots of these can use better settings for flags. Here, the only side effect is to raise an exception, which leads to reading the globals. So TCG_CALL_NO_WG.

target-bfin/bfin-sim.c

Quoted 4 lines
target-bfin/bfin-sim.c +4 -0
+DEF_HELPER_5(memalign, void, env, i32, i32, i32, i32)
+
+DEF_HELPER_4(dbga_l, void, env, i32, i32, i32)
+DEF_HELPER_4(dbga_h, void, env, i32, i32, i32)

Likewise.

target-bfin/bfin-sim.c

Quoted 9 lines
target-bfin/bfin-sim.c +9 -0
+/* Count the number of bits set to 1 in the 32bit value */
+uint32_t HELPER(ones)(uint32_t val)
+{
+    uint32_t i;
+    uint32_t ret;
+
+    ret = 0;
+    for (i = 0; i < 32; ++i)
+        ret += !!(val & (1 << i));

ctpop32.

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+/* Count number of leading bits that match the sign bit */
+uint32_t HELPER(signbits)(uint32_t val, uint32_t size)

...

target-bfin/bfin-sim.c

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+/* Count number of leading bits that match the sign bit */
+uint32_t HELPER(signbits_64)(uint64_t val, uint32_t size)

Surely we can make some use of clz here. But I guess for now this is ok.

Quoted 5 lines
target-bfin/bfin-sim.c +5 -0
+static void gen_goto_tb(DisasContext *dc, int tb_num, TCGv dest)
+{
+/*
+    TranslationBlock *tb;
+    tb = dc->tb;

target-bfin/bfin-sim.c

Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+
+    if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
+        tcg_gen_goto_tb(tb_num);
+        tcg_gen_mov_tl(cpu_pc, dest);
+        tcg_gen_exit_tb((long)tb + tb_num);
+    } else */{
+        gen_astat_update(dc, false);
+        tcg_gen_mov_tl(cpu_pc, dest);
+        tcg_gen_exit_tb(0);
+    }

Why the astat update here, when you have it on almost no other exits from the tb?

target-bfin/bfin-sim.c

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+        if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP)))
+            tcg_gen_debug_insn_start(dc->pc);

CPU_LOG_TB_OP | CPU_LOG_TB_OP_OPT

r~

#7 lore raw

Re: [Qemu-devel] [PATCH 2/5] Blackfin: initial port

On Tuesday 25 June 2013 17:23:57 Richard Henderson wrote:

whee, got a review! :) i've snipped items that were obvious in the "i'll go do this" category rather than just copying & pasting "OK" many times. got a long flight coming up soon, so hopefully i can tackle the majority of this work then.

Quoted 3 lines

target-bfin/bfin-sim.c

Quoted 1 line
target-bfin/bfin-sim.c +0 -0

Why this separate file from translate.c?

because this port is based on the GNU/sim Blackfin port. bfin-sim.c focuses on the actual opcode translation while the higher level file (translate.c in QEMU and interp.c in GNU/sim) takes care of the higher layers (like clock ticking). i like keeping the core structure the same between the two sims so that i can more easily merge changes between them.

Quoted 9 lines

target-bfin/bfin-sim.c line 15

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>

Certainly you shouldn't need these, since this isn't a separately compiled object -- you're included from translate.c.

yes, this is most likely true. it's due to the previous reason. maybe i should make it a sep compiled file then there won't be any confusion ...

Quoted 3 lines
Quoted 1 line

+#define HOST_LONG_WORD_SIZE (sizeof(long) * 8)

You mean TCG_TARGET_REG_BITS?

maybe? this is for extracting target encoded immediates and properly extending them up to the system that is running the code (e.g. x86_64) so that it can then be checked naturally (like comparing it to a -1). but this is done in the decode logic, not in the tcg output logic, so i'm not sure TCG is the right abstraction.

Quoted 4 lines
Quoted 4 lines
target-bfin/bfin-sim.c +4 -0
+static TCGv
+get_allreg(DisasContext *dc, int grp, int reg)
+{
+    TCGv *ret = cpu_regs[(grp << 3) | reg];
Quoted 8 lines

target-bfin/bfin-sim.c line 202

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+    if (ret) {
+       return *ret;
+    }
+    abort();
+    illegal_instruction(dc);
+}

Well, which is it? abort or illegal_instruction.

i had this in there while doing the initial port to track down bad things. i can probably cut it over to illegal_instruction() now.

Quoted 3 lines

And come to that, how is
abort any better than SEGV from dereferecing the null? Certainly the later will generate a faster translator...

QEMU doesn't need any help segfaulting :p. an abort() is much better at showing the source of the problem.

Quoted 10 lines

target-bfin/bfin-sim.c line 225

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+decode_multfunc_tl(DisasContext *dc, int h0, int h1, int src0, int src1,
+                   int mmod, int MM, TCGv psat)
+{
+    TCGv s0, s1, val;
+
+    s0 = tcg_temp_local_new();

You'll really want to avoid local temps and branches, if at all possible. For some of the more complex stuff that you're open-coding, you may be better off with helper functions instead.

it seemed like having generated (and cached) opcodes was better than relying on helpers since helpers requires interrupting the native code flow and muck around with state ? is there a good (or even semi-decent) rule of thumb i can use to decide when to use one over the other ?

Quoted 5 lines

target-bfin/bfin-sim.c line 320

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+static void
+saturate_s32(TCGv_i64 val, TCGv overflow)

I shall now stop mentioning movcond. I sense there are many locations to come.

looks like movcond was introduced after i did the initial (bulk) port. so there are probably many locations that can take advantage of it. i'll have to go through the code top-to-bottom looking for things. and probably look at the history of tcg/README to see what other interesting opcodes have been added since.

Quoted 9 lines

target-bfin/bfin-sim.c line 469

Quoted 8 lines
target-bfin/bfin-sim.c +8 -0
+    } else if (prgfunc == 11 && poprnd < 6) {
+        /* TESTSET (Preg{poprnd}); */
+        TCGv tmp = tcg_temp_new();
+        tcg_gen_qemu_ld8u(tmp, cpu_preg[poprnd], dc->mem_idx);
+        tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_cc, tmp, 0);
+        tcg_gen_ori_tl(tmp, tmp, 0x80);
+        tcg_gen_qemu_st8(tmp, cpu_preg[poprnd], dc->mem_idx);
+        tcg_temp_free(tmp);
Quoted 3 lines

I'll note that this is fine for system code, but for user code ought to be atomic. There are a bunch of really bad examples in the tree, and no real good solutions atm.

i general, i completely agree with you. in practice, i think a (mis)feature of the Blackfin arch helps out here. TESTSET doesn't work on cached memory, and it only works on system memory (i.e. not L1), and every Linux build runs with caches turned on. so maybe flaky misbehavior is a good thing ? :)

i can drop a note in there noting the issue though

Quoted 10 lines

target-bfin/bfin-sim.c

Quoted 2 lines
target-bfin/bfin-sim.c +2 -0
+    /* Everything here needs to be aligned, so check once */
+    gen_align_check(dc, cpu_spreg, 4, false);

You ought not need to generate explicit alignment checks. Yes, we don't do that correctly for user-mode, but we do for system mode.

My hope is that user mode eventually has the option of using the system mode page tables too -- there are just too many things that don't work correctly when host and target page sizes don't match, or the host and target don't have the same unaligned access characteristics.

i had this code because it wasn't working in user mode, and someone in a previous review suggested i check out gen_helper_memalign(). i actually have this disabled by default because the speed impact is fairly substantial. i was debating turning this into a configure time check.

Quoted 11 lines

target-bfin/bfin-sim.c line 594

Quoted 8 lines
target-bfin/bfin-sim.c +8 -0
+        } else if (grp == 4 && (reg == 0 || reg == 2)) {
+            /* Push A#.X */
+            tmp64 = tcg_temp_new_i64();
+            tcg_gen_shri_i64(tmp64, cpu_areg[reg >> 1], 32);
+            tmp = tcg_temp_new();
+            tcg_gen_trunc_i64_i32(tmp, tmp64);
+            tcg_temp_free_i64(tmp64);
+            tcg_gen_andi_tl(tmp, tmp, 0xff);

Do we ever allow the high 24 bits to be non-zero? Is this andi actually redundant?

yes & no. in the hardware, it'll always be 0. there is some code which will might sign extend things (so that you can correctly compare the 40bit accumulator using 64bit regs), and that would interact badly here. maybe it would be better to drop this and force the accumulator handling code to do the right thing with the sign rather than store the result.

Quoted 9 lines

target-bfin/bfin-sim.c line 641

Quoted 8 lines
target-bfin/bfin-sim.c +8 -0
+    if (W == 1) {
+        /* [--SP] = ({d}R7:imm{dr}, {p}P5:imm{pr}); */
+        if (d) {
+            for (i = dr; i < 8; i++) {
+                tcg_gen_subi_tl(cpu_spreg, cpu_spreg, 4);
+                tcg_gen_qemu_st32(cpu_dreg[i], cpu_spreg, dc->mem_idx);
+            }
+        }
Quoted 4 lines

What's the cpu exception effect of the second store causing a page fault? Normally one needs to do the address increment in a temporary and only update the real SP register at the end, so that the instruction can be restarted.

this was me being lazy when getting started with the port ;). the GNU/sim code matches the hardware and that is as you suspected -- the SP reg isn't updated until after all the push/pops finish. i wasn't sweating the difference here too much as in user mode, the exception would just kill the program (ignoring apps that catch like SIGSEGV).

i'll have to generate a tmp reg based on SP and do it correctly though now that this port is out of the infant stage.

Quoted 9 lines
Quoted 9 lines
target-bfin/bfin-sim.c +9 -0
+#include "linux-fixed-code.h"
+
+static uint32_t bfin_lduw_code(DisasContext *dc, target_ulong pc)
+{
+#ifdef CONFIG_USER_ONLY
+    /* Intercept jump to the magic kernel page */
+    if (((dc->env->personality & 0xff/*PER_MASK*/) == 0/*PER_LINUX*/) &&
+        (pc & 0xFFFFFF00) == 0x400) {
+        uint32_t off = pc - 0x400;
Quoted 8 lines

target-bfin/bfin-sim.c line 3535

Quoted 6 lines
target-bfin/bfin-sim.c +6 -0
+        if (off < sizeof(bfin_linux_fixed_code)) {
+            return ((uint16_t)bfin_linux_fixed_code[off + 1] << 8) |
+                   bfin_linux_fixed_code[off];
+        }
+    }
+#endif

Surely this memory setup belongs in linux-user/.

i couldn't find good examples previously to make this work so i put it in here. i came across the arm handling of its fixed code recently though (which i think does it in linux-user), so i'll see about moving it there.

Quoted 7 lines

target-bfin/bfin-sim.c line 3656

Quoted 5 lines
target-bfin/bfin-sim.c +5 -0
+/* Interpret a single Blackfin insn; breaks up parallel insns */
+static void
+interp_insn_bfin(DisasContext *dc)
+{
+    _interp_insn_bfin(dc, dc->pc);

I'd prefer a suffix like "1" rather than a prefix of "_".

this matches the GNU/sim code, so i'd prefer to stick to that where possible. underscore prefix is a common "this is internal" indicator.

Quoted 11 lines

target-bfin/bfin-sim.c

Quoted 7 lines

+static inline void cpu_get_tb_cpu_state(CPUArchState *env, target_ulong
*pc, + target_ulong *cs_base, int
*flags) +{

target-bfin/bfin-sim.c +4 -0
+    *pc = cpu_get_pc(env);
+    *cs_base = 0;
+    *flags = env->astat[ASTAT_RND_MOD];
+}

You'll probably be better off with a bit that notes whether the loop registers are active, or something, so that you don't have to always generate code that handles them.

whether loop registers are active is purely based on the PC and the current values in the loop registers/counters. the hardware logic is basically:

	# After every single insn is executed.
	oldpc = PC
	PC += insn_length;
	if (oldpc == LB1 && LC1) {
		PC = LT1;
		--LC1;
	}
	if (oldpc == LB0 && LB0) {
		PC = LT0;
		--LC0;
	}

i didn't think it was really possible to check the cpu state at runtime since ideally you'd generate a bunch of TB's, cache them, and then let them run w/out invoking the translator again.

Quoted 5 lines
Quoted 1 line

+DEF_HELPER_3(raise_exception, void, env, i32, i32)

Lots of these can use better settings for flags. Here, the only side effect is to raise an exception, which leads to reading the globals. So TCG_CALL_NO_WG.

the flags are newer than the port, so i'll have to go through them all for a refresh

Quoted 10 lines
Quoted 10 lines
target-bfin/bfin-sim.c +10 -0
+static void gen_goto_tb(DisasContext *dc, int tb_num, TCGv dest)
+{
+/*
+    TranslationBlock *tb;
+    tb = dc->tb;
+
+    if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
+        tcg_gen_goto_tb(tb_num);
+        tcg_gen_mov_tl(cpu_pc, dest);
+        tcg_gen_exit_tb((long)tb + tb_num);
Quoted 8 lines

target-bfin/bfin-sim.c

Quoted 5 lines
target-bfin/bfin-sim.c +5 -0
+    } else */{
+        gen_astat_update(dc, false);
+        tcg_gen_mov_tl(cpu_pc, dest);
+        tcg_gen_exit_tb(0);
+    }

Why the astat update here, when you have it on almost no other exits from the tb?

it's really the only way i could get it to [mostly] work :/. i tried to figure out how x86 was handling its delayed eflags updates (since Blackfin will do pretty much the same exact thing for the same reason), but i failed at that too.

in general, the TB logic is magic to me. there are a number of optimizations that are blocked because i haven't been able to figure it out. i'm surprised it really works at all. you can see how my gen_goto_tb always does tct_gen_exit_tb(0) which forces a PC look up every time.
-mike

#8 lore raw

Re: [Qemu-devel] [PATCH 2/5] Blackfin: initial port

In reply to Mike Frysinger
Quoted 25 lines · Mike Frysinger

This is the core Blackfin support. While most things work that gcc will generate, there are notable things missing at this point:
- many dsp/alu/mac insns not supported
- no saturation support
- many astat flags not updated
- probably other stuff
Details as to what is missing "by design" vs "not done due to laziness" can be sorted out in the Blackfin README/TODO files.

FLAT and FDPIC ELFs however seem to work nicely, as do random samplings of apps from a typical build.

---
 MAINTAINERS                    |    5 +
 configure                      |    4 +
 cpu-exec.c                     |    5 +-
 gdbstub.c                      |  103 ++
 include/elf.h                  |    6 +
 qapi-schema.json               |    9 +-

+++ b/qapi-schema.json

qapi-schema.json +0 -0
@@ -3023,10 +3023,11 @@
 # Since: 1.2.0
 ##

qapi-schema.json line 3030

Quoted 10 lines
qapi-schema.json +5 -4
 { 'enum': 'TargetType',
-  'data': [ 'alpha', 'arm', 'cris', 'i386', 'lm32', 'm68k', 'microblazeel',
-            'microblaze', 'mips64el', 'mips64', 'mipsel', 'mips', 'moxie',
-            'or32', 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb', 'sh4',
-            'sparc64', 'sparc', 'unicore32', 'x86_64', 'xtensaeb', 'xtensa' ] }
+  'data': [ 'alpha', 'arm', 'bfin', 'cris', 'i386', 'lm32', 'm68k',
+            'microblazeel', 'microblaze', 'mips64el', 'mips64', 'mipsel',
+            'mips', 'moxie', 'or32', 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb',
+            'sh4', 'sparc64', 'sparc', 'unicore32', 'x86_64', 'xtensaeb',
+            'xtensa' ] }

This conflicts with Paolo's patches that removed TargetType. Just drop this hunk.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#9 lore raw

Re: [Qemu-devel] [PATCH 2/5] Blackfin: initial port

In reply to Mike Frysinger

Hi,

Am 17.06.2013 09:16, schrieb Mike Frysinger:

target-bfin/cpu-qom.h

Quoted 5 lines
target-bfin/cpu-qom.h new file +0 -0
new file mode 100644
index 0000000..697797b

For a new target, a separate cpu-qom.h should be unnecessary - it has become impossible to include it without cpu.h. Just inline it into cpu.h and group CPUState vs. CPUBfinState stuff together there.

Quoted 30 lines
target-bfin/cpu-qom.h new file +29 -0
@@ -0,0 +1,61 @@
+/*
+ * QEMU Blackfin CPU
+ *
+ * Copyright 2007-2013 Mike Frysinger
+ * Copyright 2007-2011 Analog Devices, Inc.
+ *
+ * Licensed under the Lesser GPL 2 or later.
+ */
+
+#ifndef QEMU_BFIN_CPU_QOM_H
+#define QEMU_BFIN_CPU_QOM_H
+
+#include "qom/cpu.h"
+
+#define TYPE_BFIN_CPU "bfin-cpu"
+
+#define BFIN_CPU_CLASS(klass) \
+    OBJECT_CLASS_CHECK(BfinCPUClass, (klass), TYPE_BFIN_CPU)
+#define BFIN_CPU(obj) \
+    OBJECT_CHECK(BfinCPU, (obj), TYPE_BFIN_CPU)
+#define BFIN_CPU_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(BfinCPUClass, (obj), TYPE_BFIN_CPU)
+
+/**
+ * BfinCPUClass:
+ * @parent_reset: The parent class' reset handler.
+ *
+ * An Bfin CPU model.
+ */

target-bfin/cpu-qom.h line 39

Quoted 10 lines
target-bfin/cpu-qom.h new file +10 -0
+typedef struct BfinCPUClass {
+    /*< private >*/
+    CPUClass parent_class;
+    /*< public >*/
+
+    void (*parent_reset)(CPUState *cpu);
+} BfinCPUClass;
+
+/**
+ * BfinCPU:

QOM types should have verbose, readable names. Please use BlackfinCPU, BlackfinCPUClass, TYPE_BLACKFIN_CPU.
By contrast, CPUBfinState, bfin_cpu_... and bfin-cpu are totally fine, I guess.

target-bfin/cpu-qom.h line 40

Quoted 1 line
target-bfin/cpu-qom.h new file +1 -0
+ * @env: #CPUArchState

Please don't use CPUArchState anywhere in bfin code except for the #define CPUArchState CPUBfinState.

target-bfin/cpu-qom.h line 52

Quoted 12 lines
target-bfin/cpu-qom.h new file +12 -0
+ *
+ * An Bfin CPU.
+ */
+typedef struct BfinCPU {
+    /*< private >*/
+    CPUState parent_obj;
+    /*< public >*/
+
+    CPUArchState env;
+} BfinCPU;
+
+static inline BfinCPU *bfin_env_get_cpu(CPUArchState *env)

CPUbfinState *env

target-bfin/cpu-qom.h line 54

Quoted 2 lines
target-bfin/cpu-qom.h new file +2 -0
+{
+    return BFIN_CPU(container_of(env, BfinCPU, env));

I've just posted a patch to drop these FOO_CPU() casts from all targets. While there's no ACK yet, there was agreement on v1, so please just return the container_of() here.

Quoted 21 lines
target-bfin/cpu-qom.h new file +7 -0
+}
+
+#define ENV_GET_CPU(e) CPU(bfin_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(BfinCPU, env)
+
+#endif
target-bfin/cpu.c new file +8 -0
new file mode 100644
index 0000000..871a1a1
@@ -0,0 +1,55 @@
+/*
+ * QEMU Blackfin CPU
+ *
+ * Copyright 2007-2013 Mike Frysinger
+ * Copyright 2007-2011 Analog Devices, Inc.
+ *
+ * Licensed under the Lesser GPL 2 or later.
+ */

target-bfin/cpu.c line 18

Quoted 10 lines
target-bfin/cpu.c new file +10 -0
+
+#include "cpu.h"
+#include "qemu-common.h"
+
+
+/* CPUClass::reset() */
+static void bfin_cpu_reset(CPUState *s)
+{
+    BfinCPU *cpu = BFIN_CPU(s);
+    CPUArchState *env = &cpu->env;

CPUBfinState *

Missing memset(env, 0, offsetof(CPUBfinState, breakpoints)).

Quoted 144 lines
target-bfin/cpu.c new file +37 -0
+
+    env->pc = 0xEF000000;
+}
+
+static void bfin_cpu_initfn(Object *obj)
+{
+    CPUState *cs = CPU(obj);
+    BfinCPU *cpu = BFIN_CPU(obj);
+    CPUArchState *env = &cpu->env;
+
+    cs->env_ptr = env;
+    cpu_exec_init(env);
+}
+
+static void bfin_cpu_class_init(ObjectClass *oc, void *data)
+{
+    CPUClass *cc = CPU_CLASS(oc);
+
+    cc->reset = bfin_cpu_reset;
+}
+
+static const TypeInfo bfin_cpu_type_info = {
+    .name = TYPE_BFIN_CPU,
+    .parent = TYPE_CPU,
+    .instance_size = sizeof(BfinCPU),
+    .instance_init = bfin_cpu_initfn,
+    .abstract = false,
+    .class_size = sizeof(BfinCPUClass),
+    .class_init = bfin_cpu_class_init,
+};
+
+static void bfin_cpu_register_types(void)
+{
+    type_register_static(&bfin_cpu_type_info);
+}
+
+type_init(bfin_cpu_register_types)
target-bfin/cpu.h new file +101 -0
new file mode 100644
index 0000000..d288197
@@ -0,0 +1,236 @@
+/*
+ * Blackfin emulation
+ *
+ * Copyright 2007-2013 Mike Frysinger
+ * Copyright 2007-2011 Analog Devices, Inc.
+ *
+ * Licensed under the Lesser GPL 2 or later.
+ */
+
+#ifndef CPU_BFIN_H
+#define CPU_BFIN_H
+
+struct DisasContext;
+
+#define TARGET_LONG_BITS 32
+
+#define ELF_MACHINE	EM_BLACKFIN
+
+#define CPUArchState struct CPUBfinState
+
+#include "config.h"
+#include "qemu-common.h"
+#include "exec/cpu-defs.h"
+
+#define TARGET_HAS_ICE 1
+
+#define EXCP_SYSCALL        0
+#define EXCP_SOFT_BP        1
+#define EXCP_STACK_OVERFLOW 3
+#define EXCP_SINGLE_STEP    0x10
+#define EXCP_TRACE_FULL     0x11
+#define EXCP_UNDEF_INST     0x21
+#define EXCP_ILL_INST       0x22
+#define EXCP_DCPLB_VIOLATE  0x23
+#define EXCP_DATA_MISALGIN  0x24
+#define EXCP_UNRECOVERABLE  0x25
+#define EXCP_DCPLB_MISS     0x26
+#define EXCP_DCPLB_MULT     0x27
+#define EXCP_EMU_WATCH      0x28
+#define EXCP_MISALIG_INST   0x2a
+#define EXCP_ICPLB_PROT     0x2b
+#define EXCP_ICPLB_MISS     0x2c
+#define EXCP_ICPLB_MULT     0x2d
+#define EXCP_ILL_SUPV       0x2e
+#define EXCP_ABORT          0x100
+#define EXCP_DBGA           0x101
+#define EXCP_OUTC           0x102
+
+#define CPU_INTERRUPT_NMI   CPU_INTERRUPT_TGT_EXT_1
+
+#define BFIN_L1_CACHE_BYTES 32
+
+/* Blackfin does 1K/4K/1M/4M, but for now only support 4k */
+#define TARGET_PAGE_BITS    12
+#define NB_MMU_MODES        2
+
+#define TARGET_PHYS_ADDR_SPACE_BITS 32
+#define TARGET_VIRT_ADDR_SPACE_BITS 32
+
+#define cpu_init cpu_bfin_init
+#define cpu_exec cpu_bfin_exec
+#define cpu_gen_code cpu_bfin_gen_code
+#define cpu_signal_handler cpu_bfin_signal_handler
+
+/* Indexes into astat array; matches bitpos in hardware too */
+enum {
+    ASTAT_AZ = 0,
+    ASTAT_AN,
+    ASTAT_AC0_COPY,
+    ASTAT_V_COPY,
+    ASTAT_CC = 5,
+    ASTAT_AQ,
+    ASTAT_RND_MOD = 8,
+    ASTAT_AC0 = 12,
+    ASTAT_AC1,
+    ASTAT_AV0 = 16,
+    ASTAT_AV0S,
+    ASTAT_AV1,
+    ASTAT_AV1S,
+    ASTAT_V = 24,
+    ASTAT_VS
+};
+
+typedef struct CPUBfinState {
+    CPU_COMMON
+    int personality;
+
+    uint32_t dreg[8];
+    uint32_t preg[8];
+    uint32_t ireg[4];
+    uint32_t mreg[4];
+    uint32_t breg[4];
+    uint32_t lreg[4];
+    uint64_t areg[2];
+    uint32_t rets;
+    uint32_t lcreg[2], ltreg[2], lbreg[2];
+    uint32_t cycles[2];
+    uint32_t uspreg;
+    uint32_t seqstat;
+    uint32_t syscfg;
+    uint32_t reti;

target-bfin/cpu.h line 111

Quoted 10 lines
target-bfin/cpu.h new file +10 -0
+    uint32_t retx;
+    uint32_t retn;
+    uint32_t rete;
+    uint32_t emudat;
+    uint32_t pc;
+
+    /* ASTAT bits; broken up for speeeeeeeed */
+    uint32_t astat[32];
+    /* ASTAT delayed helpers */
+    uint32_t astat_op, astat_arg[3];

Are you sure this field placement is what you want? Usually reset memset()s all fields up to breakpoints (inside CPU_COMMON) so registers are usually placed before CPU_COMMON.

Any field that is not a register accessed by TCG should rather be in BlackfinCPU or BlackfinCPUClass - personality sounds like a candidate?

Quoted 64 lines
target-bfin/cpu.h new file +64 -0
+} CPUBfinState;
+#define spreg preg[6]
+#define fpreg preg[7]
+
+static inline uint32_t bfin_astat_read(CPUArchState *env)
+{
+    unsigned int i, ret;
+
+    ret = 0;
+    for (i = 0; i < 32; ++i)
+        ret |= (env->astat[i] << i);
+
+    return ret;
+}
+
+static inline void bfin_astat_write(CPUArchState *env, uint32_t astat)
+{
+    unsigned int i;
+    for (i = 0; i < 32; ++i)
+        env->astat[i] = !!(astat & (1 << i));
+}
+
+enum astat_ops {
+    ASTAT_OP_NONE,
+    ASTAT_OP_DYNAMIC,
+    ASTAT_OP_ABS,
+    ASTAT_OP_ABS_VECTOR,
+    ASTAT_OP_ADD16,
+    ASTAT_OP_ADD32,
+    ASTAT_OP_ASHIFT16,
+    ASTAT_OP_ASHIFT32,
+    ASTAT_OP_COMPARE_SIGNED,
+    ASTAT_OP_COMPARE_UNSIGNED,
+    ASTAT_OP_LOGICAL,
+    ASTAT_OP_LSHIFT16,
+    ASTAT_OP_LSHIFT32,
+    ASTAT_OP_LSHIFT_RT16,
+    ASTAT_OP_LSHIFT_RT32,
+    ASTAT_OP_MIN_MAX,
+    ASTAT_OP_MIN_MAX_VECTOR,
+    ASTAT_OP_NEGATE,
+    ASTAT_OP_SUB16,
+    ASTAT_OP_SUB32,
+    ASTAT_OP_VECTOR_ADD_ADD,    /* +|+ */
+    ASTAT_OP_VECTOR_ADD_SUB,    /* +|- */
+    ASTAT_OP_VECTOR_SUB_SUB,    /* -|- */
+    ASTAT_OP_VECTOR_SUB_ADD,    /* -|+ */
+};
+
+typedef void (*hwloop_callback)(struct DisasContext *dc, int loop);
+
+typedef struct DisasContext {
+    CPUArchState *env;
+    struct TranslationBlock *tb;
+    /* The current PC we're decoding (could be middle of parallel insn) */
+    target_ulong pc;
+    /* Length of current insn (2/4/8) */
+    target_ulong insn_len;
+
+    /* For delayed ASTAT handling */
+    enum astat_ops astat_op;
+
+    /* For hardware loop processing */
+    hwloop_callback hwloop_callback;

target-bfin/cpu.h line 185

Quoted 10 lines
target-bfin/cpu.h new file +10 -0
+    void *hwloop_data;
+
+    /* Was a DISALGNEXCPT used in this parallel insn ? */
+    int disalgnexcpt;
+
+    int is_jmp;
+    int mem_idx;
+} DisasContext;
+
+void do_interrupt(CPUArchState *env);

do_interrupt() has recently been converted to a CPUClass hook.

Quoted 11 lines
target-bfin/cpu.h new file +11 -0
+CPUArchState *cpu_init(const char *cpu_model);
+int cpu_exec(CPUArchState *s);
+int cpu_bfin_signal_handler(int host_signum, void *pinfo, void *puc);
+
+extern const char * const greg_names[];
+extern const char *get_allreg_name(int grp, int reg);
+
+#define MMU_KERNEL_IDX 0
+#define MMU_USER_IDX   1
+
+int cpu_bfin_handle_mmu_fault(CPUArchState *env, target_ulong address, int rw,

target-bfin/cpu.h line 206

Quoted 10 lines
target-bfin/cpu.h new file +10 -0
+                              int mmu_idx);
+#define cpu_handle_mmu_fault cpu_bfin_handle_mmu_fault
+
+#if defined(CONFIG_USER_ONLY)
+static inline void cpu_clone_regs(CPUArchState *env, target_ulong newsp)
+{
+    if (newsp)
+        env->spreg = newsp;
+}
+#endif

Note there's a pending patch moving cpu_clone_regs() to linux-user/*/target_cpu.h.

Quoted 11 lines
target-bfin/cpu.h new file +11 -0
+
+#include "exec/cpu-all.h"
+#include "cpu-qom.h"
+
+static inline bool cpu_has_work(CPUState *cpu)
+{
+    return (cpu->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI));
+}
+
+#include "exec/exec-all.h"
+

target-bfin/cpu.h line 226

Quoted 10 lines
target-bfin/cpu.h new file +9 -0
+static inline void cpu_pc_from_tb(CPUArchState *env, TranslationBlock *tb)
+{
+    env->pc = tb->pc;
+}
+
 
+static inline target_ulong cpu_get_pc(CPUArchState *env)
+{
+    return env->pc;
+}

Unused?

Quoted 10 lines
target-bfin/cpu.h new file +10 -0
+
+static inline void cpu_get_tb_cpu_state(CPUArchState *env, target_ulong *pc,
+                                        target_ulong *cs_base, int *flags)
+{
+    *pc = cpu_get_pc(env);
+    *cs_base = 0;
+    *flags = env->astat[ASTAT_RND_MOD];
+}
+
+#endif

[...]

Quoted 5 lines
target-bfin/translate.c new file +0 -0
new file mode 100644
index 0000000..a619f66

[...]

Quoted 7 lines
target-bfin/translate.c new file +7 -0
+
+CPUArchState *cpu_init(const char *cpu_model)
+{
+    BfinCPU *cpu;
+    CPUArchState *env;
+    static int tcg_initialized = 0;
+

target-bfin/translate.c line 88

Quoted 10 lines
target-bfin/translate.c new file +10 -0
+    cpu = BFIN_CPU(object_new(TYPE_BFIN_CPU));
+    env = &cpu->env;
+
+    cpu_reset(CPU(cpu));
+    qemu_init_vcpu(env);
+
+    if (tcg_initialized)
+        return env;
+
+    tcg_initialized = 1;

Please place this into the CPU realizefn. Note that qemu_init_vcpu() is being moved to generic code with my next pull.

In light of possible bfin-softmmu support, please turn this function into BlackfinCPU *cpu_bfin_init(const char *cpu_model) and place cpu_init() as a static inline compatibility wrapper into cpu.h.

Quoted 46 lines
target-bfin/translate.c new file +46 -0
+
+#define GEN_HELPER 2
+#include "helper.h"
+
+    cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
+
+    cpu_pc = tcg_global_mem_new(TCG_AREG0,
+        offsetof(CPUArchState, pc), "PC");
+    cpu_cc = tcg_global_mem_new(TCG_AREG0,
+        offsetof(CPUArchState, astat[ASTAT_CC]), "CC");
+
+    /*cpu_astat_op = tcg_global_mem_new(TCG_AREG0,
+        offsetof(CPUArchState, astat_op), "astat_op");*/
+    cpu_astat_arg[0] = tcg_global_mem_new(TCG_AREG0,
+        offsetof(CPUArchState, astat_arg[0]), "astat_arg[0]");
+    cpu_astat_arg[1] = tcg_global_mem_new(TCG_AREG0,
+        offsetof(CPUArchState, astat_arg[1]), "astat_arg[1]");
+    cpu_astat_arg[2] = tcg_global_mem_new(TCG_AREG0,
+        offsetof(CPUArchState, astat_arg[2]), "astat_arg[2]");
+
+    cpu_areg[0] = tcg_global_mem_new_i64(TCG_AREG0,
+        offsetof(CPUArchState, areg[0]), "A0");
+    cpu_areg[1] = tcg_global_mem_new_i64(TCG_AREG0,
+        offsetof(CPUArchState, areg[1]), "A1");
+
+    bfin_tcg_new_set(dreg, 0);
+    bfin_tcg_new_set(preg, 8);
+    bfin_tcg_new_set(ireg, 16);
+    bfin_tcg_new_set(mreg, 20);
+    bfin_tcg_new_set(breg, 24);
+    bfin_tcg_new_set(lreg, 28);
+    bfin_tcg_new(rets, 39);
+    bfin_tcg_new(lcreg[0], 48);
+    bfin_tcg_new(ltreg[0], 49);
+    bfin_tcg_new(lbreg[0], 50);
+    bfin_tcg_new(lcreg[1], 51);
+    bfin_tcg_new(ltreg[1], 52);
+    bfin_tcg_new(lbreg[1], 53);
+    bfin_tcg_new_set(cycles, 54);
+    bfin_tcg_new(uspreg, 56);
+    bfin_tcg_new(seqstat, 57);
+    bfin_tcg_new(syscfg, 58);
+    bfin_tcg_new(reti, 59);
+    bfin_tcg_new(retx, 60);
+    bfin_tcg_new(retn, 61);
+    bfin_tcg_new(rete, 62);

target-bfin/translate.c line 144

Quoted 10 lines
target-bfin/translate.c new file +10 -0
+    bfin_tcg_new(emudat, 63);
+
+    return env;
+}
+
+#define _astat_printf(bit) cpu_fprintf(f, "%s" #bit " ", (env->astat[ASTAT_##bit] ? "" : "~"))
+void cpu_dump_state(CPUArchState *env, FILE *f,
+                    int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
+                    int flags)
+{

This will be converted to a CPUClass hook in my next pull.

[...]

target-bfin/translate.c line 1221

Quoted 4 lines
target-bfin/translate.c new file +4 -0
+static void
+gen_intermediate_code_internal(CPUArchState *env, TranslationBlock *tb,
+                               int search_pc)
+{

Please use BlackfinCPU and bool arguments here, I am about to convert all other targets (github.com/afaerber/qemu-cpu.git qom-cpu-11).

[...]

Quoted 7 lines
target-bfin/translate.c new file +7 -0
+
+void gen_intermediate_code(CPUArchState *env, struct TranslationBlock *tb)
+{
+    gen_intermediate_code_internal(env, tb, 0);
+}
+
+void gen_intermediate_code_pc(CPUArchState *env, struct TranslationBlock *tb)

target-bfin/translate.c line 1347

Quoted 10 lines
target-bfin/translate.c new file +10 -0
+{
+    gen_intermediate_code_internal(env, tb, 1);
+}
+
+void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb, int pc_pos)
+{
+    env->pc = tcg_ctx.gen_opc_pc[pc_pos];
+}
+
+#include "bfin-sim.c"

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg