SPRUJ53B April 2024 – September 2024 TMS320F28P550SJ , TMS320F28P559SJ-Q1
32-Bit Floating-Point Multiply with Parallel Move
MRd | CLA floating-point destination register for MMPYF32 (MR0 to MR3) MRd cannot be the same register as MRa |
MRe | CLA floating-point source register for MMPYF32 (MR0 to MR3) |
MRf | CLA floating-point source register for MMPYF32 (MR0 to MR3) |
MRa | CLA floating-point destination register for 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 of MMOV32. |
LSW: mmmm mmmm mmmm mmmm
MSW: 0000 ffee ddaa addr
Multiply the contents of two floating-point registers and load another.
MRd = MRe * MRf;
MRa = [mem32];
The destination register for the MMPYF32 and the MMOV32 must be unique. That is, MRa cannot be the same register as MRd.
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; }
Both MMPYF32 and MMOV32 complete in a single cycle.
; Given M1, X1, and B1 are 32-bit floating point
; Calculate Y1 = M1*X1+B1
;
_Cla1Task1:
MMOV32 MR0, @M1 ; Load MR0 with M1
MMOV32 MR1, @X1 ; Load MR1 with X1
MMPYF32 MR1, MR1, MR0 ; Multiply M1*X1
|| MMOV32 MR0, @B1 ; and in parallel load MR0 with B1
MADDF32 MR1, MR1, MR0 ; Add M*X1 to B1 and store in MR1
MMOV32 @Y1, MR1 ; Store the result
MSTOP ; end of task
; 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
MMPYF32 MR1, MR1, MR0 ; Multiply (A*B) by C
|| MMOV32 @Y2, MR1 ; and in parallel store A*B
MMOV32 @Y3, MR1 ; Store the result
MSTOP ; end of task