Miscellaneous - Texas Instruments TMS320C64X Programmer's Reference Manual

Dsp little-endian dsp library
Hide thumbs Also See for TMS320C64X:
Table of Contents

Advertisement

DSP_bexp

4.7 Miscellaneous

DSP_bexp
Function
Arguments
Description
Algorithm
Special Requirements
4-76
Block Exponent Implementation
short DSP_bexp(const int *x, short nx)
x[nx]
Pointer to input vector of size nx. Must be double-word
aligned.
nx
Number of elements in input vector. Must be multiple of 8.
return short
Return value is the maximum exponent that may be used in
scaling.
Computes the exponents (number of extra sign bits) of all values in the input
vector x[ ] and returns the minimum exponent. This will be useful in
determining the maximum shift value that may be used in scaling a block of
data.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
short DSP_bexp(const int *x, short nx)
{
int
min_val =_norm(x[0]);
short
n;
int
i;
for(i=1;i<nx;i++)
{
n =_norm(x[i]); /* _norm(x) = number of */
if(n<min_val) min_val=n;
}
return min_val;
}
-
nx must be a multiple of 8.
-
The input vector x[ ] must be double-word aligned.
/* redundant sign bits
*/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents