Skip to main content
Pedro Oliveira
Associate II
May 19, 2021
Question

Difference between arm_mult_f32 function and a normal multiplication

  • May 19, 2021
  • 1 reply
  • 1192 views

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

This topic has been closed for replies.

1 reply

TDK
May 19, 2021

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`.

"If you feel a post has answered your question, please click ""Accept as Solution""."