iximeow / yaxpeax-x86

x86 decoders for the yaxpeax project
BSD Zero Clause License
129 stars 23 forks source link

Checking if opcode is a conditional jump #29

Closed meithecatte closed 1 year ago

meithecatte commented 1 year ago

Currently, Opcode::condition provides some facilities for handling Jcc, SETcc and CMOVcc with common code for the condition codes themselves. However, you still need to list all the 16 conditional jumps in a match, or do ugly string processing hacks, to actually check whether an Opcode is a Jcc, or whether it is SETcc or CMOVcc.

iximeow commented 1 year ago

this feels like a glaring oversight! i'm surprised i'd never noticed this either. is_jcc, is_setcc, and is_cmovc helpers on the various Opcode certainly seem reasonable to me.

iximeow commented 1 year ago

(those helpers are now on all three forms of Opcode, and will get published as part of an eventual 1.1.6 release)