Motorola ColdFire MCF5281 User Manual page 121

Motorola microcontroller user's manual
Table of Contents

Advertisement

if (sz == word)
/* perform the multiply */
product[63:0] = (operandY[31:0] * operandX[31:0]) << 1
/* check for product rounding */
if (MACSR.R/T == 1)
/* sign-extend to 48 bits and combine with accumulator */
/* check for the -1 * -1 overflow case */
if ((operandY[31:0] == 0x8000_0000) && (operandX[31:0] == 0x8000_0000))
if (inst == MSAC)
/* 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:39] == 0x00_0) || (ACCx[47:39] == 0xff_1))
then MACSR.EV = 0
else MACSR.EV = 1
break;
case 2:
if (MACSR.OMC == 0 || MACSR.PAVx == 0)
MOTOROLA
then {if (U/Ly == 1)
then operandY[31:0] = {Ry[31:16], 0x0000}
else operandY[31:0] = {Ry[15:0],
if (U/Lx == 1)
then operandX[31:0] = {Rx[31:16], 0x0000}
else operandX[31:0] = {Rx[15:0],
}
else {operandY[31:0] = Ry[31:0]
operandX[31:0] = Rx[31:0]
}
then { /* perform convergent rounding */
if (product[23:0] > 0x80_0000)
then product[63:24] = product[63:24] + 1
else if ((product[23:0] == 0x80_0000) && (product[24] == 1))
then product[63:24] = product[63:24] + 1
}
then product[71:64] = 0x00
else product[71:64] = {8{product[63]}}
then result[47:0] = ACCx[47:0] - product[71:24]
else result[47:0] = ACCx[47:0] + product[71:24]
then {MACSR.PAVx = 1
MACSR.V = 1
if (MACSR.OMC == 1)
then /* accumulation overflow,
saturationMode enabled */
if (result[47] == 1)
then result[47:0] = 0x007f_ffff_ff00
else result[47:0] = 0xff80_0000_0000
}
/* unsigned integers */
Chapter 3. Enhanced Multiply-Accumulate Unit (EMAC)
EMAC Instruction Set Summary
0x0000}
0x0000}
/* zero-fill */
/* sign-extend */
3-17

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfire mcf5282

Table of Contents