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

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

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

revision 1.23 by bellard, Fri Nov 11 00:24:58 2005 UTC revision 1.24 by bellard, Sun Nov 20 10:32:05 2005 UTC
# Line 561  static inline void gen_movl_npc_im(targe Line 561  static inline void gen_movl_npc_im(targe
561  #endif  #endif
562  }  }
563    
564    static inline void gen_goto_tb(DisasContext *s, int tb_num,
565                                   target_ulong pc, target_ulong npc)
566    {
567        TranslationBlock *tb;
568    
569        tb = s->tb;
570        if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK) &&
571            (npc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK))  {
572            /* jump to same page: we can use a direct jump */
573            if (tb_num == 0)
574                gen_op_goto_tb0(TBPARAM(tb));
575            else
576                gen_op_goto_tb1(TBPARAM(tb));
577            gen_jmp_im(pc);
578            gen_movl_npc_im(npc);
579            gen_op_movl_T0_im((long)tb + tb_num);
580            gen_op_exit_tb();
581        } else {
582            /* jump to another page: currently not optimized */
583            gen_jmp_im(pc);
584            gen_movl_npc_im(npc);
585            gen_op_movl_T0_0();
586            gen_op_exit_tb();
587        }
588    }
589    
590  static inline void gen_branch2(DisasContext *dc, long tb, target_ulong pc1, target_ulong pc2)  static inline void gen_branch2(DisasContext *dc, long tb, target_ulong pc1, target_ulong pc2)
591  {  {
592      int l1;      int l1;
# Line 569  static inline void gen_branch2(DisasCont Line 595  static inline void gen_branch2(DisasCont
595    
596      gen_op_jz_T2_label(l1);      gen_op_jz_T2_label(l1);
597    
598      gen_op_goto_tb0(TBPARAM(tb));      gen_goto_tb(dc, 0, pc1, pc1 + 4);
     gen_jmp_im(pc1);  
     gen_movl_npc_im(pc1 + 4);  
     gen_op_movl_T0_im((long)tb + 0);  
     gen_op_exit_tb();  
599    
600      gen_set_label(l1);      gen_set_label(l1);
601      gen_op_goto_tb1(TBPARAM(tb));      gen_goto_tb(dc, 1, pc2, pc2 + 4);
     gen_jmp_im(pc2);  
     gen_movl_npc_im(pc2 + 4);  
     gen_op_movl_T0_im((long)tb + 1);  
     gen_op_exit_tb();  
602  }  }
603    
604  static inline void gen_branch_a(DisasContext *dc, long tb, target_ulong pc1, target_ulong pc2)  static inline void gen_branch_a(DisasContext *dc, long tb, target_ulong pc1, target_ulong pc2)
# Line 591  static inline void gen_branch_a(DisasCon Line 609  static inline void gen_branch_a(DisasCon
609    
610      gen_op_jz_T2_label(l1);      gen_op_jz_T2_label(l1);
611    
612      gen_op_goto_tb0(TBPARAM(tb));      gen_goto_tb(dc, 0, pc2, pc1);
     gen_jmp_im(pc2);  
     gen_movl_npc_im(pc1);  
     gen_op_movl_T0_im((long)tb + 0);  
     gen_op_exit_tb();  
613    
614      gen_set_label(l1);      gen_set_label(l1);
615      gen_op_goto_tb1(TBPARAM(tb));      gen_goto_tb(dc, 1, pc2 + 4, pc2 + 8);
     gen_jmp_im(pc2 + 4);  
     gen_movl_npc_im(pc2 + 8);  
     gen_op_movl_T0_im((long)tb + 1);  
     gen_op_exit_tb();  
616  }  }
617    
618  static inline void gen_branch(DisasContext *dc, long tb, target_ulong pc, target_ulong npc)  static inline void gen_branch(DisasContext *dc, long tb, target_ulong pc, target_ulong npc)
619  {  {
620      gen_op_goto_tb0(TBPARAM(tb));      gen_goto_tb(dc, 0, pc, npc);
     gen_jmp_im(pc);  
     gen_movl_npc_im(npc);  
     gen_op_movl_T0_im((long)tb + 0);  
     gen_op_exit_tb();  
621  }  }
622    
623  static inline void gen_generic_branch(DisasContext *dc, target_ulong npc1, target_ulong npc2)  static inline void gen_generic_branch(DisasContext *dc, target_ulong npc1, target_ulong npc2)

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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