1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:07:36 +00:00

UserspaceEmulator: Correct FSCALES rounding

We were rounding the wrong way, FSCALE is supposed to trunc internally,
while we were flooring.
Now LibM exponentials and related tests work :^)
This commit is contained in:
Hendiadyoin1 2021-07-23 00:42:33 +02:00 committed by Linus Groh
parent fa02b46295
commit 8108aaca39

View file

@ -797,7 +797,7 @@ void SoftFPU::FRNDINT(const X86::Instruction&)
void SoftFPU::FSCALE(const X86::Instruction&)
{
// FIXME: set C1 upon stack overflow or if result was rounded
fpu_set(0, fpu_get(0) * powl(2, floorl(fpu_get(1))));
fpu_set(0, fpu_get(0) * powl(2, truncl(fpu_get(1))));
}
void SoftFPU::FSQRT(const X86::Instruction&)