Skip to content

Commit

Permalink
Replace fstsw with fnstsw
Browse files Browse the repository at this point in the history
The fstX instructions are actually aliases for 'waitf' followed by
the fnstX variant. There's no need to have both.
  • Loading branch information
hainest committed Nov 28, 2023
1 parent 17e9361 commit 3e6aa7c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/h/mnemonics/x86_entryIDs.h
Expand Up @@ -189,7 +189,7 @@ e_fsave,
e_fst,
e_fnstenv,
e_fstp,
e_fstsw,
e_fnstsw,
e_fsub,
e_fsubp,
e_fsubr,
Expand Down
6 changes: 3 additions & 3 deletions common/src/arch-x86.C
Expand Up @@ -1035,7 +1035,7 @@ COMMON_EXPORT dyn_hash_map<entryID, std::string> entryNames_IAPI = map_list_of
(e_fnstcw, "fnstcw")
(e_fnstenv, "fnstenv")
(e_fstp, "fstp")
(e_fstsw, "fstsw")
(e_fnstsw, "fnstsw")
(e_fsub, "fsub")
(e_fsubp, "fsubp")
(e_fsubr, "fsubr")
Expand Down Expand Up @@ -3544,7 +3544,7 @@ static ia32_entry fpuMap[][2][8] = {
{ e_frstor, t_done, 0, true, { M512, Zz, Zz }, 0, s1R, 0 },
{ e_fucomp, t_done, 0, true, { ST0, Efd, Zz }, 0, s1R2R, 0 }, // stack pop
{ e_fsave, t_done, 0, true, { M512, Zz, Zz }, 0, s1W, 0 },
{ e_fstsw, t_done, 0, true, { Ew, Zz, Zz }, 0, s1W, 0 }
{ e_fnstsw, t_done, 0, true, { Ew, Zz, Zz }, 0, s1W, 0 }
},
{ // DD TODO semantics check
{ e_ffree, t_done, 0, true, { Efd, Zz, Zz }, 0, s1W, 0 },
Expand Down Expand Up @@ -3595,7 +3595,7 @@ static ia32_entry fpuMap[][2][8] = {
{ e_fxch, t_done, 0, true, { ST0, Ef, Zz }, 0, s1RW2RW, 0 },
{ e_fstp, t_done, 0, true, { Ef, ST0, Zz }, 0, sNONE, 0 },
{ e_fstp, t_done, 0, true, { Ef, ST0, Zz }, 0, sNONE, 0 },
{ e_fstsw, t_done, 0, true, { AX, Zz, Zz }, 0, s1W, 0 },
{ e_fnstsw, t_done, 0, true, { AX, Zz, Zz }, 0, s1W, 0 },
{ e_fucomip, t_done, 0, true, { ST0, Ef, Zz }, 0, s1RW2R, 0 }, // stack pop
{ e_fcomip, t_done, 0, true, { ST0, Ef, Zz }, 0, s1RW2R, 0 }, // stack pop
{ e_No_Entry, t_done, 0, true, { Zz, Zz, Zz }, 0, sNONE, 0 },
Expand Down
2 changes: 1 addition & 1 deletion dataflowAPI/src/convertOpcodes.C
Expand Up @@ -412,7 +412,7 @@ X86InstructionKind RoseInsnX86Factory::convertKind(entryID opcode, prefixEntryID
return x86_fnstenv;
case e_fstp:
return x86_fstp;
case e_fstsw:
case e_fnstsw:
return x86_fnstsw;
case e_fsub:
return x86_fsub;
Expand Down

0 comments on commit 3e6aa7c

Please sign in to comment.