|Re: [hatari-devel] Native FPU emulation|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
while trying to debug an application, i just noticed that Hatari does
not seem to use long doubles when using native emulation
(USE_LONG_DOUBLE is not defined). Wouldn't it make sense to use at
least the long double format when available, to be closer to the m68k
format, even if that will not be as accurate as the softfloat emulation?
Also, in uae_cpu/newcpu.h, USE_LONG_DOUBLE is defined, but to a zero
value. However in other places ifdef is used, which will still be true.
And if i understand the code correctly, the softfloat emulation solely
uses the fpdata.fpx member, while the native emulation only uses
fpdata.fp. When switching the emulation type at runtime, i can't see
any attempt to convert from one field to the other (unless i missed
something). Instead, it seems to reset the FPU registers to all NANs.
Is that intended?
And the file cpu/md-fpp.h does not seem to be used at all.
I might be wrong but IIRC Toni removed the long double because the extra
cpu overhead was not worth the small accuracy gain.
For this and the other points of your message, Toni might give more
detailed answer when he read this.
It is not removed.
It is not used (but should still work if USE_LONG_DOUBLE=1) in WinUAE
because MSVC does not support long doubles (long double is simply alias
to double. Just don't ask.).
WinUAE uses alternative method where every long double FPU function
calls is redirected to "wrapper" x86/x64 assembly function that does the
calculation. It uses softfloat (fpx) FPU register variables. Host FPU
variable (double/long double) is not used in either 80-bit mode.
It is also runtime configurable in WinUAE (host 64-bit, host 80-bit or
softfloat 80-bit). 64-bit is the default because there are very few
software that needs 80-bit accuracy.
Hopefully this helped.