Motorola MCF5282, MCF5281 user manual Emac Instruction Set Summary

Models: MCF5282 MCF5281

1 816
Download 816 pages 28.97 Kb
Page 122
Image 122

EMAC Instruction Set Summary

then {

MACSR.PAVx = 0

/* select the input operands */ if (sz == word)

then {if (U/Ly == 1)

then operandY[31:0] = {0x0000, Ry[31:16]} else operandY[31:0] = {0x0000, Ry[15:0]}

if (U/Lx == 1)

then operandX[31:0] = {0x0000, Rx[31:16]} else operandX[31:0] = {0x0000, Rx[15:0]}

}

else {operandY[31:0] = Ry[31:0] operandX[31:0] = Rx[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 { /* product overflow */ MACSR.PAVx = 1

MACSR.V = 1

if (inst == MSAC && MACSR.OMC == 1) then result[47:0] = 0x0000_0000_0000 else if (MACSR.OMC == 1)

then /* overflowed MAC, saturationMode enabled */

result[47:0] = 0xffff_ffff_ffff

}

/* zero-fill to 48 bits before performing any scaling */

product[47:40] = 0 /* zero-fill upper byte */

/* 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] = {0, product[39:1]} break;

}

/* combine with accumulator */ 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]

 

 

 

3-18

MCF5282 User’s Manual

MOTOROLA

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