2021-05-18 05:30 PM
Hi everyone,
I expected to get a faster multiplication processing using the arm_mult_f32 function than a normal multiplication like val1*val2. However, when I tested it using the SysTick->VAL I get a bigger processing time for the arm_mult_f32 function.
Any idea what is going on?
Below is a code snippet to exemplify the test.
float32_t result = 0;
float32_t val1 = 1.5;
float32_t val2 = 1.5;
uint32_t start_t, stop_t, cont_t;
start_t = SysTick->VAL;
arm_mult_f32(&val1, &val2, &result, 1);
stop_t = SysTick->VAL;
cont_t = start_t - stop_t; // Gets cont_t = 85
start_t = SysTick->VAL;
result = val1 * val2; //
stop_t = SysTick->VAL;
cont_t = start_t - stop_t; // Gets cont_t = 23
2021-05-18 07:04 PM
Calling a function introduces overhead. Overhead becomes less significant when you convert many values at once, but you're only doing a single one.
The function arm_mult_f32 still multiplies things together. It's not doing a faster version of multiplication than what you get with `val1 * val2`.