SPRUHM8K December 2013 – May 2024 TMS320F28374D , TMS320F28375D , TMS320F28376D , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28378D , TMS320F28379D , TMS320F28379D-Q1
Conditional 32-Bit Move
MRa | CLA floating-point destination register (MR0 to MR3) |
mem32 | 32-bit memory location accessed using one of the available addressing modes |
CNDF | Optional condition |
LSW: mmmm mmmm mmmm mmmm
MSW: 0111 00cn dfaa addr
If the condition is true, then move the 32-bit value referenced by mem32 to the floating-point register indicated by MRa.
if (CNDF == TRUE) MRa = [mem32];
CNDF is one of the following conditions:
Encode(1) | CNDF | Description | MSTF Flags Tested |
---|---|---|---|
0000 | NEQ | Not equal to zero | ZF == 0 |
0001 | EQ | Equal to zero | ZF == 1 |
0010 | GT | Greater than zero | ZF == 0 AND NF == 0 |
0011 | GEQ | Greater than or equal to zero | NF == 0 |
0100 | LT | Less than zero | NF == 1 |
0101 | LEQ | Less than or equal to zero | ZF == 1 OR NF == 1 |
1010 | TF | Test flag set | TF == 1 |
1011 | NTF | Test flag not set | TF == 0 |
1100 | LU | Latched underflow | LUF == 1 |
1101 | LV | Latched overflow | LVF == 1 |
1110 | UNC | Unconditional | None |
1111 | UNCF(2) | Unconditional with flag modification | None |
This instruction modifies the following flags in the MSTF register:
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | Yes | Yes | No | No |
if(CNDF == UNCF)
{
NF = MRa(31);
ZF = 0;
if(MRa(30:23) == 0) { ZF = 1; NF = 0; }
}
else No flags modified;
This is a single-cycle instruction.
; Given A, B, X, M1 and M2 are 32-bit floating-point numbers
;
; if(A == B) calculate Y = X*M1
; if(A! = B) calculate Y = X*M2
;
_Cla1Task5:
MMOV32 MR0, @_A
MMOV32 MR1, @_B
MCMPF32 MR0, MR1
MMOV32 MR2, @_M1, EQ ; if A == B, MR2 = M1
; Y = M1*X
MMOV32 MR2, @_M2, NEQ ; if A! = B, MR2 = M2
; Y = M2*X
MMOV32 MR3, @_X
MMPYF32 MR3, MR2, MR3 ; Calculate Y
MMOV32 @_Y, MR3 ; Store Y
MSTOP ; end of task