Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_MacSat

2.14.2 Declaration

The available
MLIB_Mac
frac16_t MLIB_Mac_F16(frac16_t
frac32_t MLIB_Mac_F32lss(frac32_t
frac32_t MLIB_Mac_F32(frac32_t
acc32_t MLIB_Mac_A32ass(acc32_t
2.14.3 Function use
The use of the
MLIB_Mac
#include "mlib.h"
static
frac32_t
f32Accum, f32Result;
static
frac16_t
f16Mult1, f16Mult2;
void main(void)
{
f32Accum = FRAC32(0.3);
f16Mult1 = FRAC16(0.1);
f16Mult2 = FRAC16(-0.2);
/* f32Result = f32Accum + f16Mult1 * f16Mult2 */
f32Result = MLIB_Mac_F32lss(f32Accum, f16Mult1, f16Mult2);
}
2.15 MLIB_MacSat
The
MLIB_MacSat
functions return the sum of the input accumulator and the fractional
product of two multiplicands. The function saturates the output. See the following
equation:
2.15.1 Available versions
This function is available in the following versions:
42
functions have the following declarations:
f16Accum,
frac16_t
f32Accum,
frac16_t
f32Accum,
frac32_t
a32Accum,
frac16_t
function is shown in the following example:
/* f32Accum = 0.3 */
/* f16Mult1 = 0.1 */
/* f16Mult2 = -0.2 */
Equation 13. Algorithm formula
MLIB User's Guide, Rev. 2, 10/2015
f16Mult1,
frac16_t
f16Mult2)
f16Mult1,
frac16_t
f32Mult1,
frac32_t
f32Mult2)
f16Mult1,
frac16_t
f16Mult2)
Freescale Semiconductor, Inc.
f16Mult2)

Advertisement

Table of Contents
loading

Table of Contents