user27532204
user27532204

Reputation: 21

What does the "i" in COMISS / VUCOMISS stand for?

Currently I'm reading CS:APP 3rd edition, and I found the instructions a little bit verbose (in my view) like vucomiss, so I looked for the full name of the instruction to help memorizing.

I found the description for ucomiss: "Unordered Compare Scalar Single-Precision Floating-Point Values", thus "u" refers to unordered, "com" refers to compare, "ss" refers to scalar single, but where is the letter "i"? What's the meaning of letter "i" in vcomiss and vucomiss (and the SSE1 versions comiss and ucomiss)?

Upvotes: 2

Views: 127

Answers (1)

Peter Cordes
Peter Cordes

Reputation: 365467

I assume the "i" stands for Integer, as in compare into the integer FLAGS register, unlike x87 fcom.

The comiss / ucomiss mnemonics are pretty clearly inspired by the x87 instructions fcomi and fucomi which were new in P6 (Pentium Pro). Intel's vol.2 manual entries for those instructions don't shed any light on what the "i" stands for; I haven't looked at other volumes of Intel's manuals or AMD's (although Intel named them.)

Before P6, the only x87 compares set the x87 status register, requiring an fstsw and sahf (or testing the bits directly with test/jcc). So instructions like fcom and fucom only executed within the x87 unit, only writing the result to the x87 status word. (which was a separate chip which communicated over external pins with the actual CPU in 8086 through 386. 487 was just a 486DX which took over the system and also ran the integer instructions, and P5 and later always had integrated FPUs).

See Why do x86 FP compares set CF like unsigned integers, instead of using signed conditions? for more about how SSE/AVX compare FLAG setting evolved out of x87, and how x87 compares worked before P6 fcomi.


Note that vcomiss is the AVX1 version of SSE1 comiss. Your original question asked about that but linked ucomiss (whose manual entry also covers vucomiss). The "v" prefix on the mnemonic is the for VEX-prefixed AVX encoding, but the instructions actually date back to original SSE in Pentium III. (The double-precision versions, [u]comisd, date back to SSE2 in Pentium 4.)
The AVX versions only require AVX1 not AVX2. AVX2 new instructions are 256-bit versions of SIMD integer instructions, and a few new shuffles like vpermps.

Upvotes: 3

Related Questions