Question
STMCUBEIDE - H7 series force use of SMLAL (Signed Multiply with Accumulate (32 × 32 + 64), 64-bit result) instruction
Code is :
int16_t OscPhase[NumOsc];
int32_t OscInc[NumOsc];
int32_t OscVol[NumOsc];
int32_t Sine[65536];
int64_t OscTotal;
and then in main() :
OscTotal = 0;
for (i = 0; i < NumOsc; i++)
{
OscPhase[i] = OscPhase[i] + OscInc[i];
OscTotal = OscTotal + Sine[OscPhase[i]] * OscVol[i];
}I was expecting the H7 to use the SMLAL instruction for the final multiply and accumulate but instead it performs a MUL.W which only gives a 32 bit result and then uses an ADD.W and ADC.W to add these 32 bits into the final 64 bit result.
Any suggestions on how to force it to use the correct code ?