Skip to contentSkip to conversation

new Blackfin QEMU port

PATCH In review Mike Frysinger 4 participants 14 messages Jan 24, 2011 – Feb 2, 2011 exec and binfmt

lore
Share & tools
lore
#0 lore raw

cover new Blackfin QEMU port

I finally got around to getting this port past the "only crashes" phase. Using the GNU sim Blackfin port as a nice working standard, it was just a matter of replacing the sim bits with TCG ops. Now we have a linux-user port for people to play with. No immediate plans to move on to the system step, but it is something I want to figure out at some point.

The port is at the point I think where people can bang on it. The core (bfin-sim.c) needs a bit more cleanup though before it'll be accepted, but that should be largely related to the insns that I haven't gotten around to implementing. The rest of the code should be fair game for review though if someone feels like it.

This does require some patches in order for userspace programs to be generally useful, but they've all been submitted at this point.

I don't know how people feel about test sizes. We developed quite a comprehension testsuite for the GNU sim, and I've imported about half of it. Personally, I find it invaluable to catch regressions while developing, but its raw size can be a bit intimidating.

As a simple comparison, we typically get about ~8mips with the GNU sim while executing Blackfin code, but I easily see about ~400mips with qemu. Obviously your numbers will vary based on workload, but hopefully not too much ...

My git tree with everything necessary can be found here:
git://sources.blackfin.uclinux.org/git/users/vapier/qemu.git

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

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

PATCH 2/4 Blackfin: initial port

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                   |    8 +-
 cpu-exec.c                  |    6 +-
 elf.h                       |    6 +
 gdbstub.c                   |  103 +
 scripts/qemu-binfmt-conf.sh |    4 +
 target-bfin/README          |   35 +
 target-bfin/TODO            |    5 +
 target-bfin/bfin-sim.c      | 4760 +++++++++++++++++++++++++++++++++++++++++++
 target-bfin/bfin-tdep.h     |   94 +
 target-bfin/cpu.h           |  215 ++
 target-bfin/exec.h          |   37 +
 target-bfin/helper.c        |   37 +
 target-bfin/helper.h        |   21 +
 target-bfin/op_helper.c     |  213 ++
 target-bfin/translate.c     | 1267 ++++++++++++
 16 files changed, 6813 insertions(+), 3 deletions(-)
 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.h
 create mode 100644 target-bfin/exec.h
 create mode 100644 target-bfin/helper.c
 create mode 100644 target-bfin/helper.h
 create mode 100644 target-bfin/op_helper.c
 create mode 100644 target-bfin/translate.c
MAINTAINERS +5 -0
index f20d390..0c71b89 100644
@@ -65,6 +65,11 @@ M: Paul Brook <[email protected]>
 S: Maintained
 F: target-arm/
 
+BLACKFIN
+M: Mike Frysinger <[email protected]>
+S: Maintained
+F: target-bfin/
+
 CRIS
 M: Edgar E. Iglesias <[email protected]>
 S: Maintained
configure +6 -2
index 350c66a..730039f 100755
@@ -280,7 +280,7 @@ else
 fi
 
 case "$cpu" in
-  alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64)
+  alpha|bfin|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64)
     cpu="$cpu"
   ;;
   i386|i486|i586|i686|i86pc|BePC)
@@ -2478,7 +2478,7 @@ echo "docdir=$docdir" >> $config_host_mak
 echo "confdir=$confdir" >> $config_host_mak
 
 case "$cpu" in
-  i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
+  i386|x86_64|alpha|bfin|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
     ARCH=$cpu
   ;;
   armv4b|armv4l)
@@ -2909,6 +2909,10 @@ case "$target_arch2" in
     gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
     target_phys_bits=32
   ;;
+  bfin)
+    bflt="yes"
+    target_phys_bits=32
+  ;;
   cris)
     target_nptl="yes"
     target_phys_bits=32
cpu-exec.c +5 -1
index 8c9fb8b..c151cc5 100644
@@ -266,6 +266,7 @@ int cpu_exec(CPUState *env1)
 #elif defined(TARGET_MICROBLAZE)
 #elif defined(TARGET_MIPS)
 #elif defined(TARGET_SH4)
+#elif defined(TARGET_BFIN)
 #elif defined(TARGET_CRIS)
 #elif defined(TARGET_S390X)
     /* XXXXX */
@@ -328,6 +329,8 @@ int cpu_exec(CPUState *env1)
                     do_interrupt(env);
 #elif defined(TARGET_SH4)
 		    do_interrupt(env);
+#elif defined(TARGET_BFIN)
+                    do_interrupt(env);
 #elif defined(TARGET_ALPHA)
                     do_interrupt(env);
 #elif defined(TARGET_CRIS)
@@ -363,7 +366,7 @@ int cpu_exec(CPUState *env1)
                     }
 #if defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_MIPS) || \
     defined(TARGET_PPC) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) || \
-    defined(TARGET_MICROBLAZE)
+    defined(TARGET_MICROBLAZE) || defined(TARGET_BFIN)
                     if (interrupt_request & CPU_INTERRUPT_HALT) {
                         env->interrupt_request &= ~CPU_INTERRUPT_HALT;
                         env->halted = 1;
@@ -663,6 +666,7 @@ int cpu_exec(CPUState *env1)
 #elif defined(TARGET_MICROBLAZE)
 #elif defined(TARGET_MIPS)
 #elif defined(TARGET_SH4)
+#elif defined(TARGET_BFIN)
 #elif defined(TARGET_ALPHA)
 #elif defined(TARGET_CRIS)
 #elif defined(TARGET_S390X)
elf.h +6 -0
index d2f24f4..0ceaf26 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 */
 
 /*
  * This is an interim value that we will use until the committee comes
@@ -675,6 +676,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.  */
gdbstub.c +103 -0

115 lines not on this page · raw message

scripts/qemu-binfmt-conf.sh +4 -0
index c50beb7..e2a65a2 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/README new file +35 -0
new file mode 100644
index 0000000..b989d55
@@ -0,0 +1,35 @@
+------------------
+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 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!
+
+	- unaligned memory access exceptions
+		- qemu itself doesn't support this for targets
+
+	- 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 +5 -0
new file mode 100644
index 0000000..fc1e69b
@@ -0,0 +1,5 @@
+CONFIG_NEED_MMU mmu.c
+
+CEC behavior in user-emulation (SP vs USP)
+
+see if making a global "0", "1", "2", and "4" register speeds things up
target-bfin/bfin-sim.c new file +4760 -0

2,750 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.h new file +215 -0

215 lines not on this page · raw message

target-bfin/exec.h new file +37 -0
new file mode 100644
index 0000000..9ca9225

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

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

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

target-bfin/helper.h new file +21 -0
new file mode 100644
index 0000000..690bb3b

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

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

213 lines not on this page · raw message

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

1,267 lines not on this page · raw message

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

Signature · 1 line
1.7.4.rc2

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

#2 lore raw

PATCH 3/4 Blackfin: add linux-user support

In reply to Mike Frysinger
---
 configure                           |    1 +
 default-configs/bfin-linux-user.mak |    1 +
 linux-user/bfin/syscall.h           |   59 ++++++
 linux-user/bfin/syscall_nr.h        |  388 +++++++++++++++++++++++++++++++++++
 linux-user/bfin/target_flat.h       |   91 ++++++++
 linux-user/bfin/target_signal.h     |   29 +++
 linux-user/bfin/termbits.h          |  227 ++++++++++++++++++++
 linux-user/elfload.c                |   39 ++++
 linux-user/main.c                   |   95 +++++++++
 linux-user/qemu.h                   |    4 +
 linux-user/syscall_defs.h           |   65 ++++++-
 11 files changed, 997 insertions(+), 2 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_signal.h
 create mode 100644 linux-user/bfin/termbits.h
configure +1 -0
index 730039f..ca9e1ba 100755
@@ -1004,6 +1004,7 @@ x86_64-linux-user \
 alpha-linux-user \
 arm-linux-user \
 armeb-linux-user \
+bfin-linux-user \
 cris-linux-user \
 m68k-linux-user \
 microblaze-linux-user \
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 +388 -0

388 lines not on this page · raw message

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

91 lines not on this page · raw message

linux-user/bfin/target_signal.h new file +29 -0
new file mode 100644
index 0000000..ba931d5
@@ -0,0 +1,29 @@
+#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(CPUState *env)
+{
+	return env->fpreg;
+}
+
+#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 +39 -0
index 8c6d448..b011345 100644
@@ -772,6 +772,45 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env)
 
 #endif
 
+#ifdef TARGET_BFIN
+
+#define ELF_START_MMAP 0x00000000
+
+#define elf_check_arch(x) ( (x) == EM_BLACKFIN )
+#define elf_is_fdpic(e)   ( (e)->e_flags & EF_BFIN_FDPIC )
+
+#define ELF_CLASS	ELFCLASS32
+#define ELF_DATA	ELFDATA2LSB
+#define ELF_ARCH	EM_BLACKFIN
+
+static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
+{
+	if (infop->personality == PER_LINUX_FDPIC) {
+		if (infop->other_info) {
+			/* dynamic */
+			regs->p0 = tswapl(infop->loadmap_addr);
+			regs->p1 = tswapl(infop->other_info->loadmap_addr);
+			regs->p2 = tswapl(infop->other_info->pt_dynamic_addr);
+		} else {
+			/* static */
+			regs->p0 = tswapl(infop->loadmap_addr);
+			regs->p1 = 0;
+			regs->p2 = tswapl(infop->pt_dynamic_addr);
+		}
+		regs->r7 = 0;
+	}
+	regs->pc = tswapl(infop->entry);
+	regs->usp = tswapl(infop->start_stack);
+}
+
+#define ELF_EXEC_PAGESIZE	4096
+
+/* See linux kernel: arch/blackfin/include/asm/elf.h.  */
+#define ELF_NREG 40
+typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
+
+#endif
+
 #ifdef TARGET_ALPHA
 
 #define ELF_START_MMAP (0x30000000000ULL)
linux-user/main.c +95 -0

107 lines not on this page · raw message

linux-user/qemu.h +4 -0
index 250814d..d825f9c 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/syscall_defs.h +63 -2

83 lines not on this page · raw message

Signature · 1 line
1.7.4.rc2
#3 lore raw
In reply to Mike Frysinger
Quoted 20 lines · Mike Frysinger

I finally got around to getting this port past the "only crashes" phase. Using the GNU sim Blackfin port as a nice working standard, it was just a matter of replacing the sim bits with TCG ops. Now we have a linux-user port for people to play with. No immediate plans to move on to the system step, but it is something I want to figure out at some point.

The port is at the point I think where people can bang on it. The core (bfin-sim.c) needs a bit more cleanup though before it'll be accepted, but that should be largely related to the insns that I haven't gotten around to implementing. The rest of the code should be fair game for review though if someone feels like it.

This does require some patches in order for userspace programs to be generally useful, but they've all been submitted at this point.

I don't know how people feel about test sizes. We developed quite a comprehension testsuite for the GNU sim, and I've imported about half of it. Personally, I find it invaluable to catch regressions while developing, but its raw size can be a bit intimidating.

Quoted 7 lines

As a simple comparison, we typically get about ~8mips with the GNU sim while executing Blackfin code, but I easily see about ~400mips with qemu. Obviously your numbers will vary based on workload, but hopefully not too much ...

My git tree with everything necessary can be found here:
git://sources.blackfin.uclinux.org/git/users/vapier/qemu.git

Hi,

First of all, nice work! Good to see that you've managed to get your port running.

I've had a quick look at your git and have a few (mostly general) comments:

* There's quite a bit of dead code left around. Please remove as much as possible to make things easier to read.

* There's a lot of code that doesn't use braces around if code bodies, for example in op_helper.c.

* Some operations seem to translate to large amounts of tcg code, maybe you should consider using helpers for those. An example is gen_rot_tl.

* Many of the helpers seem to be PURE and CONST but not declared so. See tcg/README for more info.

* Maybe you should rename target-bfin/opcode/bfin.h into target-bfin/opcodes.h? or similiar..

* gen_hwloop_check() seems to be looking at env->lbreg from the translator, is that OK? What happens if env->lbreg changes at runtime?

* cpu_get_tb_cpu_state() doesn't define any tb flags?

target-bfin/README:

"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)."

I think QEMU should aim to be fast and correct. There is no need to be cycle accurate but emulation should IMO always aim to produce the correct results.
If people provide patches to improve correctness, IMO those patches should be encouraged & accepted as long as they dont introduce unnecessary slowdowns (e.g, unless there are faster ways to achieve the same level of correctness). My suggestion is that you just remove those first sentences.

"- 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!"

This might be true for user emulation but I assume you'd want to fix this for system emulation (at some point in time). Maybe you should just note that it's not supported and leave it at that.

" - unaligned memory access exceptions
- qemu itself doesn't support this for targets"

There are targets that emulate trapping on unaligned memory accesses, for example MicroBlaze and IIRC SPARC.

Cheers

#4 lore raw
Quoted 3 lines · Edgar E. Iglesias

* Some operations seem to translate to large amounts of tcg code, maybe you should consider using helpers for those. An example is gen_rot_tl.

seems like generated native code is better even if it is larger

Quoted 2 lines

* Maybe you should rename target-bfin/opcode/bfin.h into target-bfin/opcodes.h? or similiar..

i prefer existing usage since it mirrors existing sourceware tree where this file comes from

Quoted 3 lines

* gen_hwloop_check() seems to be looking at env->lbreg from the translator, is that OK? What happens if env->lbreg changes at runtime?

this is taken care of already

Quoted 1 line

* cpu_get_tb_cpu_state() doesn't define any tb flags?

no idea what this func is supposed to do

Quoted 3 lines

I think QEMU should aim to be fast and correct. There is no need to be cycle accurate but emulation should IMO always aim to produce the correct results.

it does produce the correct results with correct insns. it is referring to invalid insns. the hardware itself sometimes produces undefined behavior with some invalid insns.

Quoted 9 lines

"- 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!"

This might be true for user emulation but I assume you'd want to fix this for system emulation (at some point in time). Maybe you should just note that it's not supported and leave it at that.

i dont see the point there either. in order to handle this, the majority of insns would need to store all their results in intermediates and then move them to their final destination.

Quoted 5 lines

"        - unaligned memory access exceptions
               - qemu itself doesn't support this for targets"

There are targets that emulate trapping on unaligned memory accesses, for example MicroBlaze and IIRC SPARC.

you mean via gen_helper_memalign ?
-mike

#5 lore raw
Quoted 6 lines · Mike Frysinger
Quoted 3 lines · Edgar E. Iglesias

* Some operations seem to translate to large amounts of tcg code, maybe you should consider using helpers for those. An example is gen_rot_tl.

seems like generated native code is better even if it is larger

Is this true even when you declare the helper function PURE and CONST? I'm not saying it isn't, but it's certainly worth giving it a shot since you seem to have implemented the helper way now anyways :)

Quoted 11 lines
Quoted 3 lines

* Maybe you should rename target-bfin/opcode/bfin.h into target-bfin/opcodes.h? or similiar..

i prefer existing usage since it mirrors existing sourceware tree where this file comes from

Quoted 3 lines

* gen_hwloop_check() seems to be looking at env->lbreg from the translator, is that OK? What happens if env->lbreg changes at runtime?

Quoted 5 lines

this is taken care of already

Quoted 1 line

* cpu_get_tb_cpu_state() doesn't define any tb flags?

no idea what this func is supposed to do

Qemu uses the tb flags as identifier for a translation block. So a tb is only reused, when the physical address, flags and code segment (x86 thing) are equal.

This can be used to have privileged operation checks in translated code and just put the privileged state flag in the tb flags. Then the same code address run in user mode is different from when it's run in kernel mode.

Quoted 15 lines
Quoted 4 lines

I think QEMU should aim to be fast and correct. There is no need to be cycle accurate but emulation should IMO always aim to produce the correct results.

it does produce the correct results with correct insns. it is referring to invalid insns. the hardware itself sometimes produces undefined behavior with some invalid insns.

Quoted 6 lines

"- 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!"

Quoted 7 lines
Quoted 3 lines

This might be true for user emulation but I assume you'd want to fix this for system emulation (at some point in time). Maybe you should just note that it's not supported and leave it at that.

i dont see the point there either. in order to handle this, the majority of insns would need to store all their results in intermediates and then move them to their final destination.

I guess you could just save off the register state on transaction start and restore it on transaction abort (page fault)? But yes, this is only really useful for system emulation, so you don't really have to care for now.

Alex

#6 lore raw
Quoted 9 lines · Alexander Graf
Quoted 4 lines · Mike Frysinger
Quoted 1 line · Edgar E. Iglesias

* cpu_get_tb_cpu_state() doesn't define any tb flags?

no idea what this func is supposed to do

Qemu uses the tb flags as identifier for a translation block. So a tb is only reused, when the physical address, flags and code segment (x86 thing) are equal.

Put another way, when you are generating code, if the code you generate will change based on the contents of something in the CPUState struct, then the bit of CPUState you are looking at has to be one of:
(1) encoded in the TB flags
(as Alexander says, "is CPU in privileged mode" is a popular choice)
(2) always constant for the life of the simulation (eg env->features if you have some sort of "target feature support" flags)
(3) specially handled so that when it changes then all TBs or at least all affected TBs are flushed (env->breakpoints is in this category)

...because the CPUState you're passed in is not guaranteed to be the state of the CPU at the PC which you are starting translation from.

Otherwise you have case
(4) a very hard to track down bug (qemu will in some
cases ask you to retranslate a block and if you don't generate binary-identical output the second time around things will go badly wrong)

So for instance here:

+static void gen_hwloop_check(DisasContext *dc)
+{
+ bool loop1, loop0;
+ int endl;
+
+ loop1 = (dc->pc == dc->env->lbreg[1]);
+ loop0 = (dc->pc == dc->env->lbreg[0]);

I suspect that this check of pc against the lbreg[] values should be being done in the generated code, not at translate time.

-- PMM

#7 lore raw
Quoted 45 lines · Peter Maydell
Quoted 9 lines · Alexander Graf
Quoted 4 lines · Mike Frysinger
Quoted 1 line · Edgar E. Iglesias

* cpu_get_tb_cpu_state() doesn't define any tb flags?

no idea what this func is supposed to do

Qemu uses the tb flags as identifier for a translation block. So a tb is only reused, when the physical address, flags and code segment (x86 thing) are equal.

Put another way, when you are generating code, if the code you generate will change based on the contents of something in the CPUState struct, then the bit of CPUState you are looking at has to be one of:
(1) encoded in the TB flags
(as Alexander says, "is CPU in privileged mode" is a popular choice)
(2) always constant for the life of the simulation (eg env->features if you have some sort of "target feature support" flags)
(3) specially handled so that when it changes then all TBs or at least all affected TBs are flushed (env->breakpoints is in this category)

...because the CPUState you're passed in is not guaranteed to be the state of the CPU at the PC which you are starting translation from.

Otherwise you have case
(4) a very hard to track down bug (qemu will in some cases ask you to retranslate a block and if you don't generate binary-identical output the second time around things will go badly wrong)

So for instance here:

(quoted diff) +7 -0
+static void gen_hwloop_check(DisasContext *dc)
+{
+    bool loop1, loop0;
+    int endl;
+
+    loop1 = (dc->pc == dc->env->lbreg[1]);
+    loop0 = (dc->pc == dc->env->lbreg[0]);
Quoted 3 lines

I suspect that this check of pc against the lbreg[] values should be being done in the generated code, not at translate time.

Ouch. Yes. General rule: never access env from translate.c :). If you need to check for anything, go through the tb flags. Or generate inline code that does the checks.

Thanks for the nice explanation Peter :)

Alex

#8 lore raw
Quoted 1 line · Alexander Graf

Ouch. Yes. General rule: never access env from translate.c :).

With the arm target I was tempted to restructure translate.c so that we copied the handful of "safe" bits of env that we used into the disas context struct right at the start, and then didn't pass env into the main translation functions at all. That would make it much harder to accidentally use bits of env that we should not, but in the end I decided against it because it would make my qemu-meego merging job that much harder...

-- PMM

#9 lore raw
In reply to Peter Maydell
Quoted 10 lines · Peter Maydell

So for instance here:

(quoted diff) +7 -0
+static void gen_hwloop_check(DisasContext *dc)
+{
+    bool loop1, loop0;
+    int endl;
+
+    loop1 = (dc->pc == dc->env->lbreg[1]);
+    loop0 = (dc->pc == dc->env->lbreg[0]);
Quoted 3 lines

I suspect that this check of pc against the lbreg[] values should be being done in the generated code, not at translate time.

that is not feasible from a performance perspective. what you're proposing is that i put a check on *every* insn to see if the current pc is equal to either of the loop registers.

the way i'm doing it atm i believe is safe. if a lbreg changes, then i invalidate any TBs associated with the old value and any TBs associated with the new value. thus i force the code to be retranslated, and i can assume the lbreg values are constant when doing so.
-mike

#10 lore raw
Quoted 10 lines · Mike Frysinger
Quoted 3 lines · Peter Maydell

I suspect that this check of pc against the lbreg[] values should be being done in the generated code, not at translate time.

the way i'm doing it atm i believe is safe.  if a lbreg changes, then i invalidate any TBs associated with the old value and any TBs associated with the new value.  thus i force the code to be retranslated, and i can assume the lbreg values are constant when doing so.

That's OK too, that would fall into my category (3).

-- PMM

#11 lore raw
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Mike Frysinger
Quoted 3 lines · Peter Maydell

I suspect that this check of pc against the lbreg[] values should be being done in the generated code, not at translate time.

Quoted 7 lines
Quoted 5 lines

the way i'm doing it atm i believe is safe.  if a lbreg changes, then i invalidate any TBs associated with the old value and any TBs associated with the new value.  thus i force the code to be retranslated, and i can assume the lbreg values are constant when doing so.

That's OK too, that would fall into my category (3).

so the TB invalidation checking can be taken care of implicitly if i handled things in cpu_get_tb_cpu_state() ? that would be nice.

but i guess i'm not seeing how i would handle this scenario ... i want to attach to each TB the state of the two 32bit lbregs when that TB was created. then in this state func, make sure the current lbregs have the same values. but if i need to encode this information into "flags", i dont think i have enough space.
-mike

#12 lore raw
Quoted 5 lines · Mike Frysinger
Quoted 1 line · Peter Maydell

That's OK too, that would fall into my category (3).

so the TB invalidation checking can be taken care of implicitly if i handled things in cpu_get_tb_cpu_state() ?  that would be nice.

It doesn't invalidate the TB, it just means that qemu can have two different TBs for the same address and distinguish between them. So in cpu_get_tb_cpu_state() you encode the relevant bits of env into the flags, and then in translate.c, instead of looking at env members, you unpack tb->flags (usually into a disas context struct) and look at the results of your unpacking.

Quoted 5 lines

but i guess i'm not seeing how i would handle this scenario ... i want to attach to each TB the state of the two 32bit lbregs when that TB was created.  then in this state func, make sure the current lbregs have the same values.  but if i need to encode this information into "flags", i dont think i have enough space.

That's right -- you only have a total of 64 bits (you can use flags and also cs_base since you're not a PC with a weird addressing setup), so you have to be stingy about what you put in there. Also if you're likely to repeatedly execute the same bit of code with different values of lbregs you probably don't want to put them in tb_flags anyway, because you'd end up repeatedly translating the code and holding lots of nearly-identical TBs for it.

-- PMM

#13 lore raw
Quoted 7 lines · Peter Maydell
Quoted 5 lines · Mike Frysinger
Quoted 1 line · Peter Maydell

That's OK too, that would fall into my category (3).

so the TB invalidation checking can be taken care of implicitly if i handled things in cpu_get_tb_cpu_state() ?  that would be nice.

Quoted 6 lines

It doesn't invalidate the TB, it just means that qemu can have two different TBs for the same address and distinguish between them. So in cpu_get_tb_cpu_state() you encode the relevant bits of env into the flags, and then in translate.c, instead of looking at env members, you unpack tb->flags (usually into a disas context struct) and look at the results of your unpacking.

right. same thing for me.

Quoted 6 lines
Quoted 5 lines

but i guess i'm not seeing how i would handle this scenario ... i want to attach to each TB the state of the two 32bit lbregs when that TB was created.  then in this state func, make sure the current lbregs have the same values.  but if i need to encode this information into "flags", i dont think i have enough space.

Quoted 7 lines

That's right -- you only have a total of 64 bits (you can use flags and also cs_base since you're not a PC with a weird addressing setup), so you have to be stingy about what you put in there. Also if you're likely to repeatedly execute the same bit of code with different values of lbregs you probably don't want to put them in tb_flags anyway, because you'd end up repeatedly translating the code and holding lots of nearly-identical TBs for it.

lbregs are not likely to be changed to weird values, or dynamically. the vast majority of the time, their values are encoded at link time to fixed offsets, and any time the code is executed the lbregs will remain the same. so in practice, this wont come up -- all compiler generated code and every handwritten assembly code ive seen works this way. i set up the framework the way i did so that it would (hopefully) work correctly in pathological cases of lbregs being changed in weird/dumb ways.

while it would be nice to use this function, it seems like i'll have to stick with my current method of managing things by hand. i can think of at least one flag that could be used here (ASTAT's RND_MOD), so i'll need the flags for actual flags.
-mike