News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

SETcc - Byte set on condition instructions?

Started by cork, July 25, 2010, 06:38:36 AM

Previous topic - Next topic

cork

Do people still have use for these 30 instructions? Just curious.

Source: http://pdos.csail.mit.edu/6.828/2006/readings/i386/SETcc.htm

Opcode   Instruction  Clocks  Description
0F  97   SETA r/m8    4/5     Set byte if above (CF=0 and ZF=0)
0F  93   SETAE r/m8   4/5     Set byte if above or equal (CF=0)
0F  92   SETB r/m8    4/5     Set byte if below (CF=1)
0F  96   SETBE r/m8   4/5     Set byte if below or equal (CF=1 or (ZF=1)
0F  92   SETC r/m8    4/5     Set if carry (CF=1)
0F  94   SETE r/m8    4/5     Set byte if equal (ZF=1)
0F  9F   SETG r/m8    4/5     Set byte if greater (ZF=0 or SF=OF)
0F  9D   SETGE r/m8   4/5     Set byte if greater or equal (SF=OF)
0F  9C   SETL r/m8    4/5     Set byte if less (SF<>OF)
0F  9E   SETLE r/m8   4/5     Set byte if less or equal (ZF=1 and
                              SF<>OF)
0F  96   SETNA r/m8   4/5     Set byte if not above (CF=1)
0F  92   SETNAE r/m8  4/5     Set byte if not above or equal (CF=1)
0F  93   SETNB r/m8   4/5     Set byte if not below (CF=0)
0F  97   SETNBE r/m8  4/5     Set byte if not below or equal (CF=0 and
                              ZF=0)
0F  93   SETNC r/m8   4/5     Set byte if not carry (CF=0)
0F  95   SETNE r/m8   4/5     Set byte if not equal (ZF=0)
0F  9E   SETNG r/m8   4/5     Set byte if not greater (ZF=1 or SF<>OF)
0F  9C   SETNGE r/m8  4/5     Set if not greater or equal (SF<>OF)
0F  9D   SETNL r/m8   4/5     Set byte if not less (SF=OF)
0F  9F   SETNLE r/m8  4/5     Set byte if not less or equal (ZF=1 and
                              SF<>OF)
0F  91   SETNO r/m8   4/5     Set byte if not overflow (OF=0)
0F  9B   SETNP r/m8   4/5     Set byte if not parity (PF=0)
0F  99   SETNS r/m8   4/5     Set byte if not sign (SF=0)
0F  95   SETNZ r/m8   4/5     Set byte if not zero (ZF=0)
0F  90   SETO r/m8    4/5     Set byte if overflow (OF=1)
0F  9A   SETP r/m8    4/5     Set byte if parity (PF=1)
0F  9A   SETPE r/m8   4/5     Set byte if parity even (PF=1)
0F  9B   SETPO r/m8   4/5     Set byte if parity odd (PF=0)
0F  98   SETS r/m8    4/5     Set byte if sign (SF=1)
0F  94   SETZ r/m8    4/5     Set byte if zero (ZF=1)

jj2007

Can speed up a loop in certain situations...

Intel(R) Celeron(R) M CPU        420  @ 1.60GHz (SSE3)
117     cycles for 100*sete, eq
117     cycles for 100*sete, ne
221     cycles for 100*jmp taken
147     cycles for 100*jmp not taken

Rockoon

AMD Phenom(tm) II X6 1055T Processor (SSE3)
93      cycles for 100*sete, eq
93      cycles for 100*sete, ne
209     cycles for 100*jmp taken
94      cycles for 100*jmp not taken

When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

Queue

AMD Athlon(tm) 4 Processor (SSE1)
98  cycles for 100*sete, eq
98  cycles for 100*sete, ne
501 cycles for 100*jmp taken
132 cycles for 100*jmp not taken


For some reason I really enjoy these benchmarks; seeing the various results is fascinating.

Queue

oex

Quote from: Queue on July 26, 2010, 06:40:54 PM
For some reason I really enjoy these benchmarks; seeing the various results is fascinating.

Facination in benchmarks the first sign of madnerdiness.... After that it's all downhill, pale skin, cccccaffine induced jitters and RSI are other sure signs :lol
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Queue

Isn't it more a sign the nerdiness is terminal? I mean, you have to already be a nerd in the first place to post on a programming forum. =]

Queue