mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
UserspaceEmulator: Check the right flags in FCMOV
Also make FCMOVNB do an actual CMOV and not a copy of FILD_m32
This commit is contained in:
parent
8108aaca39
commit
5d2a4bd18d
1 changed files with 8 additions and 7 deletions
|
@ -437,19 +437,20 @@ void SoftFPU::FCMOVB(const X86::Instruction& insn)
|
|||
}
|
||||
void SoftFPU::FCMOVNB(const X86::Instruction& insn)
|
||||
{
|
||||
VERIFY(!insn.modrm().is_register());
|
||||
auto m32int = (i32)insn.modrm().read32(m_cpu, insn).value();
|
||||
// FIXME: Respect shadow values
|
||||
fpu_push((long double)m32int);
|
||||
VERIFY(insn.modrm().is_register());
|
||||
if (!m_cpu.cf())
|
||||
fpu_set(0, fpu_get(insn.modrm().rm()));
|
||||
}
|
||||
void SoftFPU::FCMOVBE(const X86::Instruction& insn)
|
||||
{
|
||||
if (m_cpu.cf() | m_cpu.zf())
|
||||
VERIFY(insn.modrm().is_register());
|
||||
if (m_cpu.cf() || m_cpu.zf())
|
||||
fpu_set(0, fpu_get(insn.modrm().rm()));
|
||||
}
|
||||
void SoftFPU::FCMOVNBE(const X86::Instruction& insn)
|
||||
{
|
||||
if (!(m_cpu.cf() | m_cpu.zf()))
|
||||
VERIFY(insn.modrm().is_register());
|
||||
if (!(m_cpu.cf() || m_cpu.zf()))
|
||||
fpu_set(0, fpu_get(insn.modrm().rm()));
|
||||
}
|
||||
|
||||
|
@ -462,7 +463,7 @@ void SoftFPU::FCMOVU(const X86::Instruction& insn)
|
|||
void SoftFPU::FCMOVNU(const X86::Instruction& insn)
|
||||
{
|
||||
VERIFY(insn.modrm().is_register());
|
||||
if (m_cpu.pf())
|
||||
if (!m_cpu.pf())
|
||||
fpu_set(0, fpu_get((insn.modrm().reg_fpu())));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue