From: <gb...@di...> - 2000-08-14 23:14:13
|
Hi, Scrollbars now work with the generic FPU core. The problem looks like what I was suspecting: floating-point precision. I am using long doubles if and only if they are 96-bit long (detected by the configure script). ## Reasons why I think it was a precision-related problem - I took the original fpp.cpp from BasiliskII 13/07/2000 and made necessary changes to support uae_f96. Note however that type conversion functions like to_single(), from_exten(), used X86 assembly. At this time, scrollbars were still not working. - I then applied Lauri's changes from his fpp.cpp (not fpu.cpp from the Windows directory). It worked. So what ? -> Making diffs from Lauri's fpp.cpp and from the one in the CVS shows no differences and scrollbars don't work with the freshly compiled CVS sources, do they ? -> I applied all changes from Lauri's fpp.cpp but enhanced them with long doubles. Scrollbars work. ## Last notes. - The long double type is part of the C++ standard. Any compliant compiler should know about it. The problem is that I make heavy assumptions about its data representation: IEEE-854. i.e. a 96-bit long double, what the C++ standard does not guarantee. - IMHO, #include <cmath> (not <math.h>) is mandatory because it provides long double overloaded functions. The recent C99 standard however, now supports long doubles (if available) and functions taking long doubles in parameters are suffixed with 'l'. e.g. atanl(). - Testing for NaN, Infinities and such things could be done with standard C (C99) functions, if available. e.g. isnan(), isinf(). <http://www.multimania.com/gbeauche/basilisk2/wip/> File: fpu_ieee.cpp ## Todo - beautifying - generic type conversions instead of i386 assembly - update exception and accrued exception bytes (probably do a megamix from Linux/m68k math-emu code) -- Gwenolé Beauchesne |