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:
parent
f2eff767a0
commit
d759175767
1 changed files with 10 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue