Revision 86865c5f target-sh4/translate.c

b/target-sh4/translate.c
469 469
#define CHECK_NOT_DELAY_SLOT \
470 470
  if (ctx->flags & (DELAY_SLOT | DELAY_SLOT_CONDITIONAL))     \
471 471
  {                                                           \
472
      tcg_gen_movi_i32(cpu_pc, ctx->pc-2);                    \
472
      tcg_gen_movi_i32(cpu_pc, ctx->pc);                      \
473 473
      gen_helper_raise_slot_illegal_instruction();            \
474 474
      ctx->bstate = BS_EXCP;                                  \
475 475
      return;                                                 \
476 476
  }
477 477

  
478
#define CHECK_PRIVILEGED                                      \
479
  if (IS_USER(ctx)) {                                         \
480
      tcg_gen_movi_i32(cpu_pc, ctx->pc);                      \
481
      gen_helper_raise_illegal_instruction();                 \
482
      ctx->bstate = BS_EXCP;                                  \
483
      return;                                                 \
478
#define CHECK_PRIVILEGED                                        \
479
  if (IS_USER(ctx)) {                                           \
480
      tcg_gen_movi_i32(cpu_pc, ctx->pc);                        \
481
      if (ctx->flags & (DELAY_SLOT | DELAY_SLOT_CONDITIONAL)) { \
482
         gen_helper_raise_slot_illegal_instruction();           \
483
      } else {                                                  \
484
         gen_helper_raise_illegal_instruction();                \
485
      }                                                         \
486
      ctx->bstate = BS_EXCP;                                    \
487
      return;                                                   \
484 488
  }
485 489

  
486 490
#define CHECK_FPU_ENABLED                                       \
487 491
  if (ctx->flags & SR_FD) {                                     \
492
      tcg_gen_movi_i32(cpu_pc, ctx->pc);                        \
488 493
      if (ctx->flags & (DELAY_SLOT | DELAY_SLOT_CONDITIONAL)) { \
489
          tcg_gen_movi_i32(cpu_pc, ctx->pc-2);                  \
490 494
          gen_helper_raise_slot_fpu_disable();                  \
491 495
      } else {                                                  \
492
          tcg_gen_movi_i32(cpu_pc, ctx->pc);                    \
493 496
          gen_helper_raise_fpu_disable();                       \
494 497
      }                                                         \
495 498
      ctx->bstate = BS_EXCP;                                    \
......
1860 1863
	    ctx->opcode, ctx->pc);
1861 1864
    fflush(stderr);
1862 1865
#endif
1863
    gen_helper_raise_illegal_instruction();
1866
    tcg_gen_movi_i32(cpu_pc, ctx->pc);
1867
    if (ctx->flags & (DELAY_SLOT | DELAY_SLOT_CONDITIONAL)) {
1868
       gen_helper_raise_slot_illegal_instruction();
1869
    } else {
1870
       gen_helper_raise_illegal_instruction();
1871
    }
1864 1872
    ctx->bstate = BS_EXCP;
1865 1873
}
1866 1874

  

Also available in: Unified diff