x86-64 instructions for floating-point comparisons

What are the x86-64 instructions for floating-point comparisons like the cmpq for quard-word integer comparison?

The SSE3 extenstions provide two instructions for comparing floating values:

Instruction       Based on    Description
ucomiss S2, S1    S1 - S2     Compare single precision
ucomisd S2, S1    S1 - S2     Compare double precision

As with cmpq, they follow the GAS convention of listing the operands in reverse order. Argument S2 must be in an XMM register, while S1 can either be in an XMM register or in memory.

Reference: https://www.cs.cmu.edu/~fp/courses/15213-s07/misc/asm64-handout.pdf

Check more: https://www.systutorials.com/3024/x86-64-isa-assembly-references/

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *