Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

MLIB_MacRndSat
• 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
table.
Function name
MLIB_MacRndSat_F16
MLIB_MacRndSat_F32lls
MLIB_MacRndSat_F32

2.17.2 Declaration

The available
MLIB_MacRndSat
frac16_t MLIB_MacRndSat_F16(frac16_t
frac32_t MLIB_MacRndSat_F32lls(frac32_t
frac32_t MLIB_MacRndSat_F32(frac32_t
2.17.3 Function use
The use of the
MLIB_MacRndSat
#include "mlib.h"
static
frac32_t
f32Accum, f32Mult1, f32Mult2, f32Result;
void main(void)
{
f32Accum = FRAC32(-0.7);
f32Mult1 = FRAC32(-1.0);
f32Mult2 = FRAC32(0.8);
/* f32Result = sat(round(f32Accum + f32Mult1 * f32Mult2)) */
46
MLIB_MacRndSat
Table 2-17. 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
functions have the following declarations:
f16Accum,
f32Accum,
f32Accum,
function is shown in the following example:
/* f32Accum = -0.7 */
/* f32Mult1 = -1.0 */
/* f32Mult2 = 0.8 */
MLIB User's Guide, Rev. 2, 10/2015
function are shown in the following
Result
type
frac16_t
The fractional product (of two 16-bit fractional
multiplicands), rounded to the upper 16 bits,
is added to 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 added to 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 added to a 32-bit fractional
accumulator. The output is within the range
<-1 ; 1).
frac16_t
f16Mult1,
frac16_t
frac32_t
f32Mult1,
frac32_t
f32Mult1,
frac32_t
Description
f16Mult2)
frac16_t
f16Mult2)
f32Mult2)
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents