MPC5744P, double and float

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5744P, double and float

335件の閲覧回数
778939159
Contributor I

NXP engineer,

We use the S32DS complier and MPC5744P. And we found the constant 1.0f in equation(1) is used as 32-bit foat which is supported by hardware, but the 1.0 in equation(2) is used as 64-bit double( SW emulated). So the caculation speed of the equation(2) is much slower than equation(1).

float y,x;

y = 1.0f*x; (1)
y= 1.0*x; (2)

Because our application software has many float constants without "f", and the float constants in application are not easy to be revised one by one.  So the caculation speed is slow. Are there any method to treat "1.0" as "1.0f", so we can improve the caculation speed. THANKS!

0 件の賞賛
1 返信

332件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

It seems following option is capable to do it:

davidtosenovjan_0-1660570297185.png

 

0 件の賞賛