Declaration; Function Use; Mlib_Shlsat - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_ShLSat

The available versions of the
Function name
Input type
Value
MLIB_ShL_F16
frac16_t
MLIB_ShL_F32
frac32_t

2.46.2 Declaration

The available
MLIB_ShL
frac16_t MLIB_ShL_F16(frac16_t
frac32_t MLIB_ShL_F32(frac32_t

2.46.3 Function use

The use of the
MLIB_ShL
#include "mlib.h"
static
frac16_t
f16Result, f16Val;
static
uint16_t
u16Sh;
void main(void)
{
f16Val = FRAC16(-0.354);
u16Sh = 6;
/* f16Result =
f16Val << u16Sh */
f16Result = MLIB_ShL_F16(f16Val, u16Sh);
}
2.47 MLIB_ShLSat
The
MLIB_ShLSat
functions return the arithmetically shifted value to the left a specified
number of times. The function saturates the output. See the following equation:
86
MLIB_ShL
function are shown in the following table.
Table 2-46. Function versions
Result
type
Shift
uint16_t
frac16_t
Shift of a 16-bit fractional value to the left by a number of times given
by the second argument; the shift is allowed within the range <0 ; 15>.
The output is within the range <-1 ; 1).
uint16_t
frac32_t
Shift of a 32-bit fractional value to the left by a number of times given
by the second argument; the shift is allowed within the range <0 ; 31>.
The output is within the range <-1 ; 1).
functions have the following declarations:
f16Val,
uint16_t
f32Val,
uint16_t
function is shown in the following example:
/* f16Val = -0.354 */
/* u16Sh = 6 */
MLIB User's Guide, Rev. 2, 10/2015
Description
u16Sh)
u16Sh)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents