Good morning

I need to optimize the floating point execution. The CPU is the K64...

I have been looking for similar thematics, but I did not find the right answer. I understand the core is offering the FPU only for the shorter floating,

while for the double only the software emulation is available.

I see the math.h is proposing the functions ex...

sin() and sinf()

for the data of type float and double. In parallel the CMSYS has the function arm_sin_f32() not the arm_sin_f64()

So I have some limited trouble in evaluating the usage of the functions.

1) It seemd for double data type the only function to use is the sin()

2) If I use the sinf() the hardware support is automatically used???

3) Is the arm_sin_f32() better than the sinf() ? Precision wise ???

I would like to be sure the FPU is used. What is the way to verify??? Maybe looking the disassembled code for some floating point instruction....

I will pleasantly book some advice on the subject

Thank You

Hi, Pietro,

I have used the following code based on KDS tools, the f2 return the correct result.

BR

XiangJun Rong

#include "MKV58F22.h"

#include "math.h"

#define PI 3.1415926

static int i = 0;

double f1,f2;

int main(void)

{

/* Write your code here */

f1=1.23;

f2=1.23;

f2=f1+f2;

f1=PI/4.0;

f2=sin(f1);

__asm("nop"); //set break point here to observe the result in debugger

/* This for loop should be replaced. By default this loop allows a single stepping. */

for (;;) {

i++;

}

/* Never leave main */

return 0;

}