Re: [hatari-devel] FPU update

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


Am 01.02.2017 um 17:41 schrieb Toni Wilen <twilen@xxxxxxxxxx>:

> 
>> Yes it can be added - but the expectation data is going to get bigger
>> again. It will also need some changes to accommodate the larger types.
>> 
>> It would benefit from loading separate expectation data for each test,
>> instead of one giant blob at the start. At some point it won't be be
>> possible to confirm it on real HW due to the size. This would also allow
>> the individual tests to be more exhaustive.
> 
> At least trigonometric and logarithmic functions can be dropped
> temporarily/moved to separate test program. They are too different and
> most of them don't have softfloat algorithm anyway.
> 


I want to provide a little update on FPU work:
We now have SoftFloat implementations for following functions: FMOVE, FINT, FINTRZ, FSQRT, FABS, FNEG, FGETEXP, FGETMAN, FDIV, FMOD, FADD, FMUL, FSGLDIV, FREM, FSCALE, FSGLMUL, FSUB, FCMP and FTST.
This includes correct handling of NaN, signaling NaN, infinity and zero. Exception bits and rounding are also handled. All functions have been tested and confirmed to give correct results using double precision floats. It is very likely that single precision also gives correct results. Extended precision should be tested to confirm that it is also handled correctly.

All missing functions are emulated through fallback to native floats after checking for SNAN, OPERR and DZ exceptions. Conversion between extended precision and packed format is also handled through fallback.
I want to implement the missing functions using SoftFloat, with highest priority to packed conversions. I want to use Motorola FPSP library as a template, but have problems to understand it. Every file contains 68k assembly and a header which explains the algorithms used. Some mathematical skills and ideally some experience reading assembly is required to understand this. The algorithm needs to be implemented using SoftFloat routines.
If anyone would provide me with some C-style pseudo code, i could then try to translate it using SoftFloat primitives. That should provide usable results (i suppose FPSP gives identical or very similar results to 6888x, because it was made for running code written for 6888x code on 68040). Because we have all 68040 floating point functions available through SoftFloat, it should be possible to translate FPSP without writing new SoftFloat routines and by just combining them in the right manner.

I have appended an example for such a C routine (not based on FPSP, just to see how such thing might look like).

Attachment: asin.c
Description: Binary data



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