09.01.2013 Views

AMD x86-64 Architecture Programmer's Manual, Volume 4, 128-Bit ...

AMD x86-64 Architecture Programmer's Manual, Volume 4, 128-Bit ...

AMD x86-64 Architecture Programmer's Manual, Volume 4, 128-Bit ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

26568—Rev. 3.05—September 2003 <strong>AMD</strong><strong>64</strong> Technology<br />

CMPSS Compare Scalar Single-Precision<br />

Floating-Point<br />

Compares the single-precision floating-point value in the low-order 32 bits of the first<br />

source operand with the single-precision floating-point value in the low-order 32 bits<br />

of the second source operand and writes the result in the low-order 32 bits of the<br />

destination (first source). The type of comparison is specified by the three low-order<br />

bits of the immediate-byte operand, as shown in Table 1-1 on page 24. The result of the<br />

compare is a 32-bit value of all 1s (TRUE) or all 0s (FALSE). The first<br />

source/destination operand is an XMM register. The second source operand is another<br />

XMM register or 32-bit memory location. The three high-order doublewords of the<br />

destination XMM register are not modified.<br />

Mnemonic Opcode Description<br />

CMPSS xmm1, xmm2/mem32, imm8 F3 0F C2 /r ib Compares single-precision floating-point values in an<br />

XMM register and an XMM register or 32-bit memory<br />

location.<br />

xmm1 xmm2/mem32<br />

127 32 31 0 127 32<br />

31 0<br />

imm8<br />

7 0<br />

compare<br />

Some compare operations that are not directly supported by the immediate-byte<br />

encodings can be implemented by swapping the contents of the source and<br />

destination operands and then executing the appropriate compare instruction using<br />

the swapped values. These additional compare operations are shown in Table 1-1 on<br />

page 24. When swapping operands, the first source XMM register is overwritten by the<br />

result.<br />

cmpss.eps<br />

CMPSS 33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!