SPRUHM9H October 2014 – May 2024 TMS320F28075 , TMS320F28075-Q1 , TMS320F28076
32-Bit Floating-Point Addition with Parallel Move
MRd | CLA floating-point destination register for the MADDF32 (MR0 to MR3). MRd cannot be the same register as MRa. |
MRe | CLA floating-point source register for the MADDF32 (MR0 to MR3) |
MRf | CLA floating-point source register for the MADDF32 (MR0 to MR3) |
MRa | CLA floating-point destination register for the MMOV32 (MR0 to MR3). MRa cannot be the same register as MRd. |
mem32 | 32-bit memory location accessed using one of the available addressing modes. This is the source for the MMOV32. |
LSW: mmmm mmmm mmmm mmmm
MSW: 0001 ffee ddaa addr
Perform an MADDF32 and a MMOV32 operation in parallel. Add MRf to the contents of MRe and store the result in MRd. In parallel move the contents of the 32-bit location mem32 to MRa.
MRd = MRe + MRf;
MRa = [mem32];
The destination register for the MADDF32 and the MMOV32 must be unique. That is, MRa and MRd cannot be the same register.
This instruction modifies the following flags in the MSTF register:
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | Yes | Yes | Yes | Yes |
The MSTF register flags are modified as follows:
The MMOV32 Instruction sets the NF and ZF flags as follows:
NF = MRa(31);
ZF = 0;
if(MRa(30:23) == 0) { ZF = 1; NF = 0; };
The MADDF32 and the MMOV32 both complete in a single cycle.
; Given A, B, and C are 32-bit floating-point numbers
; Calculate Y1 = A + 4B
; Y2 = A + C
;
_Cla1Task1:
MMOV32 MR0, @A ; Load MR0 with A
MMOV32 MR1, @B ; Load MR1 with B
MMPYF32 MR1, MR1, #4.0 ; Multiply 4 * B
|| MMOV32 MR2, @C and in parallel load C
MADDF32 MR3, MR0, MR1 ; Add A + 4B
MADDF32 MR3, MR0, MR2 ; Add A + C
|| MMOV32 @Y1, MR3 ; and in parallel store A+4B
MMOV32 @Y2, MR3 ; store A + C MSTOP
; end of task
; Given A, B, and C are 32-bit floating-point numbers
; Calculate Y3 = (A + B)
; Y4 = (A + B) * C
;
_Cla1Task2:
MMOV32 MR0, @A ; Load MR0 with A
MMOV32 MR1, @B ; Load MR1 with B
MADDF32 MR1, MR1, MR0 ; Add A+B
|| MMOV32 MR0, @C ; and in parallel load MR0 with C
MMPYF32 MR1, MR1, MR0 ; Multiply (A+B) by C
|| MMOV32 @Y3, MR1 ; and in parallel store A+B
MMOV32 @Y4, MR1 ; Store the (A+B) * C
MSTOP ; end of task