SPRUI33H November 2015 – June 2024 TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1
32-Bit Floating-Point Absolute Value
MRa | CLA floating-point destination register (MR0 to MR3) |
MRb | CLA floating-point source register (MR0 to MR3) |
LSW: 0000 0000 0000 bbaa
MSW: 0111 1110 0010 0000
The absolute value of MRb is loaded into MRa. Only the sign bit of the operand is modified by the MABSF32 instruction.
if (MRb < 0) {MRa = -MRb};
else {MRa = MRb};
This instruction modifies the following flags in the MSTF register:
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | Yes | Yes | No | No |
The MSTF register flags are modified as follows:
NF = 0;
ZF = 0;
if ( MRa(30:23) == 0) ZF = 1;
This is a single-cycle instruction.
MMOVIZ MR0, #-2.0 ; MR0 = -2.0 (0xC0000000)
MABSF32 MR0, MR0 ; MR0 = 2.0 (0x40000000), ZF = NF = 0
MMOVIZ MR0, #5.0 ; MR0 = 5.0 (0x40A00000)
MABSF32 MR0, MR0 ; MR0 = 5.0 (0x40A00000), ZF = NF = 0
MMOVIZ MR0, #0.0 ; MR0 = 0.0
MABSF32 MR0, MR0 ; MR0 = 0.0 ZF = 1, NF = 0