6.4. VFP and condition codes

You can use a condition code to control the execution of any VFP instruction. The instruction is executed conditionally, according to the status flags in the CPSR, in exactly the same way as almost all other ARM instructions.

The only VFP instruction that can be used to update the status flags is FCMP. It does not update the flags in the CPSR directly, but updates a separate set of flags in the FPSCR, see FPSCR, the floating-point status and control register.

Note

To use these flags to control conditional instructions, including conditional VFP instructions, you must first copy them into the CPSR using an FMSTAT instruction, see FMRX, FMXR, and FMSTAT.

Following an FCMP instruction, the precise meanings of the flags are different from their meanings following an ARM data-processing instruction. This is because:

The meanings of the condition code mnemonics are shown in Table 6.2.

Table 6.2. Condition codes

MnemonicMeaning after ARM data processing instructionMeaning after VFP FCMP instruction
EQEqualEqual
NENot equalNot equal, or unordered
CS / HSCarry set / Unsigned higher or sameGreater than or equal, or unordered
CC / LOCarry clear / Unsigned lowerLess than
MINegativeLess than
PLPositive or zeroGreater than or equal, or unordered
VSOverflowUnordered (at least one NaN operand)
VCNo overflowNot unordered
HIUnsigned higherGreater than, or unordered
LSUnsigned lower or sameLess than or equal
GESigned greater than or equalGreater than or equal
LTSigned less thanLess than, or unordered
GTSigned greater thanGreater than
LESigned less than or equalLess than or equal, or unordered
ALAlways (normally omitted)Always (normally omitted)

Note

The type of the instruction that last updated the flags in the CPSR determines the meaning of condition codes.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0231B
Non-Confidential