6.6.4
C Code Access to the Upper 16 Bits of 16-Bit Multiply
The following method provides access to the upper 16 bits of a 16-bit multiply
in C language. For example:
Signed results:
-
intm1, m2;
intresult;
result = ((long) m1 * (long) m2) >> 16;
Unsigned results:
-
unsigned m1, m2;
unsigned result;
result = ((unsigned long) m1 * (unsigned long) m2) >>
16;
Both result statements are implemented by the compiler without making a
function call to the 32-bit multiply routine.
Integer Expression Analysis
Run-Time Environment
6-29
Need help?
Do you have a question about the TMS320C2x and is the answer not in the manual?