How to turn on MPC5744P's FPU?

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

How to turn on MPC5744P's FPU?

1,923 Views
1060111312
Contributor II

How to turn on MPC5744P's FPU?In my project, I tested the floating point speed of MPC5744 through a piece of code and found that it took too long. It is concluded that no corresponding FPU has been opened.

Tags (2)
0 Kudos
9 Replies

1,535 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I think it is not needed to enable it as EFPU/LSP is always enabled. With predecessors having EFPU/SPE unit it was needed to set MSR[SPE] bit, but it is not the case.

0 Kudos

1,535 Views
1060111312
Contributor II

Dear David,thank you for your answer to me. Now that EFPU/LSP is always enabled,the question is, why are floating-point operations performed so slowly, unlike using an internal floating-point unit? hope to get your reply again,thank you!

0 Kudos

1,535 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Could you disassemble a piece of the code where do you have floating point operation to see whether EFPU/LSP instructions are used? Don't you have it disabled in some compiler setting?

0 Kudos

1,535 Views
1060111312
Contributor II

Hello, I am not sure that EFPU/LSP instruction are used because compiler (S32 Design Studio for Architecture)  can not configure or observed the relevant register about Floating point unit. I simply made a rough estimate of the  execution time of the code and  find that MPC5744P do not use the EFPU. 

0 Kudos

1,535 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, try to check following option:

pastedImage_1.png

1,535 Views
1060111312
Contributor II

Dear David,

        For hardware Floating point Unit, is there a corresponding math library files? Just like sin\cos\log\arctan and so long.

sin_cos.jpg

0 Kudos

1,535 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Library math.h should work for you

#include <math.h>

 

int main(void) {

  float a=3.14159265358979/2; // Pi/2

  float b=10000;

  float c,d;

 

  c = sinf (a);

  d = sqrtf (b);

}

0 Kudos

1,535 Views
1060111312
Contributor II

Dear David,

  Recently, I tested the floating-point operation again and found that the code executes at the same time whether or not a 'Use hardware Floating-point ' is checked.

0 Kudos

1,535 Views
1060111312
Contributor II

The problem is solved,thank you very much!

0 Kudos