summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2021-03-14 08:10:11 +0000
committerAndreas Kling <kling@serenityos.org>2021-03-14 09:45:22 +0100
commit2c24c0e4515eae79061ce4c95d55ae26afb8b5b6 (patch)
tree1029614618044a6a92f48cdb13eb2f60839af1d2 /Userland/DevTools/UserspaceEmulator
parentb1e3176f9f46b6126a93437764eef6914d7f23e5 (diff)
downloadserenity-2c24c0e4515eae79061ce4c95d55ae26afb8b5b6.zip
UserspaceEmulator: SoftCPU: Add support for FPTAN instruction
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftCPU.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
index 3c4fb2fd41..bf73af564b 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
@@ -1641,7 +1641,14 @@ void SoftCPU::FYL2XP1(const X86::Instruction&)
fpu_pop();
}
-void SoftCPU::FPTAN(const X86::Instruction&) { TODO_INSN(); }
+void SoftCPU::FPTAN(const X86::Instruction&)
+{
+ // FIXME: set C1 upon stack overflow or if result was rounded
+ // FIXME: Set C2 to 1 if ST(0) is outside range of -2^63 to +2^63; else set to 0
+ fpu_set(0, tanf(fpu_get(0)));
+ fpu_push(1.0f);
+}
+
void SoftCPU::FPATAN(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FXTRACT(const X86::Instruction&) { TODO_INSN(); }
void SoftCPU::FPREM1(const X86::Instruction&) { TODO_INSN(); }