Declaration - Freescale Semiconductor DSP56800E User Manual

Mlib
Hide thumbs Also See for DSP56800E:
Table of Contents

Advertisement

The available versions of the
Function name
Accum.
MLIB_Msu_F16
frac16_t
MLIB_Msu_F32lss
frac32_t
MLIB_Msu_F32
frac32_t
MLIB_Msu_A32ass
acc32_t

2.22.2 Declaration

The available
MLIB_Msu
frac16_t MLIB_Msu_F16(frac16_t
frac32_t MLIB_Msu_F32lss(frac32_t
frac32_t MLIB_Msu_F32(frac32_t
acc32_t MLIB_Msu_A32ass(acc32_t
2.22.3 Function use
The use of the
MLIB_Msu
#include "mlib.h"
static
acc32_t
a32Accum, a32Result;
static
frac16_t
f16Mult1, f16Mult2;
void main(void)
{
a32Accum = ACC32(2.3);
f16Mult1 = FRAC16(0.1);
f16Mult2 = FRAC16(-0.2);
/* a32Result = a32Accum - f16Mult1 * f16Mult2 */
a32Result = MLIB_Msu_A32ass(a32Accum, f16Mult1, f16Mult2);
}
Freescale Semiconductor, Inc.
MLIB_Msu
function are shown in the following table.
Table 2-22. Function versions
Input type
Result
type
Mult. 1
Mult. 2
frac16_t
frac16_t
frac16_t
frac16_t
frac16_t
frac32_t
frac32_t
frac32_t
frac32_t
frac16_t
frac16_t
acc32_t
functions have the following declarations:
f16Accum,
frac16_t
f32Accum,
frac16_t
f32Accum,
frac32_t
a32Accum,
frac16_t
function is shown in the following example:
/* a32Accum = 2.3 */
/* f16Mult1 = 0.1 */
/* f16Mult2 = -0.2 */
MLIB User's Guide, Rev. 2, 10/2015
Chapter 2 Algorithms in detail
Description
The upper 16-bit portion [16..31] of the fractional
product (of two 16-bit fractional multiplicands) is
subtracted from a 16-bit fractional accumulator. The
output is within the range <-1 ; 1).
The 32-bit fractional product (of two 16-bit fractional
multiplicands) is subracted from a 32-bit fractional
accumulator. The output is within the range <-1 ; 1).
The upper 32-bit portion [32..63] of the fractional
product (of two 32-bit fractional multiplicands) is
subtracted from a 32-bit fractional accumulator. The
output is within the range <-1 ; 1).
The upper 16-bit portion [16..31] of the fractional
product (of two 16-bit fractional multiplicands) is
subtracted from a 32-bit accumulator. The output
may be out of the range <-1 ; 1).
f16Mult1,
frac16_t
f16Mult2)
f16Mult1,
frac16_t
f32Mult1,
frac32_t
f32Mult2)
f16Mult1,
frac16_t
f16Mult2)
f16Mult2)
53

Advertisement

Table of Contents
loading

Table of Contents