from LPC1788 to LPC4088 but the code flash size is the same

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

from LPC1788 to LPC4088 but the code flash size is the same

533 Views
aut
Contributor I

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

 

 

      

0 Kudos
4 Replies

485 Views
frank_m
Senior Contributor III

> 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.

0 Kudos

503 Views
aut
Contributor I

Hello Alice. Can I have confirm that FPU increase only the floating point calculation speed but don't reduce the code size?   

Thank you

0 Kudos

489 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello aut,

I think there is no direct relation between them.

 

BR

Alice

0 Kudos

513 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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

0 Kudos