Motorola MCF5282, MCF5281 user manual Emac Instruction Set Summary

Models: MCF5282 MCF5281

1 816
Download 816 pages 28.97 Kb
Page 120
Image 120

EMAC Instruction Set Summary

f

}

/* sign-extend to 48 bits before performing any scaling */

product[47:40] = {8{product[39]}}

/* sign-extend */

/* scale product before combining with accumulator */

switch (SF) /* 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;

}

if (MACSR.PAVx == 0) then {if (inst == MSAC)

then result[47:0] = ACCx[47:0] - product[47:0] else result[47:0] = ACCx[47:0] + product[47:0]

}

/* check for accumulation overflow */ if (accumulationOverflow == 1)

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

}

/* 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:/* signed fractionals */ if (MACSR.OMC == 0 MACSR.PAVx == 0)

then {

MACSR.PAVx = 0

3-16

MCF5282 User’s Manual

MOTOROLA

Page 120
Image 120
Motorola MCF5282, MCF5281 user manual Emac Instruction Set Summary