Skip to content

Ghidra is a software reverse engineering (SRE) framework

SuperH4: fsca: Fixed bug with FPSCR_PR being tested incorrectly and removed extraneous `offset` local variable

LemonHaze5dbdb3f7bbd2
diff --git a/Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc b/Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc
index 66947a7f5b..eb86bd0040 100644
--- a/Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc
+++ b/Ghidra/Processors/SuperH4/data/languages/SuperH4.sinc
@@ -1502,6 +1502,7 @@ N_0txx: r0",@"^N_0 is r0 & N_0 { tmp:4 = N_0; export tmp; }
# arch # arch_sh2a_or_sh3e_up
:fsrra FRN_0 is
OP_0=0xF & FRN_0 & OP_4=0x7D {
+ if (( $(FPSCR_PR) != 0 )) goto inst_next;
FRN_0 = int2float(1 :4) f/ sqrt( FRN_0 );
}
@@ -1514,10 +1515,9 @@ define pcodeop cos;
# arch # arch_sh2a_or_sh3e_up
:fsca FPUL,FRN_1 is
OP_0=0xF & FPUL & FRN_1 & FRN_2 & OP_4=0xFD {
- if (( $(FPSCR_PR) == 0 )) goto inst_next;
+ if (( $(FPSCR_PR) != 0 )) goto inst_next;
angle:4 = int2float(0 :4); # float
- offset:4 = 0x00010000; # long
fraction:4 = 0x0000FFFF; # long
fraction = fraction & FPUL; # extract sub-rotation