Using Word Access for Short Data and Doubleword Access for Floating-Point Data
6-24
Figure 6–7. Dependency Graph of Fixed-Point Dot Product With LDW (Showing
Functional Units)
pi+1
2
ADD
sum1
1
.M2X
.L2
B side
A side
LDW
LDW
bi & bi+1
ai & ai+1
pi
5
5
5
5
2
ADD
SUB
sum0
cntr
LOOP
1
B
MPYH
MPY
1
1
.D1
.D2
.M1X
.L1
.S1
.S2
Example 6–17. Linear Assembly for Fixed-Point Dot Product Inner Loop With LDW
(With Allocated Resources)
LDW
.D1
*A4++,A2
; load ai and ai+1 from memory
LDW
.D2
*B4++,B2
; load bi and bi+1 from memory
MPY
.M1X
A2,B2,A6
; ai * bi
MPYH
.M2X
A2,B2,B6
; ai+1 * bi+1
ADD
.L1
A6,A7,A7
; sum0 += (ai * bi)
ADD
.L2
B6,B7,B7
; sum1 += (ai+1 * bi+1)
SUB
.S1
A1,1,A1
; decrement loop counter
[A1] B
.S2
LOOP
; branch to loop