Freescale Semiconductor MCF54455 Reference Manual page 141

Table of Contents

Advertisement

Enhanced Multiply-Accumulate Unit (EMAC)
}
/* sign-extend to 48 bits before performing any scaling */
/* scale product before combining with accumulator */
switch (SF)
{
case 0:
case 1:
case 2:
case 3:
}
if (MACSR.PAVn == 0)
then {if (inst == MSAC)
}
/* check for accumulation overflow */
if (accumulationOverflow == 1)
then {MACSR.PAVn = 1
}
/* transfer the result to the accumulator */
ACCx[47:0] = result[47:0]
}
MACSR.V = MACSR.PAVn
MACSR.N = ACCx[47]
if (ACCx[47:0] == 0x0000_0000_0000)
then MACSR.Z = 1
else MACSR.Z = 0
if ((ACCx[47:31] == 0x0000_0) || (ACCx[47:31] == 0xffff_1))
then MACSR.EV = 0
else MACSR.EV = 1
break;
case 1,3:
if (MACSR.OMC == 0 || MACSR.PAVn == 0)
5-17
else if (MACSR.OMC == 1)
then /* overflowed MAC,
saturationMode enabled */
if (product[63] == 1)
then result[47:0] = 0xffff_8000_0000
else result[47:0] = 0x0000_7fff_ffff
product[47:40] = {8{product[39]}}
/* 2-bit scale factor */
/* no scaling specified */
break;
/* SF = "<< 1" */
product[40:0] = {product[39:0], 0}
break;
/* reserved encoding */
break;
/* SF = ">> 1" */
product[39:0] = {product[39], product[39:1]}
break;
then result[47:0] = ACCx[47:0] - product[47:0]
else result[47:0] = ACCx[47:0] + product[47:0]
MACSR.V = 1
if (MACSR.OMC == 1)
then /* accumulation overflow,
saturationMode enabled */
if (result[47] == 1)
then result[47:0] = 0x0000_7fff_ffff
else result[47:0] = 0xffff_8000_0000
/* signed fractionals */
/* sign-extend */
Freescale Semiconductor

Advertisement

Table of Contents
loading

Table of Contents