C Code Access To The Upper 16 Bits Of 16-Bit Multiply - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents