Skip to content

Commit

Permalink
execute delay slot instruction during RTE
Browse files Browse the repository at this point in the history
  • Loading branch information
inolen committed Jul 13, 2017
1 parent d6aa958 commit 2994a4e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/jit/frontend/sh4/sh4_instr.h
Expand Up @@ -1362,7 +1362,19 @@ INSTR(PREF) {
INSTR(RTE) {
I32 ssr = LOAD_SSR_I32();
I32 spc = LOAD_SPC_I32();

/* in an RTE delay slot, status register bits are referenced as follows. for
instruction access, the MD bit is used before modification, and for data
access, the MD bit is accessed after modification. for the instruction
execution, the other bits (S, T, M, Q, FD, BL, and RB) are used after
modification. the STC and STC.L SR instructions access all SR bits after
modification
note, since the MD bit isn't actually emulated, the SR is just set before
executing the delay slot */
STORE_SR_I32(ssr);
DELAY_INSTR();

BRANCH_I32(spc);
}

Expand Down

0 comments on commit 2994a4e

Please sign in to comment.