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

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

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

revision 1.9 by bellard, Mon Nov 21 23:31:32 2005 UTC revision 1.10 by bellard, Sat Nov 26 18:47:06 2005 UTC
# Line 28  Line 28 
28  #include "exec-all.h"  #include "exec-all.h"
29  #include "disas.h"  #include "disas.h"
30    
31  #define MIPS_DEBUG_DISAS  //#define MIPS_DEBUG_DISAS
32  //#define MIPS_SINGLE_STEP  //#define MIPS_SINGLE_STEP
33    
34  #ifdef USE_DIRECT_JUMP  #ifdef USE_DIRECT_JUMP
# Line 1033  static void gen_compute_branch (DisasCon Line 1033  static void gen_compute_branch (DisasCon
1033          case OPC_BNE:     /* rx != rx        */          case OPC_BNE:     /* rx != rx        */
1034          case OPC_BGTZ:    /* 0 > 0           */          case OPC_BGTZ:    /* 0 > 0           */
1035          case OPC_BLTZ:    /* 0 < 0           */          case OPC_BLTZ:    /* 0 < 0           */
         case OPC_BLTZAL:  /* 0 < 0           */  
1036              /* Treated as NOP */              /* Treated as NOP */
1037              MIPS_DEBUG("bnever (NOP)");              MIPS_DEBUG("bnever (NOP)");
1038              return;              return;
1039            case OPC_BLTZAL:  /* 0 < 0           */
1040                gen_op_set_T0(ctx->pc + 8);
1041                gen_op_store_T0_gpr(31);
1042                return;
1043            case OPC_BLTZALL: /* 0 < 0 likely */
1044                gen_op_set_T0(ctx->pc + 8);
1045                gen_op_store_T0_gpr(31);
1046                gen_goto_tb(ctx, 0, ctx->pc + 4);
1047                return;
1048          case OPC_BNEL:    /* rx != rx likely */          case OPC_BNEL:    /* rx != rx likely */
1049          case OPC_BGTZL:   /* 0 > 0 likely */          case OPC_BGTZL:   /* 0 > 0 likely */
         case OPC_BLTZALL: /* 0 < 0 likely */  
1050          case OPC_BLTZL:   /* 0 < 0 likely */          case OPC_BLTZL:   /* 0 < 0 likely */
1051              /* Skip the instruction in the delay slot */              /* Skip the instruction in the delay slot */
1052              MIPS_DEBUG("bnever and skip");              MIPS_DEBUG("bnever and skip");
# Line 1282  static void gen_arith64 (DisasContext *c Line 1289  static void gen_arith64 (DisasContext *c
1289    
1290  static void gen_blikely(DisasContext *ctx)  static void gen_blikely(DisasContext *ctx)
1291  {  {
1292    int l1;      int l1;
1293    l1 = gen_new_label();      l1 = gen_new_label();
1294    gen_op_jnz_T2(l1);      gen_op_jnz_T2(l1);
1295    gen_op_save_state(ctx->hflags & ~(MIPS_HFLAG_BMASK | MIPS_HFLAG_DS));      gen_op_save_state(ctx->hflags & ~(MIPS_HFLAG_BMASK | MIPS_HFLAG_DS));
1296    gen_goto_tb(ctx, 1, ctx->pc + 4);      gen_goto_tb(ctx, 1, ctx->pc + 4);
1297        gen_set_label(l1);
1298  }  }
1299    
1300  static void decode_opc (DisasContext *ctx)  static void decode_opc (DisasContext *ctx)
# Line 1524  static void decode_opc (DisasContext *ct Line 1532  static void decode_opc (DisasContext *ct
1532                int l1;                int l1;
1533                l1 = gen_new_label();                l1 = gen_new_label();
1534                gen_op_jnz_T2(l1);                gen_op_jnz_T2(l1);
               gen_goto_tb(ctx, 0, ctx->btarget);  
               gen_set_label(l1);  
1535                gen_goto_tb(ctx, 1, ctx->pc + 4);                gen_goto_tb(ctx, 1, ctx->pc + 4);
1536                  gen_set_label(l1);
1537                  gen_goto_tb(ctx, 0, ctx->btarget);
1538              }              }
1539              break;              break;
1540          case MIPS_HFLAG_BR:          case MIPS_HFLAG_BR:
# Line 1722  CPUMIPSState *cpu_mips_init (void) Line 1730  CPUMIPSState *cpu_mips_init (void)
1730      env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER);      env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER);
1731      env->CP0_PRid = MIPS_CPU;      env->CP0_PRid = MIPS_CPU;
1732      env->exception_index = EXCP_NONE;      env->exception_index = EXCP_NONE;
1733    #if defined(CONFIG_USER_ONLY)
1734        env->hflags |= MIPS_HFLAG_UM;
1735    #endif
1736      return env;      return env;
1737  }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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