summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-11-13 10:37:59 +0100
committerAndreas Kling <kling@serenityos.org>2020-11-13 11:05:46 +0100
commitdf3a70eac2f319379a1ed2d0d895ed26cfee135f (patch)
tree8ea60e6ef1cf55a10b346909b9beab32ea60a549
parentae81ced21c486a16fe4c54b8b939598a600282e8 (diff)
downloadserenity-df3a70eac2f319379a1ed2d0d895ed26cfee135f.zip
UserspaceEmulator: Support FCMOVBE and FCMOVNBE
-rw-r--r--DevTools/UserspaceEmulator/SoftCPU.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp
index 78d9fc30ad..f75e6f191c 100644
--- a/DevTools/UserspaceEmulator/SoftCPU.cpp
+++ b/DevTools/UserspaceEmulator/SoftCPU.cpp
@@ -1638,7 +1638,13 @@ void SoftCPU::FIMUL_RM32(const X86::Instruction& insn)
void SoftCPU::FCMOVE(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FICOM_RM32(const X86::Instruction&) { TODO_INSN(); }
-void SoftCPU::FCMOVBE(const X86::Instruction&) { TODO_INSN(); }
+
+void SoftCPU::FCMOVBE(const X86::Instruction& insn)
+{
+ if (evaluate_condition(6))
+ fpu_set(0, fpu_get(insn.rm() & 7));
+}
+
void SoftCPU::FICOMP_RM32(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FCMOVU(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FISUB_RM32(const X86::Instruction&) { TODO_INSN(); }
@@ -1677,7 +1683,11 @@ void SoftCPU::FIST_RM32(const X86::Instruction& insn)
insn.modrm().write32(*this, insn, shadow_wrap_as_initialized(bit_cast<u32>(i32)));
}
-void SoftCPU::FCMOVNBE(const X86::Instruction&) { TODO_INSN(); }
+void SoftCPU::FCMOVNBE(const X86::Instruction& insn)
+{
+ if (evaluate_condition(7))
+ fpu_set(0, fpu_get(insn.rm() & 7));
+}
void SoftCPU::FISTP_RM32(const X86::Instruction& insn)
{