2.19.2 Declaration
The available
MLIB_Mac4Sat
frac32_t MLIB_Mac4Sat_F32ssss(frac16_t
f16Add2Mult1,
frac16_t
2.19.3 Function use
The use of the
MLIB_Mac4Sat
#include "mlib.h"
static
frac32_t
f32Result;
static
frac16_t
f16Add1Mult1, f16Add1Mult2, f16Add2Mult1, f16Add2Mult2;
void main(void)
{
f16Add1Mult1 = FRAC16(-1.0);
f16Add1Mult2 = FRAC16(-0.9);
f16Add2Mult1 = FRAC16(0.8);
f16Add2Mult2 = FRAC16(0.7);
/* f32Result = sat(f16Add1Mult1 * f16Add1Mult2 + f16Add2Mult1 * f16Add2Mult2) */
f32Result = MLIB_Mac4Sat_F32ssss(f16Add1Mult1, f16Add1Mult2, f16Add2Mult1, f16Add2Mult2);
}
2.20 MLIB_Mac4Rnd
The
MLIB_Mac4Rnd
multiplicands. The round method is the round to nearest. The function does not saturate
the output. See the following equation:
2.20.1 Available versions
This function is available in the following versions:
• Fractional output - the output is the fractional portion of the result; the result is
within the range <-1 ; 1). The result may overflow.
Freescale Semiconductor, Inc.
functions have the following declarations:
f16Add1Mult1,
f16Add2Mult2)
function is shown in the following example:
/* f16Add1Mult1 = -1.0 */
/* f16Add1Mult2 = -0.9 */
/* f16Add2Mult1 = 0.8 */
/* f16Add2Mult2 = 0.7 */
functions return the rounded sum of two products of two pairs of
Equation 18. Algorithm formula
MLIB User's Guide, Rev. 2, 10/2015
Chapter 2 Algorithms in detail
frac16_t
f16Add1Mult2,
frac16_t
49