Declaration; Function Use - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_MsuRnd
The available versions of the
Function name
MLIB_MsuRnd_F16
MLIB_MsuRnd_F32lls
MLIB_MsuRnd_F32
MLIB_MsuRnd_A32ass

2.24.2 Declaration

The available
MLIB_MsuRnd
frac16_t MLIB_MsuRnd_F16(frac16_t
frac32_t MLIB_MsuRnd_F32lls(frac32_t
frac32_t MLIB_MsuRnd_F32(frac32_t
acc32_t MLIB_MsuRnd_A32ass(acc32_t

2.24.3 Function use

The use of the
MLIB_MsuRnd
#include "mlib.h"
static
frac16_t
f16Accum, f16Mult1, f16Mult2, f16Result;
void main(void)
{
f16Accum = FRAC16(0.3);
f16Mult1 = FRAC16(0.1);
f16Mult2 = FRAC16(-0.2);
/* f16Result = round(f16Accum - f16Mult1 * f16Mult2) */
56
MLIB_MsuRnd
Table 2-24. Function versions
Input type
Accum.
Mult. 1
Mult. 2
frac16_t
frac16_t
frac16_t
frac32_t
frac32_t
frac16_t
frac32_t
frac32_t
frac32_t
acc32_t
frac16_t
frac16_t
functions have the following declarations:
f16Accum,
f32Accum,
f32Accum,
a32Accum,
function is shown in the following example:
/* f16Accum = 0.3 */
/* f16Mult1 = 0.1 */
/* f16Mult2 = -0.2 */
MLIB User's Guide, Rev. 2, 10/2015
function are shown in the following table.
Result
type
frac16_t
The fractional product (of two 16-bit fractional
multiplicands), rounded to the upper 16 bits, is
subtracted from a 16-bit fractional accumulator.
The output is within the range <-1 ; 1).
frac32_t
The fractional product (of a 32-bit and 16-bit
fractional multiplicands), rounded to the upper
32 bits [16..48], is subtracted from a 32-bit
fractional accumulator. The output is within the
range <-1 ; 1).
frac32_t
The fractional product (of two 32-bit fractional
multiplicands), rounded to the upper 32 bits
[32..63], is subtracted from a 32-bit fractional
accumulator. The output is within the range <-1 ;
1).
acc32_t
The fractional product (of two 16-bit fractional
multiplicands), rounded to the upper 16 bits
[16..31], is subtracted from a 32-bit accumulator.
The output may be out of the range <-1 ; 1).
frac16_t
f16Mult1,
frac16_t
frac32_t
f32Mult1,
frac32_t
f32Mult1,
frac32_t
frac16_t
f16Mult1,
frac16_t
Description
f16Mult2)
frac16_t
f16Mult2)
f32Mult2)
f16Mult2)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents