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.

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

CMPSD Compare Scalar Double-Precision<br />

Floating-Point<br />

Compares the double-precision floating-point value in the low-order <strong>64</strong> bits of the first<br />

source operand with the double-precision floating-point value in the low-order <strong>64</strong> bits<br />

of the second source operand and writes the result in the low-order <strong>64</strong> 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 <strong>64</strong>-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 <strong>64</strong>-bit memory location. The high-order <strong>64</strong> bits of the destination<br />

XMM register are not modified.<br />

Mnemonic Opcode Description<br />

CMPSD xmm1, xmm2/mem<strong>64</strong>, imm8 F2 0F C2 /r ib Compares double-precision floating-point values in<br />

an XMM register and an XMM register or <strong>64</strong>-bit<br />

memory location.<br />

xmm1 xmm2/mem<strong>64</strong><br />

127 <strong>64</strong> 63 0 127 <strong>64</strong><br />

63 0<br />

imm8<br />

7 0<br />

compare<br />

all 1s or 0s<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 />

30 CMPSD<br />

cmpsd.eps

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

Saved successfully!

Ooh no, something went wrong!