This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I need a clarification on the FPU: I do not see any performance improvement when I try to execute simple multiply operations between two floats.
The execution time of for example:
float a = (float)2.1 * (float)3.2;
is 178 ns @ 120MHz, both when the FPU is active and not.
In order to activate the FPU I execute:
FPUEnable(); FPULazyStackingEnable();
I see the same behaviour also on other floating point operations, no performance improvement when FPU is enabled. Why?
Is there any other configuration that I need to perform or is this correct?
Best regards.
Paolo
Hi,
FPU is already enabled in startup if your build option specifies it. See below.
The startup file enables the FPU by default. So if you try to call FPUEnable you may not see any difference since it is already enabled. If you use FPUDisable the you should get a fault exception as the code is compiled to use FPU instructions. If you want to compare the performance between FPU and non-FPU then you can go to the project property->Processor Options and select the vfplib instead of the FPvSPD16. This will instruct the compiler to use the software library to implement the floating operation which will take significantly more cycles than would have been done by the FPU.
Please refer to the below post.