Translating C Code To Linear Assembly (Inner Loop) - Texas Instruments TMS320C6000 Programmer's Manual

Hide thumbs Also See for TMS320C6000:
Table of Contents

Advertisement

6.14.2 Translating C Code to Linear Assembly (Inner Loop)

Example 6–73. Linear Assembly for Unrolled FIR Inner Loop
LDH
LDH
MPY
MPY
ADD
ADD
LDH
LDH
MPY
MPY
ADD
ADD
LDH
LDH
MPY
MPY
ADD
ADD
LDH
LDH
MPY
MPY
ADD
ADD
[cntr] SUB
[cntr] B
Example 6–73 shows a list of linear assembly for the inner loop of the FIR filter
C code (identical to Example 6–67 on page 6-123).
*x++,x1
*h++,h0
x0,h0,p00
x1,h0,p10
p00,sum0,sum0
p10,sum1,sum1
*x++,x2
*h++,h1
x1,h1,p01
x2,h1,p11
p01,sum0,sum0
p11,sum1,sum1
*x++,x3
*h++,h2
x2,h2,p02
x3,h2,p12
p02,sum0,sum0
p12,sum1,sum1
*x++,x0
*h++,h3
x3,h3,p03
x0,h3,p13
p03,sum0,sum0
p13,sum1,sum1
cntr,1,cntr
LOOP
Outer Loop Conditionally Executed With Inner Loop
; x1 = x[j+i+1]
; h0 = h[i]
; x0 * h0
; x1 * h0
; sum0 += x0 * h0
; sum1 += x1 * h0
; x2 = x[j+i+2]
; h1 = h[i+1]
; x1 * h1
; x2 * h1
; sum0 += x1 * h1
; sum1 += x2 * h1
; x3 = x[j+i+3]
; h2 = h[i+2]
; x2 * h2
; x3 * h2
; sum0 += x2 * h2
; sum1 += x3 * h2
; x0 = x[j+i+4]
; h3 = h[i+3]
; x3 * h3
; x0 * h3
; sum0 += x3 * h3
; sum1 += x0 * h3
; decrement loop counter
; branch to loop
Optimizing Assembly Code via Linear Assembly
6-137

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C6000 and is the answer not in the manual?

Questions and answers

Table of Contents