DOUBLE PRECISION MULTIPLY MODE

cision values and accumulated using regular MAC instructions. Note that the maximum number of single times double MAC operations in this algorithm are limited to 255 since overflow may occur (the A2 register is just eight bits long). If a longer sequence is required, it should be split into sub-sequences each with no more than 255 MAC opera- tions.

R1

R0

X:

MSPi

LSPi

DP3

DP1

Y:

SPi

DP2

R5

R0

DP3_DP2_DP1 = MSPi_LSPi x SPi

move

 

#N-1,m5

 

 

clr a

 

#0,y0

 

;clear a and y0

ori

#$40,mr

 

 

;enter DP mode

move

 

x:(r1)+,x0

y:(r5)+,y1

;load LSPi and SPi

rep

#N

 

 

;0<N<256

mac

x0,y1,a

x:(r1)+,x0

y:(r5)+,y1

;LSPi*SPia

andi

#$bf,mr

 

 

;exit DP mode

move

 

a0,x:(r0)+

 

;save DP1

move

 

a1,y0

 

 

move

 

a2,a

 

 

move

 

y0,a0

 

;a2:a1a1:a0

rep

#N

 

 

 

mac

x0,y1,a

x:(r1)+,x0

y:(r5)+,y1

;load MSPi and SPi

move

a,l:(r0)+

 

 

;save DP3_DP2

Figure 3-13 Single Double Multiply-Accumulate Algorithm

3 - 18

DATA ARITHMETIC LOGIC UNIT

MOTOROLA

Page 51
Image 51
Motorola 24-Bit Digital Signal Processor, DSP56000 manual DP3 DP1, Single ⋅ Double Multiply-Accumulate Algorithm