Do you have any examples that show how to use the MAC for 16- or 32-bit multiplies and shifts?
Answer
The attached macros and functions show how to use the Multiply-and-Accumulate module (MAC) for basic 16- and 32-bit multiply and shift operations, including:
16*16 = 16-bit signed and unsigned multiply
16*16 = 32-bit signed and unsigned multiply
32*32 = 32-bit signed and unsigned multiply
32-bit signed and unsigned left shift
32-bit signed and unsigned right shift
These operations are in either function or macro form. Macros are embedded directly into the code when the project is compiled, so they tend to be faster than functions. Functions tend to be slower due to the function call overhead, but they save code space if there are many calls to the same MAC code.
Please see the appropriate device datasheets for more information on the MAC.
Using the MAC for 16- and 32-bit Operations