Motorola ColdFire MCF5281 User Manual page 120

Motorola microcontroller user's manual
Table of Contents

Advertisement

EMAC Instruction Set Summary
f
/* sign-extend to 48 bits before performing any scaling */
/* scale product before combining with accumulator */
switch (SF)
{
}
if (MACSR.PAVx == 0)
/* check for accumulation overflow */
if (accumulationOverflow == 1)
/* transfer the result to the accumulator */
ACCx[47:0] = result[47:0]
}
MACSR.V = MACSR.PAVx
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.PAVx == 0)
then {
MACSR.PAVx = 0
3-16
}
product[47:40] = {8{product[39]}}
/* 2-bit scale factor */
case 0:
/* no scaling specified */
break;
case 1:
/* SF = "<< 1" */
product[40:0] = {product[39:0], 0}
break;
case 2:
/* reserved encoding */
break;
case 3:
/* SF = ">> 1" */
product[39:0] = {product[39], product[39:1]}
break;
then {if (inst == MSAC)
then result[47:0] = ACCx[47:0] - product[47:0]
else result[47:0] = ACCx[47:0] + product[47:0]
}
then {MACSR.PAVx = 1
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 */
MCF5282 User's Manual
/* sign-extend */
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfire mcf5282

Table of Contents