Compare (cmp) Instruction. The compare (cmp) instruction compares two numeric values. ... Additionally, if the instruction is a signalling comparison form and one or more of the source operands is a quiet NaN, then an invalid operation exception must be generated.