Close

Floating Point

A project log for Merlin

68000 Retro Super Computer

Matthew PearceMatthew Pearce 07/28/2021 at 14:330 Comments

I have updated and modified an FPU from opencores. I removed the division/square root code and put in xilinix optimised code. It now runs at 200mhz as opposed to the original 100mhz.

Using the FPU for this code:

for (int i = 0; i<5000; i++) {
        res = (a+i)/(b-i);
        res = res * a * (i/b);

        if (res < 0) {
            res = res*-1.0;
        }

        res = sqrtf(res);

        printf("res = %0.3f\r\n",res);
    }
    

 I managed to improve the performance substantially over the already optimised 68k assembler code provided in the soft-float gcc library. Also tg68 has a hardware multiplier built in so this is quite a large improvement.
I would expect larger improvements if just using ieee754 numbers rather than relying on conversion from floats all the time.

Any way from the built in timer.

time taken. fpu: 46149 sf: 51679 

Discussions