I am implementing a Filter and I need to optimised as much as possible the implementation. I have realised that there is an instruction that need a lot of cycles and I do not understand why:
bool filters_apply(...)
{
short sSample;
double dSample;
...
...
sSample = (short) dSample; //needs a lot of cycles to execute
...
...
}
I am using de GCC Option: -mcpu=arm926ej-s -mfloat-abi=softfp -mfpu=vfp I have try to compile with the FP ABI "hard" to see if there is difference, but the compiler does not implement it.
Could anyone explain me why that instruction needs so many cycles?
Thanks a lot!!