Floating-Point Compare

Compare two floating-point values and make the outcome available to later instructions.

Floating Point

Semantics

Where the answer goes is the interesting part: condition flags, a condition-register field, or an ordinary integer register. NaN handling also differs, since an unordered result is neither less, equal, nor greater.

Architecture Instructions Expressed as How this architecture does it
x86 one instruction The result lands in ZF, PF and CF in EFLAGS, with PF marking the unordered NaN case. UCOMISS signals an exception only for signalling NaNs; COMISS signals for quiet ones too.
ARM one instruction Sets the NZCV condition flags, consumed by a following B.cond, CSEL or CSET. One comparison is live at a time, since there is a single flag set.
RISC-V one instruction There are no condition flags anywhere in the architecture, so each comparison writes 0 or 1 into an integer register. That means three separate instructions instead of one compare plus a condition code, and it is the same design choice that removes the carry flag: no hidden state between instructions.
PowerISA one instruction Writes a four-bit result into one of eight Condition Register fields, named by the instruction. Several comparisons can therefore be in flight in different CR fields at once, which is unusual among these four.