dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 420

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
This next version makes use of software loop avoiding the hardware nested looping
B-24
; THE MACR DOES THE FINAL ACCUMULATION WITH ROUNDING FOR FRACTIONAL RESULTS
; FOR INTEGER ELEMENTS, THE FOLLOWING 3 INSTRUCTIONS WILL REPLACE: MACR & MOVE ABOVE
;
;
;
Traverse_B_columns_1:
Traverse_A_rows_1:
;
;
;
; This algorithm utilizes software outer loop avoiding nesting and saving LC,LA regs.
; The main assumption: no hardware nesting loops active when function is called.
Traverse_A_rows_2:
; FOR FRACTIONAL ELEMENTS, THE FOLLOWING TWO INSTRUCTIONS ARE REQUIRED
; THE MACR DOES THE FINAL ACCUMULATION WITH ROUNDING FOR FRACTIONAL RESULTS
MACR Y0,X0,A
MOVE A,X:(R2)+
MAC
ASR
MOVE A0,X:(R2)+
POP
POP
ADD
MOVE #B_Matrx11,R1
opt
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVES N,X:RowsCnt
DO
MOVE
MOVE
CLR
MOVE
REP
MAC
MACR
MOVE
Y0,X0,A
A
LA
LC
B1,Y1
Total:
cc
#A_Matrx11,R3
R3,Y1
#B_Matrx11,R0
R0,R1
#C_Matrx11,R2
#ROW_SIZE11,B
B,N
N,Traverse_B_columns_2
Y1,R3
R1,R0
A
#ROW_SIZE11-1
Y0,X0,A
Y0,X0,A
A,X:(R2)+
Words:
31
X:(R0)+N,Y0
X:(R0)+N,Y0
DSP56800 Family Manual
X:(R1)+,X0
X:(R1)+,X0
Cycles:
((N+8)N+12)N+14 = N
X:(R3)+,X0
X:(R3)+,X0
X:(R1)+,X0
; 1
; 1
; -
; -
; -
; 1
; 1
; 1
; 2
__________
; 2
; 1
; 2
; 1
; 2
; 1
; 1
; 1
; 2
; 1
; 1
; 1
; 1
; 1
; 1
; 1
; 1
1
1
-
-
-
1
1
1
2
3
2
1
2
1
2
1
1
1
3
1
1
1
1
3
1
1
1
+8N
2
point to A[1,1]
save pntr to A[1,1]
point to B[1,1]
save pntr to B[1,1]
point to C[1,1] (result)
number of rows (N x N)
number of repetitions N
number of A rows to do
compute a row in C
1st element in A row
1st element in B column
clr sum, get elemnt in A
element in B, next B row
sum products except last
traverse B rows, A col
last sum, next col in R1
save result in C row
last sum, next col in R1
save result in C row
last sum, no rounding
convert to integer in A0
save integer result
restore LA, outer loop
restore LC, outer loop
for traverse next A row
point to B[1,1]
+12N+13
Freescale Semiconductor
.

Related parts for dsp56800