Not many architectures have skip instructions today. They are (usually) conditional instructions that skip the following instruction. A few architectures having these:
- PIC14, with its
btfss
andbtfsc
instructions - Most PDP's from DEC (perhaps most famously the PDP-10)
- Data General NOVA
I'm writing a superoptimizer (just a hobby, won't be big and professional like GNU superopt) which does code generation so I'm doing some research into compiler terminology and the related concepts.
I'm still trying to work out why the notion of basic block is useful, but also, if skip instructions count as branch instructions for the purposes of determining whether they may be included in basic blocks and extended basic blocks.
On the one hand, they are like a conditional branch with an implicit forward destination, so could be treated the same as a conditional branch instruction. On the other hand, a skip instruction followed by a load is equivalent to a conditional-move instruction. Or a skip-if-negative instruction followed by a subtract-from-zero instruction implements a get-absolute-value instruction, and these are permitted inside of a basic block.
So how do compiler writers and others generally reason about this?