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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

882 次查看
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 项奖励
回复
4 回复数

834 次查看
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 项奖励
回复

852 次查看
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 项奖励
回复

838 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello aut,

I think there is no direct relation between them.

 

BR

Alice

0 项奖励
回复

862 次查看
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 项奖励
回复