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

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_Sign

The available versions of the
Function name
MLIB_ShRBiSat_F16
frac16_t
MLIB_ShRBiSat_F32
frac32_t

2.52.2 Declaration

The available
MLIB_ShRBiSat
frac16_t MLIB_ShRBiSat_F16(frac16_t
frac32_t MLIB_ShRBiSat_F32(frac32_t

2.52.3 Function use

The use of the
MLIB_ShRBiSat
include "mlib.h"
static
frac32_t
f32Result, f32Val;
static
int16_t
i16Sh;
void main(void)
{
f32Val = FRAC32(-0.354);
i16Sh = 13;
/* f32Result = sat(f32Val >> i16Sh) */
f32Result = MLIB_ShRBiSat_F32(f32Val, i16Sh);
}
2.53 MLIB_Sign
The
MLIB_Sign
functions return the sign of the input. See the following equation:
94
MLIB_ShRBiSat
Table 2-52. Function versions
Input type
Result
type
Value
Shift
int16_t
frac16_t
int16_t
frac32_t
functions have the following declarations:
f16Val,
f32Val,
function is shown in the following example:
/* f32Val = -0.354 */
/* i16Sh = 13 */
MLIB User's Guide, Rev. 2, 10/2015
function are shown in the following table.
Description
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).
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).
int16_t
i16Sh)
int16_t
i16Sh)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents