ucomiss - unordered compare scalar singles (32 bit floating point)

set eflags based on 2 floats

The ucomiss instruction compares the source value (second operand) to the destination (an XMM register). The source can be an XMM register or a 32 bit memory location. An unordered comparison differs from an ordered comparison in not generating an exception for QNaN (Quiet Not a Number). It can still generate an exception cwif either operand is a SNaN (Signaling NaN). This was what gcc generated, so it's probably a good choice.

There is no corresponding ucomips packed singles.

You can use ptest to determine whether an XMM or YMM register is 0 in 1 instruction.

        ucomiss   xmm0, xmm1        ; compare xmm0 and xmm1
        ucomiss   xmm0, [x]         ; compare xmm0 and 32 bit variable x
        ucomiss   xmm7, [rdi]       ; compare xmm7 and 32 bit value [rdi]
                                    ; rdi holds the address of a float
        ucomiss   xmm9, [x+4*rcx]   ; compare xmm9 and 32 bit element of x
                                    ; rcx contains the array index

Most of the time after a ucomiss instruction you will use a conditional jump from one of these

        ja      ; jump if above          ; means greater than
        jae     ; jump if above or equal ; means greater than or equal
        jb      ; jump if below          ; means less than
        jbe     ; jump if below or equal ; means less than or equal
        je      ; jump if equal
        jne     ; jump if not equal
        jna     ; jump if not above            ; jbe
        jnae    ; jump if not above or equal   ; jb
        jnb     ; jump if not below            ; jae
        jnbe    ; jump if not below or equal   ; ja

flags: ZF PF CF OF SF AF

ZF is set if the operands were equal. CF is set if the first operand is less than the second. PF is set if one of the operands is NaN and then all three are set to 1. OF, SF and AF are all set to 0. I can't yet guess why they chose to use CF rather than SF. Had they used SF the mnemonics for integer and floating point conditions would be the same.