SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
32-Bit Floating-Point Addition with Parallel Move
MRd | CLA floating-point destination register for the MADDF32 (MR0 to MR3) |
MRe | CLA floating-point source register for the MADDF32 (MR0 to MR3) |
MRf | CLA floating-point source register for the MADDF32 (MR0 to MR3) |
mem32 | 32-bit memory location accessed using one of the available addressing modes. This is the destination of the MMOV32. |
MRa | CLA floating-point source register for the MMOV32 (MR0 to MR3) |
LSW: mmmm mmmm mmmm mmmm
MSW: 0101 ffee ddaa addr
Perform an MADDF32 and a MMOV32 in parallel. Add MRf to the contents of MRe and store the result in MRd. In parallel move the contents of MRa to the 32-bit location mem32.
MRd = MRe + MRf;
[mem32] = MRa;
This instruction modifies the following flags in the MSTF register:
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | No | No | Yes | Yes |
The MSTF register flags are modified as follows:
Both MADDF32 and MMOV32 complete in a single cycle.
; Given A, B, and C are 32-bit floating-point numbers
; Calculate Y2 = (A * B)
; Y3 = (A * B) + C
;
_Cla1Task2:
MMOV32 MR0, @_A ; Load MR0 with A
MMOV32 MR1, @_B ; Load MR1 with B
MMPYF32 MR1, MR1, MR0 ; Multiply A*B
|| MMOV32 MR0, @_C ; and in parallel load MR0 with C
MADDF32 MR1, MR1, MR0 ; Add (A*B) to C
|| MMOV32 @_Y2, MR1 ; and in parallel store A*B
MMOV32 @_Y3, MR1 ; Store the A*B + C
MSTOP ; end of task