cancel
Showing results for 
Search instead for 
Did you mean: 

How to make multiplications faster in STM32G series

DKuro.1
Associate III

Hi,

when I took two variables and perform a multiplication between them with the STM32CubeIDE, the multiplication itself its made automatically with the multiplier module in the fastest way or there is something I need to do/configure to make it faster?

13 REPLIES 13

I am struggling to see the assembly generated code...

is there a simply way to see the assembly code?

  1. Yes.
  2. FMAC is designed to do multiply-and-accumulate operations over a series of number pairs stored in a format different from what the C compiler uses. While you can use it to just multiply two 16 bit integers, it won't be any faster than a plain integer multiplication.

Great berendi, thanks for all the help you gave me!

> 1) So, I just need to multiply a*b in my code and that's it?

That's the point of a programming language, instead of coding in assembly.

But you need to take care what "a" and "b" mean in your context. The compiler will create an appropriate instruction sequence, being it byte or double precision data, and having an FPU or not.

> 2) The FMAC module can make the multiplications faster?

The compiler usually emits proper instructions to utilize the core resources.