Floating Point

Technical discussions around xCORE processors (e.g. General Purpose (L/G), xCORE-USB, xCORE-Analog, xCORE-XA).
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am

Floating Point

Postby rp181 » Tue Sep 14, 2010 2:46 am

Does anyone know exactly how much slower operations with floating point numbers are than with fixed point?
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Tue Sep 14, 2010 2:26 pm

You can't say that exactly as it depends on the implementation.
User avatar
lilltroll
XCore Expert
Posts: 955
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Postby lilltroll » Wed Sep 15, 2010 6:41 am

If it doesn't need to be IEEE 754 compliant, and you can skip a software exception handling for floating points, many operations can be saved. E.g. instead of using double prec. use {63 bit + sign} or 64 bit (2 ALU registers) for the digits and 32 or {31bit + sign} (1 ALU register) for the exponent.

Using directed rounding mode, you can calculate FADD and FMUL in about 10 operations or a little more, (converting from integer to float vice-versa not included)
Probably not the most confused programmer anymore on the XCORE forum.
yzoer
XCore Addict
Posts: 133
Joined: Tue Dec 15, 2009 10:23 pm

Postby yzoer » Tue Oct 26, 2010 6:02 pm

Floating point is ALWAYS going to be slower than fixed point because of normalization. If you *really* need extra precision, you can use 64-bit integers using assembly.

-Yvo

Who is online

Users browsing this forum: No registered users and 5 guests