gccint: Jump Patterns

1 
1 17.12 Defining Jump Instruction Patterns
1 ========================================
1 
1 GCC does not assume anything about how the machine realizes jumps.  The
1 machine description should define a single pattern, usually a
1 'define_expand', which expands to all the required insns.
1 
1  Usually, this would be a comparison insn to set the condition code and
1 a separate branch insn testing the condition code and branching or not
1 according to its value.  For many machines, however, separating compares
1 and branches is limiting, which is why the more flexible approach with
1 one 'define_expand' is used in GCC. The machine description becomes
1 clearer for architectures that have compare-and-branch instructions but
1 no condition code.  It also works better when different sets of
1 comparison operators are supported by different kinds of conditional
1 branches (e.g.  integer vs.  floating-point), or by conditional branches
1 with respect to conditional stores.
1 
1  Two separate insns are always used if the machine description
1 represents a condition code register using the legacy RTL expression
1 '(cc0)', and on most machines that use a separate condition code
1 register (⇒Condition Code).  For machines that use '(cc0)', in
1 fact, the set and use of the condition code must be separate and
1 Condition Code::) and so that the comparison and branch insns could be
1 located from each other by using the functions 'prev_cc0_setter' and
1 'next_cc0_user'.
1 
1  Even in this case having a single entry point for conditional branches
1 is advantageous, because it handles equally well the case where a single
1 comparison instruction records the results of both signed and unsigned
1 comparison of the given operands (with the branch insns coming in
1 distinct signed and unsigned flavors) as in the x86 or SPARC, and the
1 case where there are distinct signed and unsigned compare instructions
1 and only one set of conditional branch instructions as in the PowerPC.
1 
1    ---------- Footnotes ----------
1 
1    (1) 'note' insns can separate them, though.
1