Mlib_Shrbi; Available Versions - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_ShRBi

static
int16_t
i16Sh;
void main(void)
{
f16Val = FRAC16(-0.354);
i16Sh = 14;
/* f16Result = sat(f16Val << i16Sh) */
f16Result = MLIB_ShLBiSat_F16(f16Val, i16Sh);
}
2.51 MLIB_ShRBi
The
MLIB_ShRBi
functions return the arithmetically shifted value to the right a specified
number of times. If the number of shifts is positive, the shift is performed to the right; if
negative, to the left. The function does not saturate the output. See the following
equation:

2.51.1 Available versions

This function is available in the following versions:
• Fractional output - the output is the fractional portion of the result; the result is
within the range <-1 ; 1). The result may overflow.
The available versions of the
Function name
Input type
Value
MLIB_ShRBi_F16
frac16_t
MLIB_ShRBi_F32
frac32_t
92
/* f16Val = -0.354 */
/* i16Sh = 14 */
Equation 49. Algorithm formula
MLIB_ShRBi
function are shown in the following table.
Table 2-51. Function versions
Result
type
Shift
int16_t
frac16_t
Bidirectional shift of a 16-bit fractional value to the right by a number
of times given by the second argument; if the second argument is
negative, the shift is performed to the left. The shift is allowed within
the range <-15 ; 15>. The output is within the range <-1 ; 1).
int16_t
frac32_t
Bidirectional shift of a 32-bit fractional value to the right by a number
of times given by the second argument; if the second argument is
negative, the shift is performed to the left. The shift is allowed within
the range <-31 ; 31>. The output is within the range <-1 ; 1).
MLIB User's Guide, Rev. 2, 10/2015
Description
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents