Freescale Semiconductor MCF5329 Reference Manual page 124

Devices supported: mcf5327; mcf5328; mcf53281; mcf5329
Table of Contents

Advertisement

Enhanced Multiply-Accumulate Unit (EMAC)
}
else {operandY[31:0] = Ry[31:0]
}
/* perform the multiply */
product[63:0] = operandY[31:0] * operandX[31:0]
/* check for product overflow */
if (product[63:40] != 0x0000_00)
then {
}
/* zero-fill to 48 bits before performing any scaling */
/* scale product before combining with accumulator */
switch (SF)
{
case 0:
case 1:
case 2:
case 3:
}
/* combine with accumulator */
if (MACSR.PAVn == 0)
then {if (inst == MSAC)
}
/* check for accumulation overflow */
if (accumulationOverflow == 1)
then {MACSR.PAVn = 1
4-18
then operandX[31:0] = {0x0000, Rx[31:16]}
else operandX[31:0] = {0x0000, Rx[15:0]}
operandX[31:0] = Rx[31:0]
/* product overflow */
MACSR.PAVn = 1
MACSR.V = 1
if (inst == MSAC and and
then result[47:0] = 0x0000_0000_0000
else if (MACSR.OMC == 1)
then /* overflowed MAC,
saturationMode enabled */
result[47:0] = 0xffff_ffff_ffff
product[47:40] = 0
/* 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] = {0, 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 (inst == MSAC and and
then result[47:0] = 0x0000_0000_0000
else if (MACSR.OMC == 1)
then /* overflowed MAC,
saturationMode enabled */
MCF5329 Reference Manual, Rev 3
MACSR.OMC == 1)
/* zero-fill upper byte */
MACSR.OMC == 1)
Freescale Semiconductor

Advertisement

Table of Contents
loading

Table of Contents