<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style/style.css" />
<title>UCOMISS: Unordered Compare Scalar Single-Precision Floating- Point Values and Set EFLAGS (x86 Instruction Set Reference)</title>
</head>
<body>
<div class="main_container"><h1>x86 Instruction Set Reference</h1>
<title>UCOMISS: Unordered Compare Scalar Single-Precision Floating- Point Values and Set EFLAGS (x86 Instruction Set Reference)</title>
<h1>UCOMISS</h1>
<h2>Unordered Compare Scalar Single-Precision Floating- Point Values and Set EFLAGS</h2>
<object>
<table class="box">
<tr>
<th>Opcode</th>
<th>Mnemonic</th>
<th>Description</th>
</tr>
<tr>
<td class="grid"><code>0F 2E /r</code></td>
<td class="grid"><code>UCOMISS xmm1, xmm2/m32</code></td>
<td class="grid">Compare lower single-precision floating-point value in xmm1 register with lower single-precision floating-point value in xmm2/mem and set the status flags accordingly.</td>
</tr>
</table>
</object>
<object>
<table class="box">
<tr>
<th>Description</th>
</tr>
<tr>
<td class="instruction_set_reference_box">
<p>Performs and unordered compare of the single-precision floating-point values in the low doublewords of the source operand 1 (first operand) and the source operand 2 (second operand), and sets the ZF, PF, and CF flags in the EFLAGS register according to the result (unordered, greater than, less than, or equal). In The OF, SF and AF flags in the EFLAGS register are set to 0. The unordered result is returned if either source operand is a NaN (QNaN or SNaN).</p>
<p>Source operand 1 is an XMM register; source operand 2 can be an XMM register or a 32 bit memory location.</p>
<p>The UCOMISS instruction differs from the COMISS instruction in that it signals an SIMD floating-point invalid operation exception (#I) only when a source operand is an SNaN. The COMISS instruction signals an invalid operation exception if a source operand is either a QNaN or an SNaN.</p>
<p>The EFLAGS register is not updated if an unmasked SIMD floating-point exception is generated.</p>
</td>
</tr>
</table>
</object>
<object>
<table class="box">
<tr>
<th>Operation</th>
</tr>
<tr>
<td class="instruction_set_reference_box">
<pre>Result <span class="operator">=</span> UnorderedCompare<span class="operator">(</span>Source1<span class="operator">[</span><span class="number">0..63</span><span class="operator">]</span><span class="operator">,</span> Source2<span class="operator">[</span><span class="number">0..63</span><span class="operator">]</span><span class="operator">)</span><span class="operator">;</span>
<span class="keyword">switch</span><span class="operator">(</span>Result<span class="operator">)</span> {
	<span class="keyword">case</span> ResultUnordered<span class="operator">:</span>
		ZF <span class="operator">=</span> <span class="number">1</span><span class="operator">;</span>
		PF <span class="operator">=</span> <span class="number">1</span><span class="operator">;</span>
		CF <span class="operator">=</span> <span class="number">1</span><span class="operator">;</span>
		<span class="keyword">break</span><span class="operator">;</span>
	<span class="keyword">case</span> ResultGreaterThan<span class="operator">:</span>
		ZF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		PF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		CF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		<span class="keyword">break</span><span class="operator">;</span>
	<span class="keyword">case</span> ResultLessThan<span class="operator">:</span>
		ZF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		PF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		CF <span class="operator">=</span> <span class="number">1</span><span class="operator">;</span>
		<span class="keyword">break</span><span class="operator">;</span>
	<span class="keyword">case</span> ResultEqual<span class="operator">:</span>
		ZF <span class="operator">=</span> <span class="number">1</span><span class="operator">;</span>
		PF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		CF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
		<span class="keyword">break</span><span class="operator">;</span>
}

OF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
AF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
SF <span class="operator">=</span> <span class="number">0</span><span class="operator">;</span>
</pre>
</td>
</tr>
</table>
</object>
<object>
<table class="box">
<tr>
<th>Instruction</th>
<th>Latency</th>
<th>Throughput</th>
<th>Execution Unit</th>
</tr>
<tr><td class="grid"><code>CPUID</code></td><td class="grid">0F3n/0F2n/069n</td><td class="grid">0F3n/0F2n/069n</td><td class="grid">0F2n</td></tr>
<tr><td class="grid"><code>UCOMISS xmm, xmm</code></td><td class="grid">7/6/1</td><td class="grid">2/2/1</td><td class="grid">FP_ADD FP_MISC</td></tr>
</table>
</object>
</div>
</body>
</html>
