mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-10-12 21:23:07 +00:00
SuperH: Delay slot fix for bf/s and and bt/s
Code now caches the value of the $(T_FLAG) before executing the delay slot. Previously the instruction executed in delay slot could potentially change the value of $(T_FLAG) and thereby resulting in incorrect behavior. Credit to Slinga and Waterfuell from SegaXtreme for reporting the issue.
This commit is contained in:
parent
b9e67994b1
commit
f1fc3a29ca
|
@ -1653,8 +1653,9 @@ MovMUReg2: MovMUReg2_15 is MovMUReg2_15 {
|
|||
@if (SH_VERSION == "2") || (SH_VERSION == "2A")
|
||||
:bf"/s" target00_07 is opcode_08_15=0b10001111 & target00_07
|
||||
{
|
||||
local cond = $(T_FLAG);
|
||||
delayslot(1);
|
||||
if ($(T_FLAG)==0) goto target00_07;
|
||||
if (cond==0) goto target00_07;
|
||||
}
|
||||
@endif
|
||||
|
||||
|
@ -1666,8 +1667,9 @@ MovMUReg2: MovMUReg2_15 is MovMUReg2_15 {
|
|||
@if (SH_VERSION == "2") || (SH_VERSION == "2A")
|
||||
:bt"/s" target00_07 is opcode_08_15=0b10001101 & target00_07
|
||||
{
|
||||
local cond = $(T_FLAG);
|
||||
delayslot(1);
|
||||
if ($(T_FLAG)==1) goto target00_07;
|
||||
if (cond==1) goto target00_07;
|
||||
}
|
||||
@endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue