Tool/software: TI C/C++ Compiler
I'm using the TMS320F28069 with the FPU enabled. As such I decided to turn on the warning to tell me if I'm using any 64bit floating point math anywhere ( #1558-D 64-bit floating point operations are not allowed )
What I see is that in all the IQ math conversion functions:
#define _IQ24(A) (long) ((A) * 16777216.0L)
When I pass
float_t value;
x = _IQ24(value);
Then the value is getting extended to a 64bit long double and multiplied by the long double constant 16777216.0L. The result is then converted back to a 32bit integer type.
This is giving me the warning above and is obviously much much slower than using the 32bit FPU multiplication.
If I change the macro to:
#define _IQ24(A) (long) ((A) * 16777216.0F)
Then everything stays in 32bit floating point and the warning is gone which is nice and quick.
Is there really a risk here that the multiplication will overflow the precision of a 32bit float and cause significantly more error in the already imperfect fixed point conversion?
How do I quantify this error?