- // write-caused irq detection
- sh2_drc_write_end = tcache_ptr;
- emith_tst_r_r(arg0, arg0);
- EMITH_SJMP_START(DCOND_NE);
- emith_jump_ctx_c(DCOND_EQ, offsetof(SH2, drc_tmp)); // return
- EMITH_SJMP_END(DCOND_NE);
- emith_call(sh2_drc_test_irq);
- emith_jump_ctx(offsetof(SH2, drc_tmp));
-
- // write-caused irq detection for writes in delay slot
- sh2_drc_write_slot_end = tcache_ptr;
- emith_tst_r_r(arg0, arg0);
- EMITH_SJMP_START(DCOND_NE);
- emith_jump_ctx_c(DCOND_EQ, offsetof(SH2, drc_tmp));
- EMITH_SJMP_END(DCOND_NE);
- // just burn cycles to get back to dispatcher after branch is handled
- sr = rcache_get_reg(SHR_SR, RC_GR_RMW);
- emith_ctx_write(sr, offsetof(SH2, irq_cycles));
- emith_clear_msb(sr, sr, 20); // clear cycles
- rcache_flush();
- emith_jump_ctx(offsetof(SH2, drc_tmp));
-