From a4a8dd29baed720056cb8aaa6014bfddc50b8423 Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Tue, 23 Apr 2024 16:50:23 -0400 Subject: [PATCH] LibC: Read correct FP register in fegetround on x86-64 :^) --- Userland/Libraries/LibC/arch/x86_64/fenv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibC/arch/x86_64/fenv.cpp b/Userland/Libraries/LibC/arch/x86_64/fenv.cpp index 53ed376cf6d..fb82e14fabd 100644 --- a/Userland/Libraries/LibC/arch/x86_64/fenv.cpp +++ b/Userland/Libraries/LibC/arch/x86_64/fenv.cpp @@ -109,7 +109,7 @@ int fesetexceptflag(fexcept_t const* except, int exceptions) int fegetround() { // There's no way to signal whether the SSE rounding mode and x87 ones are different, so we assume they're the same - return (read_status_register() >> 10) & 3; + return (read_control_word() >> 10) & 3; } int fesetround(int rounding_mode)