From 3bdefb4623e16131f3eef8c105f6db8289fdfca8 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 5 Jul 2021 19:35:52 +0200 Subject: [PATCH] UserspaceEmulator: Use long double in `FABS` `fpu_get` returns a long double and `fpu_set` expects a long double as its parameter, and the X87 FPU uses long doubles as its internal storage, meaning the `FABS` operates on them. This means the correct intrinsic function for implementing it is `__builtin_fabsl`. --- Userland/DevTools/UserspaceEmulator/SoftCPU.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp index 3b506b9234..2d6874bd0d 100644 --- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -1565,7 +1565,7 @@ void SoftCPU::FCHS(const X86::Instruction&) void SoftCPU::FABS(const X86::Instruction&) { - fpu_set(0, __builtin_fabs(fpu_get(0))); + fpu_set(0, __builtin_fabsl(fpu_get(0))); } void SoftCPU::FTST(const X86::Instruction&) { TODO_INSN(); }