Hi all.
I replaced the LPC1788 microcontroller with his pin-to-pin compatible LPC4088. Since there are a lot of single precision floating point calculations in the LPC1788 code, I thought this migration could reduce the size code using the FPU (floating point unit) of the LPC4088. I was wrong. Even if the FPU unit is enabled, the code size after compilation hasn't changed. It is the same as the LPC1788 one.
Shouldn't using the FPU reduce the code size?
Many thanks
> Even if the FPU unit is enabled, the code size after compilation hasn't changed. It is the same as the LPC1788 one.
Code size is not only about FPU usage.
What are the optimisation settings for the LPC4088 project ?
> Shouldn't using the FPU reduce the code size?
The floating point ABI matters as well (-mfloat-abi).
Using "soft" will result in an emulation, as on the LPC1788 (without FPU).
Using "softfp" will use the FPU, and the core registers for passing parameters.
The option "hard" will produce marginally smaller/faster code, passing parameters in FPU registers.
Code compiled with soft/softfp is interchangeable, code compiled with "hard" is not.
Hello Alice. Can I have confirm that FPU increase only the floating point calculation speed but don't reduce the code size?
Thank you
Hello aut,
As I know, the FPU (floating point unit) can speed up floating point calculation, don't know whether can reduce code size.
BR
Alice