www.ti.com
Instructions
Example
;
Perform 5 multiply and accumulate operations:
;
;
1ST multiply: A = X0 * Y0
;
2nd multiply: B = X1 * Y1
;
3rd multiply: C = X2 * Y2
;
4TH multiply: D = X3 * Y3
;
5th multiply: E = X3 * Y3
;
;
Result = A + B + C + D + E
MOV32
R0H, *XAR4++
; R0H = X0
MOV32
R1H, *XAR5++
; R1H = Y0
; R2H = A = X0 * Y0
MPYF32 R2H, R0H, R1H
; In parallel R0H = X1
|| MOV32
R0H, *XAR4++
MOV32
R1H, *XAR5++
; R1H = Y1
; R3H = B = X1 * Y1
MPYF32 R3H, R0H, R1H
; In parallel R0H = X2
|| MOV32
R0H, *XAR4++
MOV32
R1H, *XAR5++
; R1H = Y2
; R3H = A + B
; R2H = C = X2 * Y2
MACF32 R3H, R2H, R2H, R0H, R1H ; In parallel R0H = X3
|| MOV32
R0H, *XAR4++
MOV32
R1H, *XAR5++
; R1H = Y3
; R3H = (A + B) + C
; R2H = D = X3 * Y3
MACF32 R3H, R2H, R2H, R0H, R1H ; In parallel R0H = X4
||
MOV32
R0H, *XAR4
MOV32
R1H, *XAR5
; R1H = Y4
; R2H = E = X4 * Y4
MPYF32 R2H, R0H, R1H
; in parallel R3H = (A + B + C) + D
|| ADDF32 R3H, R3H, R2H
NOP
; Wait for MPYF32 || ADDF32 to complete
ADDF32 R3H, R3H, R2H
; R3H = (A + B + C + D) + E
NOP
; Wait for ADDF32 to complete
MOV32
@Result, R3H
; Store the result
See also
MACF32 R3H, R2H, RdH, ReH, RfH
MACF32 R7H, R3H, mem32, *XAR7++
MACF32 R7H, R6H, RdH, ReH, RfH
MACF32 R7H, R6H, RdH, ReH, RfH || MOV32 RaH, mem32
MPYF32 RaH, RbH, RcH || ADDF32 RdH, ReH, RfH
SPRUEO2A – June 2007 – Revised August 2008
Instruction Set
65
Summary of Contents for TMS320C28 series
Page 2: ...2 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 12: ...Introduction 12 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 20: ...CPU Register Set 20 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 136: ...Instruction Set 136 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...