Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430I2031: Fixed point IQ31 multiplication on a device with MPY16

Part Number: MSP430I2031

Hi,

I need to multiply two fixed point numbers in an IQ31 format. The MSP430I2031 supports neither 32x32 nor fractional multiplication, hence I need to roll my own function.

The best I came up with is:

int32_t __iq31mpy(int32_t a, int32_t b)
{
    return  ((int32_t)(((int64_t)(a) * (int64_t)(b)) >> 31));
}

However this has quite significant overhead. All intermediate 64 bit values that will be discarded (we're only interested in top 32 bits) take up registers/stack, also there are 4-level-deep nested internal __mspabi functions.

There got to be an easier route by directly using MPY16 in 4 multiplies of 16x16=32 type using MACS, but I just can't figure it out.

Greetings

Michał

**Attention** This is a public forum