Floating Point
-
- Respected Member
- Posts: 395
- Joined: Tue May 18, 2010 12:25 am
Floating Point
Does anyone know exactly how much slower operations with floating point numbers are than with fixed point?
-
- XCore Expert
- Posts: 754
- Joined: Thu Dec 10, 2009 6:56 pm
You can't say that exactly as it depends on the implementation.
-
- XCore Expert
- Posts: 956
- Joined: Fri Dec 11, 2009 3:53 am
- Location: Sweden, Eskilstuna
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)
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.
-
- XCore Addict
- Posts: 133
- Joined: Tue Dec 15, 2009 10:23 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
-Yvo