Outer Loop Conditionally Executed With Inner Loop
6-148
Example 6–78. Final Assembly Code for FIR Filter (Continued)
LOOP:
[!A2]
SHR
.S1
A10,15,A12
; (Asum0 >> 15)
||[B0]
SUB
.S2
B0,1,B0
; dec outer lp cntr
||
MPYH
.M2
B7,B9,B13
; p03 = h[i+3]*x[j+i+3]
||[A2]
ADD
.L1
A7,A10,A7
; sum0(p00) = p00 + sum0
||
MPYHL
.M1X
B7,A11,A10
; p13 = h[i+3]*x[j+i+4]
||
ADD
.L2X
A14,B4,B7
; sum1 += p11
||
LDW
.D2
*B2++[2],B7
;* h[i+2] & h[i+3]
||
LDW
.D1
*A0++[2],A8
;* h[i+0] & h[i+1]
ADD
.L1
A10,A7,A13
; sum0 += p01
||
MPYHL
.M2X
A9,B10,B12
; p15 = h[i+5]*x[j+i+6]
||
MPYLH
.M1
A9,A11,A10
; p14 = h[i+4]*x[j+i+5]
||
ADD
.L2
B13,B7,B7
; sum1 += p12
||
LDW
.D2
*B1++[2],A11
;* x[j+i+4] & x[j+i+5]
||
LDW
.D1
*A4++[2],B10
;* x[j+i+6] & x[j+i+7]
||[A1]
SUB
.S1
A1,1,A1
;* dec pointer reset lp cntr
[B0]
B
.S2
LOOP
; Branch outer loop
||
MPY
.M1
A9,A11,A11
; p04 = h[i+4]*x[j+i+4]
||
ADD
.L1X
B9,A13,A13
; sum0 += p02
||
MPYLH
.M2
B8,B10,B13
; p16 = h[i+6]*x[j+i+7]
||
ADD
.L2X
A10,B7,B7
; sum1 += p13
||
LDW
.D1
*A0++[2],A9
;* h[i+4] & h[i+5]
||
LDW
.D2
*B2++[2],B8
;* h[i+6] & h[i+7]
||[!A1]
SUB
.S1
A4,A3,A4
;* reset x ptr
MPY
.M2
B8,B10,B11
; p06 = h[i+6]*x[j+i+6]
||
MPYH
.M1
A9,A11,A11
; p05 = h[i+5]*x[j+i+5]
||
ADD
.L1X
B13,A13,A9
; sum0 += p03
||
ADD
.L2X
A10,B7,B7
; sum1 += p14
||[!A1]
SUB
.S2
B1,B14,B1
;* reset x ptr
||[!A1]
SUB
.S1
A0,A5,A0
;* reset h ptr
||
LDH
.D2
*B1,A8
;* x[j+i+8]
[!A2]
MVK
.S1
4,A2
; reset store lp cntr
||
MPYH
.M2
B8,B10,B13
; p07 = h[i+7]*x[j+i+7]
||
ADD
.L1
A11,A9,A9
; sum0 += p04
||
MPYHL
.M1X
B8,A8,A9
; p17 = h[i+7]*x[j+i+8]
||
ADD
.S2
B12,B7,B10
; sum1 += p15
||[!A2]
STH
.D2
B11,*B6++[2]
; y[j+1] = (Bsum1 >> 15)
||[!A2]
STH
.D1
A12,*A6++[2]
; y[j] = (Asum0 >> 15)
||
ADD
.L2X
A10,0,B8
;* move to other reg file
ADD
.L1
A11,A9,A12
; sum0 += p05
||
ADD
.L2
B13,B10,B8
; sum1 += p16
||
MPYLH
.M2X
A8,B8,B4
;* p10 = h[i+0]*x[j+i+1]
||[!A1]
MVK
.S1
4,A1
;* reset pointer reset lp cntr
||[!A1]
SUB
.S2
B2,B5,B2
;* reset h ptr
||
MPYHL
.M1X
A8,B9,A14
;* p11 = h[i+1]*x[j+i+2]