⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 translate.c.svn-base

📁 我们自己开发的一个OSEK操作系统!不知道可不可以?
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_ld_asi_reg(offset, size, sign);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_ld_asi(asi, size, sign);    }}static inline void gen_st_asi(int insn, int size){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_st_asi_reg(offset, size);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_st_asi(asi, size);    }}static inline void gen_ldf_asi(int insn, int size, int rd){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_ldf_asi_reg(offset, size, rd);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_ldf_asi(asi, size, rd);    }}static inline void gen_stf_asi(int insn, int size, int rd){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_stf_asi_reg(offset, size, rd);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_stf_asi(asi, size, rd);    }}static inline void gen_swap_asi(int insn){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_swap_asi_reg(offset);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_swap_asi(asi);    }}static inline void gen_ldstub_asi(int insn){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_ldstub_asi_reg(offset);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_ldstub_asi(asi);    }}static inline void gen_ldda_asi(int insn){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_ldda_asi_reg(offset);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_ldda_asi(asi);    }}static inline void gen_stda_asi(int insn){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_stda_asi_reg(offset);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_stda_asi(asi);    }}static inline void gen_cas_asi(int insn){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_cas_asi_reg(offset);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_cas_asi(asi);    }}static inline void gen_casx_asi(int insn){    int asi, offset;    if (IS_IMM) {        offset = GET_FIELD(insn, 25, 31);        gen_op_casx_asi_reg(offset);    } else {        asi = GET_FIELD(insn, 19, 26);        gen_op_casx_asi(asi);    }}#elif !defined(CONFIG_USER_ONLY)static inline void gen_ld_asi(int insn, int size, int sign){    int asi;    asi = GET_FIELD(insn, 19, 26);    gen_op_ld_asi(asi, size, sign);}static inline void gen_st_asi(int insn, int size){    int asi;    asi = GET_FIELD(insn, 19, 26);    gen_op_st_asi(asi, size);}static inline void gen_ldstub_asi(int insn){    int asi;    asi = GET_FIELD(insn, 19, 26);    gen_op_ldstub_asi(asi);}static inline void gen_swap_asi(int insn){    int asi;    asi = GET_FIELD(insn, 19, 26);    gen_op_swap_asi(asi);}static inline void gen_ldda_asi(int insn){    int asi;    asi = GET_FIELD(insn, 19, 26);    gen_op_ld_asi(asi, 8, 0);}static inline void gen_stda_asi(int insn){    int asi;    asi = GET_FIELD(insn, 19, 26);    gen_op_st_asi(asi, 8);}#endifstatic inline void gen_movl_imm_TN(int reg, uint32_t imm){    gen_op_movl_TN_im[reg](imm);}static inline void gen_movl_imm_T1(uint32_t val){    gen_movl_imm_TN(1, val);}static inline void gen_movl_imm_T0(uint32_t val){    gen_movl_imm_TN(0, val);}static inline void gen_movl_simm_TN(int reg, int32_t imm){    gen_op_movl_TN_sim[reg](imm);}static inline void gen_movl_simm_T1(int32_t val){    gen_movl_simm_TN(1, val);}static inline void gen_movl_simm_T0(int32_t val){    gen_movl_simm_TN(0, val);}static inline void gen_movl_reg_TN(int reg, int t){    if (reg)        gen_op_movl_reg_TN[t][reg] ();    else        gen_movl_imm_TN(t, 0);}static inline void gen_movl_reg_T0(int reg){    gen_movl_reg_TN(reg, 0);}static inline void gen_movl_reg_T1(int reg){    gen_movl_reg_TN(reg, 1);}static inline void gen_movl_reg_T2(int reg){    gen_movl_reg_TN(reg, 2);}static inline void gen_movl_TN_reg(int reg, int t){    if (reg)        gen_op_movl_TN_reg[t][reg] ();}static inline void gen_movl_T0_reg(int reg){    gen_movl_TN_reg(reg, 0);}static inline void gen_movl_T1_reg(int reg){    gen_movl_TN_reg(reg, 1);}static inline void gen_jmp_im(target_ulong pc){#ifdef TARGET_SPARC64    if (pc == (uint32_t)pc) {        gen_op_jmp_im(pc);    } else {        gen_op_jmp_im64(pc >> 32, pc);    }#else    gen_op_jmp_im(pc);#endif}static inline void gen_movl_npc_im(target_ulong npc){#ifdef TARGET_SPARC64    if (npc == (uint32_t)npc) {        gen_op_movl_npc_im(npc);    } else {        gen_op_movq_npc_im64(npc >> 32, npc);    }#else    gen_op_movl_npc_im(npc);#endif}static inline void gen_goto_tb(DisasContext *s, int tb_num,                               target_ulong pc, target_ulong npc){    TranslationBlock *tb;    tb = s->tb;    if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK) &&        (npc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK))  {        /* jump to same page: we can use a direct jump */        if (tb_num == 0)            gen_op_goto_tb0(TBPARAM(tb));        else            gen_op_goto_tb1(TBPARAM(tb));        gen_jmp_im(pc);        gen_movl_npc_im(npc);        gen_op_movl_T0_im((long)tb + tb_num);        gen_op_exit_tb();    } else {        /* jump to another page: currently not optimized */        gen_jmp_im(pc);        gen_movl_npc_im(npc);        gen_op_movl_T0_0();        gen_op_exit_tb();    }}static inline void gen_branch2(DisasContext *dc, target_ulong pc1,                               target_ulong pc2){    int l1;    l1 = gen_new_label();    gen_op_jz_T2_label(l1);    gen_goto_tb(dc, 0, pc1, pc1 + 4);    gen_set_label(l1);    gen_goto_tb(dc, 1, pc2, pc2 + 4);}static inline void gen_branch_a(DisasContext *dc, target_ulong pc1,                                target_ulong pc2){    int l1;    l1 = gen_new_label();    gen_op_jz_T2_label(l1);    gen_goto_tb(dc, 0, pc2, pc1);    gen_set_label(l1);    gen_goto_tb(dc, 1, pc2 + 4, pc2 + 8);}static inline void gen_branch(DisasContext *dc, target_ulong pc,                              target_ulong npc){    gen_goto_tb(dc, 0, pc, npc);}static inline void gen_generic_branch(target_ulong npc1, target_ulong npc2){    int l1, l2;    l1 = gen_new_label();    l2 = gen_new_label();    gen_op_jz_T2_label(l1);    gen_movl_npc_im(npc1);    gen_op_jmp_label(l2);    gen_set_label(l1);    gen_movl_npc_im(npc2);    gen_set_label(l2);}/* call this function before using T2 as it may have been set for a jump */static inline void flush_T2(DisasContext * dc){    if (dc->npc == JUMP_PC) {        gen_generic_branch(dc->jump_pc[0], dc->jump_pc[1]);        dc->npc = DYNAMIC_PC;    }}static inline void save_npc(DisasContext * dc){    if (dc->npc == JUMP_PC) {        gen_generic_branch(dc->jump_pc[0], dc->jump_pc[1]);        dc->npc = DYNAMIC_PC;    } else if (dc->npc != DYNAMIC_PC) {        gen_movl_npc_im(dc->npc);    }}static inline void save_state(DisasContext * dc){    gen_jmp_im(dc->pc);    save_npc(dc);}static inline void gen_mov_pc_npc(DisasContext * dc){    if (dc->npc == JUMP_PC) {        gen_generic_branch(dc->jump_pc[0], dc->jump_pc[1]);        gen_op_mov_pc_npc();        dc->pc = DYNAMIC_PC;    } else if (dc->npc == DYNAMIC_PC) {        gen_op_mov_pc_npc();        dc->pc = DYNAMIC_PC;    } else {        dc->pc = dc->npc;    }}static GenOpFunc * const gen_cond[2][16] = {    {        gen_op_eval_bn,        gen_op_eval_be,        gen_op_eval_ble,        gen_op_eval_bl,        gen_op_eval_bleu,        gen_op_eval_bcs,        gen_op_eval_bneg,        gen_op_eval_bvs,        gen_op_eval_ba,        gen_op_eval_bne,        gen_op_eval_bg,        gen_op_eval_bge,        gen_op_eval_bgu,        gen_op_eval_bcc,        gen_op_eval_bpos,        gen_op_eval_bvc,    },    {#ifdef TARGET_SPARC64        gen_op_eval_bn,        gen_op_eval_xbe,        gen_op_eval_xble,        gen_op_eval_xbl,        gen_op_eval_xbleu,        gen_op_eval_xbcs,        gen_op_eval_xbneg,        gen_op_eval_xbvs,        gen_op_eval_ba,        gen_op_eval_xbne,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -