UserspaceEmulator: Emulate two FPU instructions!

This commit is contained in:
Nico Weber 2020-08-30 13:27:17 -04:00 committed by Andreas Kling
parent 463ffbf83e
commit 4b5cfce6b1
Notes: sideshowbarker 2024-07-19 02:58:45 +09:00
2 changed files with 14 additions and 2 deletions

View File

@ -1412,7 +1412,12 @@ void SoftCPU::FCHS(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FABS(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FTST(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FXAM(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FLDCW(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FLDCW(const X86::Instruction& insn)
{
m_fpu_cw = insn.modrm().read16<ValueWithShadow<u16>>(*this, insn);
}
void SoftCPU::FLD1(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FLDL2T(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FLDL2E(const X86::Instruction&) { TODO_INSN(); }
@ -1429,7 +1434,12 @@ void SoftCPU::FXTRACT(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FPREM1(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FDECSTP(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FINCSTP(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FNSTCW(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FNSTCW(const X86::Instruction& insn)
{
insn.modrm().write16(*this, insn, m_fpu_cw);
}
void SoftCPU::FPREM(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FYL2XP1(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FSQRT(const X86::Instruction&) { TODO_INSN(); }

View File

@ -1112,6 +1112,8 @@ private:
u32 m_eip { 0 };
u32 m_base_eip { 0 };
ValueWithShadow<u16> m_fpu_cw { 0, 0 };
const u8* m_cached_code_ptr { nullptr };
const u8* m_cached_code_end { nullptr };