#fix to isnan() bug
big thanks to philip for seeing the problem! :D cause: not popping FPU stack. didn't happen on my athlonXP presumably due to different FPU usage (possibly in drivers): pushing 8 values could clear the stack and mask overflow. the cause was not due to compiler (and FLD/FSTP param passing) because Philip uses VC2005 as well, but saw the crash (on P4 CPU) fixes #130 This was SVN commit r4072.
This commit is contained in:
parent
b0241cc4c8
commit
eaf12ae666
@ -159,6 +159,7 @@ sym(ia32_fpclassify):
|
||||
fld qword [esp+4]
|
||||
fxam
|
||||
fnstsw ax
|
||||
fstp st0
|
||||
and eax, FP_CLASSIFY_MASK
|
||||
ret
|
||||
|
||||
@ -168,6 +169,7 @@ sym(ia32_fpclassifyf):
|
||||
fld dword [esp+4]
|
||||
fxam
|
||||
fnstsw ax
|
||||
fstp st0
|
||||
and eax, FP_CLASSIFY_MASK
|
||||
ret
|
||||
|
||||
|
@ -56,9 +56,9 @@ uint fpclassify(double d)
|
||||
// really sucky stub implementation; doesn't attempt to cover all cases.
|
||||
|
||||
if(d != d)
|
||||
return IA32_FP_NAN;
|
||||
return FP_NAN;
|
||||
else
|
||||
return IA32_FP_NORMAL;
|
||||
return FP_NORMAL;
|
||||
}
|
||||
|
||||
uint fpclassifyf(float f)
|
||||
|
Loading…
Reference in New Issue
Block a user