Single Assignment vs. Multiple Assignment
7-4
Example 7–2. Code Using Single Assignment
cycle
1
SUB
.S1
A4,A5,A1
; writes to A1 in single cycle
2
LDW
.D1
*A0,A6
; writes to A1 after 4 delay slots
3
NOP
4
ADD
.L1
A1,A2,A3
; uses old A1 (result of SUB)
5–6 NOP
2
7
MPY
.M1
A6,A4,A5
; uses new A1 (result of LDW)
Both examples involve exactly the same schedule of instructions. The only dif-
ference is the register allocation. The single assignment register allocation, as
shown in Example 7–2, can result in higher register pressure (Example 7–2
uses one more register than Example 7–1).
The next section describes how to generate interruptible and non-interruptible
code with the ’C6000 code generation tools.