Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

• Fractional output - the output is the fractional portion of the result; the result is
within the range <-1 ; 1). The result may saturate.
The available versions of the
Function name
MLIB_MacSat_F16
frac16_t
MLIB_MacSat_F32lss
frac32_t
MLIB_MacSat_F32
frac32_t

2.15.2 Declaration

The available
MLIB_MacSat
frac16_t MLIB_MacSat_F16(frac16_t
frac32_t MLIB_MacSat_F32lss(frac32_t
frac32_t MLIB_MacSat_F32(frac32_t
2.15.3 Function use
The use of the
MLIB_MacSat
#include "mlib.h"
static
frac16_t
f16Mult1, f16Mult2;
static
frac32_t
f32Accum, f32Result;
void main(void)
{
f32Accum = FRAC32(-0.7);
f16Mult1 = FRAC16(-1.0);
f16Mult2 = FRAC16(0.8);
/* f32Result = sat(f32Accum + f16Mult1 * f16Mult2) */
f32Result = MLIB_MacSat_F32lss(f32Accum, f16Mult1, f16Mult2);
}
Freescale Semiconductor, Inc.
MLIB_MacSat
Table 2-15. Function versions
Input type
Accum.
Mult. 1
Mult. 2
frac16_t
frac16_t
frac16_t
frac16_t
frac32_t
frac32_t
functions have the following declarations:
f16Accum,
f32Accum,
f32Accum,
function is shown in the following example:
/* f32Accum = -0.7 */
/* f16Mult1 = -1.0 */
/* f16Mult2 = 0.8 */
MLIB User's Guide, Rev. 2, 10/2015
function are shown in the following table.
Result
type
frac16_t
The upper 16-bit portion [16..31] of the fractional
product (of two 16-bit fractional multiplicands) is
added to a 16-bit fractional accumulator. The
output is within the range <-1 ; 1).
frac32_t
The 32-bit fractional product (of two 16-bit
fractional multiplicands) is added to a 32-bit
fractional accumulator. The output is within the
range <-1 ; 1).
frac32_t
The upper 32-bit portion [32..63] of the fractional
product (of two 32-bit fractional multiplicands) is
added to a 32-bit fractional accumulator. The
output is within the range <-1 ; 1).
frac16_t
f16Mult1,
frac16_t
frac16_t
f16Mult1,
frac32_t
f32Mult1,
frac32_t
Chapter 2 Algorithms in detail
Description
f16Mult2)
frac16_t
f16Mult2)
f32Mult2)
43

Advertisement

Table of Contents
loading

Table of Contents