/[qemu]/qemu/target-i386/translate.c
ViewVC logotype

Diff of /qemu/target-i386/translate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.51 by bellard, Sun Aug 21 10:28:44 2005 UTC revision 1.52 by bellard, Sun Nov 20 10:30:32 2005 UTC
# Line 1700  static inline int insn_const_size(unsign Line 1700  static inline int insn_const_size(unsign
1700          return 4;          return 4;
1701  }  }
1702    
1703    static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip)
1704    {
1705        TranslationBlock *tb;
1706        target_ulong pc;
1707    
1708        pc = s->cs_base + eip;
1709        tb = s->tb;
1710        /* NOTE: we handle the case where the TB spans two pages here */
1711        if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK) ||
1712            (pc & TARGET_PAGE_MASK) == ((s->pc - 1) & TARGET_PAGE_MASK))  {
1713            /* jump to same page: we can use a direct jump */
1714            if (tb_num == 0)
1715                gen_op_goto_tb0(TBPARAM(tb));
1716            else
1717                gen_op_goto_tb1(TBPARAM(tb));
1718            gen_jmp_im(eip);
1719            gen_op_movl_T0_im((long)tb + tb_num);
1720            gen_op_exit_tb();
1721        } else {
1722            /* jump to another page: currently not optimized */
1723            gen_jmp_im(eip);
1724            gen_eob(s);
1725        }
1726    }
1727    
1728  static inline void gen_jcc(DisasContext *s, int b,  static inline void gen_jcc(DisasContext *s, int b,
1729                             target_ulong val, target_ulong next_eip)                             target_ulong val, target_ulong next_eip)
1730  {  {
# Line 1779  static inline void gen_jcc(DisasContext Line 1804  static inline void gen_jcc(DisasContext
1804              break;              break;
1805          }          }
1806    
1807          if (s->cc_op != CC_OP_DYNAMIC)          if (s->cc_op != CC_OP_DYNAMIC) {
1808              gen_op_set_cc_op(s->cc_op);              gen_op_set_cc_op(s->cc_op);
1809                s->cc_op = CC_OP_DYNAMIC;
1810            }
1811    
1812          if (!func) {          if (!func) {
1813              gen_setcc_slow[jcc_op]();              gen_setcc_slow[jcc_op]();
# Line 1797  static inline void gen_jcc(DisasContext Line 1824  static inline void gen_jcc(DisasContext
1824          l1 = gen_new_label();          l1 = gen_new_label();
1825          func(l1);          func(l1);
1826    
1827          gen_op_goto_tb0(TBPARAM(tb));          gen_goto_tb(s, 0, next_eip);
         gen_jmp_im(next_eip);  
         gen_op_movl_T0_im((long)tb + 0);  
         gen_op_exit_tb();  
1828    
1829          gen_set_label(l1);          gen_set_label(l1);
1830          gen_op_goto_tb1(TBPARAM(tb));          gen_goto_tb(s, 1, val);
         gen_jmp_im(val);  
         gen_op_movl_T0_im((long)tb + 1);  
         gen_op_exit_tb();  
1831    
1832          s->is_jmp = 3;          s->is_jmp = 3;
1833      } else {      } else {
# Line 2217  static void gen_eob(DisasContext *s) Line 2238  static void gen_eob(DisasContext *s)
2238     direct call to the next block may occur */     direct call to the next block may occur */
2239  static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num)  static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num)
2240  {  {
     TranslationBlock *tb = s->tb;  
   
2241      if (s->jmp_opt) {      if (s->jmp_opt) {
2242          if (s->cc_op != CC_OP_DYNAMIC)          if (s->cc_op != CC_OP_DYNAMIC) {
2243              gen_op_set_cc_op(s->cc_op);              gen_op_set_cc_op(s->cc_op);
2244          if (tb_num)              s->cc_op = CC_OP_DYNAMIC;
2245              gen_op_goto_tb1(TBPARAM(tb));          }
2246          else          gen_goto_tb(s, tb_num, eip);
             gen_op_goto_tb0(TBPARAM(tb));  
         gen_jmp_im(eip);  
         gen_op_movl_T0_im((long)tb + tb_num);  
         gen_op_exit_tb();  
2247          s->is_jmp = 3;          s->is_jmp = 3;
2248      } else {      } else {
2249          gen_jmp_im(eip);          gen_jmp_im(eip);

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26