Translating C Code To Linear Assembly - Texas Instruments TMS320C6000 Programmer's Manual

Hide thumbs Also See for TMS320C6000:
Table of Contents

Advertisement

Redundant Load Elimination

6.11.2 Translating C Code to Linear Assembly

Example 6–62. Linear Assembly for FIR Inner Loop
LDH
LDH
MPY
MPY
ADD
ADD
LDH
LDH
MPY
MPY
ADD
ADD
[ctr]
SUB
[ctr]
B
6-112
Example 6–62 shows the linear assembly that perform the inner loop of the
FIR filter C code.
Element x0 is read by the MPY p00 before it is loaded by the LDH x0 instruc-
tion; x[j] (the first x0) is loaded outside the loop, but successive even elements
are loaded inside the loop.
.D2
*x_1++[2],x1
.D1
*h++[2],h0
.M1
x0,h0,p00
.M1X
x1,h0,p10
.L1
p00,sum0,sum0
.L2X
p10,sum1,sum1
.D1
*x++[2],x0
.D2
*h_1++[2],h1
.M2
x1,h1,p01
.M2X
x0,h1,p11
.L1X
p01,sum0,sum0
.L2
p11,sum1,sum1
.S2
ctr,1,ctr
.S2
LOOP
; x1 = x[j+i+1]
; h0 = h[i]
; x0 * h0
; x1 * h0
; sum0 += x0 * h0
; sum1 += x1 * h0
; x0 = x[j+i+2]
; h1 = h[i+1]
; x1 * h1
; x0 * h1
; sum0 += x1 * h1
; sum1 += x0 * h1
; decrement loop counter
; branch to loop

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