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

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

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

revision 1.36 by bellard, Sun Oct 30 21:39:19 2005 UTC revision 1.37 by bellard, Sun Nov 20 10:31:08 2005 UTC
# Line 1727  GEN_HANDLER(stfiwx, 0x1F, 0x17, 0x1E, 0x Line 1727  GEN_HANDLER(stfiwx, 0x1F, 0x17, 0x1E, 0x
1727    
1728  /***                                Branch                                 ***/  /***                                Branch                                 ***/
1729    
1730  static inline void gen_jmp_tb(long tb, int n, uint32_t dest)  static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
1731  {  {
1732      if (n == 0)      TranslationBlock *tb;
1733          gen_op_goto_tb0(TBPARAM(tb));      tb = ctx->tb;
1734      else      if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
1735          gen_op_goto_tb1(TBPARAM(tb));          if (n == 0)
1736      gen_op_set_T1(dest);              gen_op_goto_tb0(TBPARAM(tb));
1737      gen_op_b_T1();          else
1738      gen_op_set_T0(tb + n);              gen_op_goto_tb1(TBPARAM(tb));
1739      gen_op_exit_tb();          gen_op_set_T1(dest);
1740            gen_op_b_T1();
1741            gen_op_set_T0((long)tb + n);
1742            gen_op_exit_tb();
1743        } else {
1744            gen_op_set_T1(dest);
1745            gen_op_b_T1();
1746            gen_op_set_T0(0);
1747            gen_op_exit_tb();
1748        }
1749  }  }
1750    
1751  /* b ba bl bla */  /* b ba bl bla */
# Line 1754  GEN_HANDLER(b, 0x12, 0xFF, 0xFF, 0x00000 Line 1763  GEN_HANDLER(b, 0x12, 0xFF, 0xFF, 0x00000
1763      if (LK(ctx->opcode)) {      if (LK(ctx->opcode)) {
1764          gen_op_setlr(ctx->nip);          gen_op_setlr(ctx->nip);
1765      }      }
1766      gen_jmp_tb((long)ctx->tb, 0, target);      gen_goto_tb(ctx, 0, target);
1767      ctx->exception = EXCP_BRANCH;      ctx->exception = EXCP_BRANCH;
1768  }  }
1769    
# Line 1805  static inline void gen_bcond(DisasContex Line 1814  static inline void gen_bcond(DisasContex
1814          case 4:                                                                        case 4:                                                              
1815          case 6:                                                                        case 6:                                                              
1816              if (type == BCOND_IM) {              if (type == BCOND_IM) {
1817                  gen_jmp_tb((long)ctx->tb, 0, target);                  gen_goto_tb(ctx, 0, target);
1818              } else {              } else {
1819                  gen_op_b_T1();                  gen_op_b_T1();
1820              }              }
# Line 1847  static inline void gen_bcond(DisasContex Line 1856  static inline void gen_bcond(DisasContex
1856      if (type == BCOND_IM) {      if (type == BCOND_IM) {
1857          int l1 = gen_new_label();          int l1 = gen_new_label();
1858          gen_op_jz_T0(l1);          gen_op_jz_T0(l1);
1859          gen_jmp_tb((long)ctx->tb, 0, target);          gen_goto_tb(ctx, 0, target);
1860          gen_set_label(l1);          gen_set_label(l1);
1861          gen_jmp_tb((long)ctx->tb, 1, ctx->nip);          gen_goto_tb(ctx, 1, ctx->nip);
1862      } else {      } else {
1863          gen_op_btest_T1(ctx->nip);          gen_op_btest_T1(ctx->nip);
1864      }      }
# Line 2269  GEN_HANDLER(mtsr, 0x1F, 0x12, 0x06, 0x00 Line 2278  GEN_HANDLER(mtsr, 0x1F, 0x12, 0x06, 0x00
2278      }      }
2279      gen_op_load_gpr_T0(rS(ctx->opcode));      gen_op_load_gpr_T0(rS(ctx->opcode));
2280      gen_op_store_sr(SR(ctx->opcode));      gen_op_store_sr(SR(ctx->opcode));
2281        RET_MTMSR(ctx);
2282  #endif  #endif
2283  }  }
2284    
# Line 2285  GEN_HANDLER(mtsrin, 0x1F, 0x12, 0x07, 0x Line 2295  GEN_HANDLER(mtsrin, 0x1F, 0x12, 0x07, 0x
2295      gen_op_load_gpr_T0(rS(ctx->opcode));      gen_op_load_gpr_T0(rS(ctx->opcode));
2296      gen_op_load_gpr_T1(rB(ctx->opcode));      gen_op_load_gpr_T1(rB(ctx->opcode));
2297      gen_op_store_srin();      gen_op_store_srin();
2298        RET_MTMSR(ctx);
2299  #endif  #endif
2300  }  }
2301    
# Line 2598  int gen_intermediate_code_internal (CPUS Line 2609  int gen_intermediate_code_internal (CPUS
2609  #endif  #endif
2610      }      }
2611      if (ctx.exception == EXCP_NONE) {      if (ctx.exception == EXCP_NONE) {
2612          gen_jmp_tb((long)ctx.tb, 0, ctx.nip);          gen_goto_tb(&ctx, 0, ctx.nip);
2613      } else if (ctx.exception != EXCP_BRANCH) {      } else if (ctx.exception != EXCP_BRANCH) {
2614          gen_op_set_T0(0);          gen_op_set_T0(0);
2615      }      }

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

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