Download Target Settings

Transcript
Inline Assembly Language and Intrinsic Functions
List of Intrinsic Functions: Definitions and Examples
long result;
result = _L_deposit_h(s1);
// Expected value of result: 0x3fff0000
_L_deposit_I
Definition
Deposits the 16-bit integer or fractional value into the lower 16 bits
of a 32- bit value, and sign extends the upper 16 bits of a 32-bit
value.
Prototype
Word32 _L_deposit_l(Word16 ssrc)
Example
short s1 = 0x7FFF;
long result;
result = _L_deposit_l(s1);
// Expected value of result: 0x00007FFF
Division
• __div
• __div_ls
__div
Definition
Divides two 16-bit short integers as a fractional operation and
returns the result as a 16-bit short integer. Generates a DIV
instruction.
Prototype
short __div( short, short );
Example
short i = 0x2000; /* Assign 0.25 to i */
short j = 0x4000; /* Assign 0.50 to j */
__fixed__ f;
i = __div( i, j );
/* Returns 16384 */
f = __short2fixed( i ); /* Returns 0.50 */
DSP–166
Targeting DSP56800