Re: [hatari-devel] FPU update |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Am 19.01.2017 um 19:37 schrieb Toni Wilen <twilen@xxxxxxxxxx>:
>>> I have already volunteered to do that. (68030 + 68882) I only need
>>> (tiny) test source code.
>>
>> I'm not able to write an assembly program, but i can provide some pseudo code:
>>
>> 1. set FPCR to 80-bit rounding precision
>> 0x0000 --> FPCR
>>
>> 2. load register with denormal number:
>> 0x00000000 0x10000000 0x00000000 --> FPx
>>
>> 3. load another register with integer 2
>> 2 --> FPy
>>
>> 4. do following loop:
>> for (int i = 0; i < 6; i++)
>> {
>> FPx = FMUL(FPx, FPy);
>> print content of FPx in hexadecimal format
>> }
>>
>
> I got these results:
>
> 00000000 20000000 00000000
> 00000000 40000000 00000000
> 00000000 80000000 00000000 <--- If it was the x87 way, this would have jumped to 00010000 80000000 00000000
> 00010000 80000000 00000000
> 00020000 80000000 00000000
> 00030000 80000000 00000000
>
Thank you for the very quick response! So yes, that matches the data sheet and means i will have to do some work on SoftFloat to correctly emulate denormals. I also need to think about a solution for native floats. But that will be non-trivial. Time is starting to get a limiting factor now.