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

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_Clb

The available versions of the
Function name
Add. 1
MLIB_Add4Sat_F16
frac16_t
MLIB_Add4Sat_F32
frac32_t

2.6.2 Declaration

The available
MLIB_Add4Sat
frac16_t MLIB_Add4Sat_F16(frac16_t
f16Add4)
frac32_t MLIB_Add4Sat_F32(frac32_t
f32Add4)

2.6.3 Function use

The use of the
MLIB_Add4Sat
#include "mlib.h"
static
frac16_t
f16Result, f16Add1, f16Add2, f16Add3, f16Add4;
void main(void)
{
f16Add1 = FRAC16(-0.7);
f16Add2 = FRAC16(0.9);
f16Add3 = FRAC16(0.4);
f16Add4 = FRAC16(0.7);
/* f16Result = sat(f16Add1 + f16Add2 + f16Add3 + f16Add4) */
f16Result = MLIB_Add4Sat_F16(f16Add1, f16Add2, f16Add3, f16Add4);
}
2.7 MLIB_Clb
The
MLIB_Clb
functions return the number of leading bits of the input. If the input is 0,
it returns the size of the type minus one.
30
MLIB_Add4Sat
function are shown in the following table.
Table 2-6. Function versions
Input type
Add. 2
Add. 3
Add. 4
frac16_t
frac16_t
frac16_t
frac32_t
frac32_t
frac32_t
functions have the following declarations:
f16Add1,
frac16_t
f32Add1,
frac32_t
function is shown in the following example:
/* f16Add1 = -0.7 */
/* f16Add2 = 0.9 */
/* f16Add3 = 0.4 */
/* f16Add4 = 0.7 */
MLIB User's Guide, Rev. 2, 10/2015
Result
Description
type
frac16_t
Addition of four 16-bit fractional addends.
The output is within the range <-1 ; 1).
frac32_t
Addition of four 32-bit fractional addends.
The output is within the range <-1 ; 1).
f16Add2,
frac16_t
f16Add3,
f32Add2,
frac32_t
f32Add3,
Freescale Semiconductor, Inc.
frac16_t
frac32_t

Advertisement

Table of Contents
loading

Table of Contents