Live-Too-Long Issues
6-102
6.10.2 Translating C Code to Linear Assembly
Example 6–57 shows the assembly instructions that execute the inner loop in
Example 6–56.
Example 6–57. Linear Assembly for Live-Too-Long Inner Loop
LDH
*aptr++,ai
; load ai from memory
LDH
*bptr++,bi
; load bi from memory
MPY
ai,c,a0
; a0 = ai * c
SHR
a0,15,a1
; a1 = a0 >> 15
MPY
a1,d,a2
; a2 = a1 * d
ADD
a2,a0,a3
; a3 = a2 + a0
ADD
sum0,a3,sum0
; sum0 += a3
MPY
bi,c,b0
; b0 = bi * c
SHR
b0,15,b1
; b1 = b0 >> 15
MPY
b1,e,b2
; b2 = b1 * e
ADD
b2,b0,b3
; b3 = b2 + b0
ADD
sum1,b3,sum1
; sum1 += b3
[cntr]SUB
cntr,1,cntr
; decrement loop counter
[cntr]B
LOOP
; branch to loop
6.10.3 Drawing a Dependency Graph
Figure 6–19 shows the dependency graph for the live-too-long code. This
algorithm includes three separate and independent graphs. Two of the inde-
pendent graphs have split-join paths: from a0 to a3 and from b0 to b3.