How do I use math library and SPFP on MPC5674F.

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

How do I use math library and SPFP on MPC5674F.

1,224 Views
hyenongijeong
Contributor III

Hi,

I want to use Math function with SPFP. 

Ex> cos, sin, pow ..

There are my test report using SPFP ans SW mode.

I think math library doesn't use SPFP.

How can I use math function with SPFP(HW FPU)? 

  1. SW FPU + (FLOAT * FLOAT => 40000 times) => 112 ms
  2. SW FPU + (cos(FLOAT) => 2000 times)        => 114 ms
  3. SPFP + (FLOAT * FLOAT => 40000 times)     => 13 ms
  4. SPFP + (cos(FLOAT) => 2000 times)            => 114 ms
  5. SPFP only + (cos(FLOAT) => 2000 times       => 115 ms

#FPU SPFP #mpc5674f#math

Tags (4)
4 Replies

987 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

I am not sure, which IDE you use, if CodeWarrior or S32 Design Studio and which library you use (EWL or Newlib), but I checked EWL in S32 Design Studio and this library is not compiled to use hardware floating point.

If you want to use math function with SPFP supported, you must recompile the library.

In S32 Design Studio installation folder and also in CodeWarrior installation folder, there are complete source file for EWL including also makefiles. So, you only need to set compiler options for Hardware floating point (for GCC it is -mhard) and recompile with this option.

Regards,

Martin

987 Views
hyenongijeong
Contributor III

Hello,

Thank you for your useful answers.

But I couldn't compile that.

Under picture is our makefile and error message.

Could you build and give it to me?

I need a C library.

This is our environments.

- CPU : MPC5674F (e200z3 core)

- FPU : SPFP

- IDE : CW10.7 - eclipse

makefile.JPG

error-log.JPG

Regards,

Henk

0 Kudos
Reply

987 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

I am sorry for my previous answer. It is not necessary to recompile the library, because this had been already done and library which supports SPFP mathematical function is already included in CodeWarrior IDE.

In your project, open project properties and set libraries the same way as in the figure below:

pastedImage_1.png

Also, you must switch the project Floating point to SPFP_only.

pastedImage_2.png

Clean your project and recompile again.

Now functions from math.h supports hardware floating point instructions.

Regards,

Martin

0 Kudos
Reply

987 Views
hyenongijeong
Contributor III

Hi,

Thank you for your answer.

I'll check again soon.

regards,

Henk

0 Kudos
Reply