DOUBLE PRECISION MULTIPLY MODE

one instruction cycle. The ANDI instruction clears the DM mode bit, but, due to the instruction execution pipeline, the Data ALU leaves the mode after one instruction cycle.

The double precision multiply algorithm uses the Y0 register at all stages. If the use of the Data ALU is required in an interrupt service routine, Y0 should be saved together with other Data ALU registers to be used, and should be restored before leaving the interrupt routine.

If just single precision times double precision multiply is desired, two of the multiply oper- ations may be deleted and replaced by suitable initialization and clearing of the accumu- lator and Y0. Figure 3-12shows the single precision times double precision algorithm.

R1

R0

X:

MSP1

LSP1

DP3

DP1

Y:

SP

DP2

R5

R0

DP3_DP2_DP1 = MSP1_LSP1 x SP

clr a

 

#0,y0

 

;clear a and y0

ori

#$40,mr

 

 

;enter DP mode

move

 

x:(r1)+,x0

y:(r5)+,y1

;load LSP1 and SP

mac

x0,y1,a

x:(r1)+,x1

 

;LSP1*SPa,

 

 

 

 

;load MSP1

mac

y1,x1,a

a0,x:(r0)+

 

;shifted(a)+

 

 

 

 

; SP*MSP1a,

 

 

 

 

;save DP1

move a,l:(r0)+ andi #$bf,mr non-Data ALU operation

;save DP3_DP2 ;exit DP mode ;pipeline delay

Figure 3-12 Single Double Multiply Algorithm

Figure 3-13shows a single precision times double precision multiply-accumulate algo- rithm. First, the least significant parts of the double precision values are multiplied by the single precision values and accumulated in the “Double Precision Multiply” mode. Then the DM bit is cleared and the least significant part of the result is saved to memory. The most significant parts of the double precision values are then multiplied by the single pre-

MOTOROLA

DATA ARITHMETIC LOGIC UNIT

3 - 17

Page 50
Image 50
Motorola DSP56000, 24-Bit Digital Signal Processor manual MSP1 LSP1 DP3 DP1 DP2, Single ⋅ Double Multiply Algorithm