mirror of
https://github.com/ptitSeb/box86.git
synced 2025-05-08 21:08:57 +08:00
[INTERPRETER] Improve x87 comparison (backported from Box64)
This commit is contained in:
parent
1c280bd8a0
commit
512f0a6c92
@ -84,6 +84,10 @@ static inline void fpu_fcom(x86emu_t* emu, double b)
|
||||
emu->sw.f.F87_C0 = 1;
|
||||
emu->sw.f.F87_C2 = 1;
|
||||
emu->sw.f.F87_C3 = 1;
|
||||
} else if ((b==-INFINITY) || (ST0.d==INFINITY)) {
|
||||
emu->sw.f.F87_C0 = 0;
|
||||
emu->sw.f.F87_C2 = 0;
|
||||
emu->sw.f.F87_C3 = 0;
|
||||
} else if (isgreater(ST0.d, b)) {
|
||||
emu->sw.f.F87_C0 = 0;
|
||||
emu->sw.f.F87_C2 = 0;
|
||||
@ -111,6 +115,10 @@ static inline void fpu_fcomi(x86emu_t* emu, double b)
|
||||
SET_FLAG(F_CF);
|
||||
SET_FLAG(F_PF);
|
||||
SET_FLAG(F_ZF);
|
||||
} else if ((b==-INFINITY) || (ST0.d==INFINITY)) {
|
||||
CLEAR_FLAG(F_CF);
|
||||
CLEAR_FLAG(F_PF);
|
||||
CLEAR_FLAG(F_ZF);
|
||||
} else if (isgreater(ST0.d, b)) {
|
||||
CLEAR_FLAG(F_CF);
|
||||
CLEAR_FLAG(F_PF);
|
||||
|
Loading…
x
Reference in New Issue
Block a user