summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftFPU.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp
index 2daf44bd7d..00c91cd046 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftFPU.cpp
@@ -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())));
}