[hatari-devel] FPU update

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hello Hatari community, hello Toni,

over the last weeks i've been working on improving the 6888x/68040 FPU emulation. I want to share the result with you. It has the following improvements:

- Adds an option to use software floating point arithmetics (via SoftFloat library)
- Fixes lots of bugs, mostly related to rounding and normalization. At least one rounding bug was critical (crashed Mac OS from many applications)
- Improved handling of the FPSR register, although this needs more testing and comparing to real systems

TODOs:
- All 68040, but not all 6888x FPU arithmetic instructions are emulated through software floating point math. For the missing functions we use the old native floating point math as a fallback. These need to be implemented using SoftFloat arithmetics. If anyone is able to help implementing the missing functions (mostly exponential, hyperbolic, inverse hyperbolic and inverse trigonometric functions), any help is welcome!
- Arithmetic exceptions are still not supported. Before implementing the exceptions, more work needs to be done on correctly setting the exception bits.

Possible regressions from the previous version:
- You might notice some decrease in performance, if using the software floating point implementation. After some testing it seems that the difference is hardly noticeable on normal usage. I think this won't be an issue unless one uses mathematical programs with lots of floating point arithmetics.
- I removed some platform specific (e.g. MSVC) code, because on my system (Mac OS X) i could not even check if it compiles. Someone with the appropriate system might want to re-add it.

I think it makes sense to test this with Hatari. But if you decide you don't want or don't need software floating point arithmetics you might want to extract the bug fixes. All required files are in the appended archive. softfloat, fpp.c and the headers are additions/replacements. The patch contains needed changes to newcpu.c and newcpu.h (they are minimal).

Best wishes,

Andreas

Attachment: fpp_patch.zip
Description: Zip archive



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/