1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

UserspaceEmulator: Stop overriding flags in FCOMI

We no longer override the flags we just set. We now also unset of, af,
and sf after the comparison.
This fixes the asin function for LibM!
This commit is contained in:
Hendiadyoin1 2021-07-23 13:42:35 +02:00 committed by Linus Groh
parent f2eff767a0
commit d759175767

View file

@ -888,15 +888,17 @@ void SoftFPU::FCOMI(const X86::Instruction& insn)
m_cpu.set_zf(1);
m_cpu.set_pf(1);
m_cpu.set_cf(1);
} else {
m_cpu.set_zf(fpu_get(0) == fpu_get(i));
m_cpu.set_pf(false);
m_cpu.set_cf(fpu_get(0) < fpu_get(i));
}
if (!fpu_is_set(1))
fpu_set_exception(FPU_Exception::Underflow);
m_cpu.set_zf(fpu_get(0) == fpu_get(i));
m_cpu.set_pf(false);
m_cpu.set_cf(fpu_get(0) < fpu_get(i));
// FIXME: is this supposed to be here?
// m_cpu.set_of(false);
m_cpu.set_of(false);
m_cpu.set_af(false);
m_cpu.set_sf(false);
// FIXME: Taint should be based on ST(0) and ST(i)
m_cpu.m_flags_tainted = false;
@ -921,8 +923,10 @@ void SoftFPU::FUCOMI(const X86::Instruction& insn)
m_cpu.set_zf(fpu_get(0) == fpu_get(i));
m_cpu.set_pf(false);
m_cpu.set_cf(fpu_get(0) < fpu_get(i));
m_cpu.set_of(false);
}
m_cpu.set_of(false);
m_cpu.set_af(false);
m_cpu.set_sf(false);
// FIXME: Taint should be based on ST(0) and ST(i)
m_cpu.m_flags_tainted = false;