Memory Banks
Example 6–69. Final Assembly Code for FIR Filter With Redundant Load Elimination
and No Memory Hits (Continued)
LOOP:
ADD
||
ADD
||
MPY
||
MPY
||[B2]
LDH
||[B2]
LDH
ADD
||
ADD
||
MPY
||
MPY
||[B2]
LDH
||[B2]
LDH
ADD
||
ADD
||[B2]
B
||
MPY
||
MPY
||[B2]
LDH
||[B2]
LDH
||[B2]
SUB
ADD
||
ADD
||
MPY
||
MPY
||[B2]
LDH
||[B2]
LDH
; inner loop branch occurs here
[A2]
B
||
SUB
||
SUB
||
SUB
SHR
||
SHR
STH
STH
NOP
; outer loop branch occurs here
6-130
.L2X
A1,B9,B9
.L1X
B6,A9,A9
.M2
B5,B8,B7
.M1
A5,A7,A7
.D1
*A8++[2],B6
.D2
*B4++[2],A1
.L2
B7,B9,B9
.L1
A5,A9,A9
.M1X
B5,A1,A0
.M2X
A0,B6,B6
.D1
*A4++[2],A5
.D2
*B1++[2],B5
.L2X
A7,B9,B9
.L1X
B8,A9,A9
.S1
LOOP
.M2
B0,B6,B7
.M1
A0,A1,A1
.D2
*B4++[2],A7
.D1
*A8++[2],B8
.S2
B2,1,B2
.L2
B7,B9,B9
.L1
A0,A9,A9
.M2X
A5,B8,B8
.M1X
B0,A7,A5
.D2
*B1++[2],B0
.D1
*A4++[2],A0
.S2
OUTLOOP
.L1
A4,A3,A4
.L2
B4,B10,B4
.S1
A9,A0,A9
.S1
A9,15,A9
.S2
B9,15,B9
.D1
A9,*A6++
.D1
B9,*A6++
2
; sum1 += x1 * h0
; sum0 += x1 * h1
; x0 * h3
; x3 * h2
;** h1 = h[i+1]
;** h0 = h[i]
; sum1 += x2 * h1
; sum0 += x2 * h2
;* x0 * h0
;* x1 * h1
;** x3 = x[j+i+3]
;** x0 = x[j+i+4]
; sum1 += x3 * h2
; sum0 += x3 * h3
;* branch to loop
;* x2 * h1
;* x1 * h0
;** h2 = h[i+2]
;** h3 = h[i+3]
;** decrement loop counter
; sum1 += x0 * h3
;* sum0 += x0 * h0
;* x3 * h3
;* x2 * h2
;*** x2 = x[j+i+2]
;*** x1 = x[j+i+1]
; branch to outer loop
; reset x pointer to x[j]
; reset h pointer to h[0]
; sum0 –= x0*h0 (eliminate add)
; sum0 >> 15
; sum1 >> 15
; y[j] = sum0 >> 15
; y[j+1] = sum1 >> 15
; branch delay slots
Need help?
Do you have a question about the TMS320C6000 and is the answer not in the manual?
Questions and answers