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
; R6H = A = X0 * Y0
MPYF32 R6H, R0H, R1H
; In parallel R0H = X1
|| MOV32
R0H, *XAR4++
MOV32
R1H, *XAR5++
; R1H = Y1
; R7H = B = X1 * Y1
MPYF32 R7H, R0H, R1H
; In parallel R0H = X2
|| MOV32
R0H, *XAR4++
MOV32
R1H, *XAR5++
; R1H = Y2
; R7H = A + B
; R6H = C = X2 * Y2
MACF32 R7H, R6H, R6H, R0H, R1H ; In parallel R0H = X3
|| MOV32
R0H, *XAR4++
MOV32
R1H, *XAR5++
; R1H = Y3
; R7H = (A + B) + C
; R6H = D = X3 * Y3
MACF32 R7H, R6H, R6H, R0H, R1H ; In parallel R0H = X4
||
MOV32
R0H, *XAR4
MOV32
R1H, *XAR5
; R1H = Y4
; Next MACF32 is an alias for
; MPYF32 || ADDF32
MACF32 R7H, R6H, R6H, R0H, R1H ; R6H = E = X4 * Y4
; in parallel R7H = (A + B + C) + D
NOP
; Wait for MPYF32 || ADDF32 to complete
ADDF32 R7H, R7H, R6H
; R7H = (A + B + C + D) + E
NOP
; Wait for ADDF32 to complete
MOV32
@Result, R7H
; Store the result
See also
MACF32 R3H, R2H, RdH, ReH, RfH
MACF32 R3H, R2H, RdH, ReH, RfH || MOV32 RaH, mem32
MACF32 R7H, R3H, mem32, *XAR7++
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
69
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 ...