gccint: Condition Code

1 
1 18.15 Condition Code Status
1 ===========================
1 
1 The macros in this section can be split in two families, according to
1 the two ways of representing condition codes in GCC.
1 
11  The first representation is the so called '(cc0)' representation (⇒
 Jump Patterns), where all instructions can have an implicit clobber of
1 the condition codes.  The second is the condition code register
1 representation, which provides better schedulability for architectures
1 that do have a condition code register, but on which most instructions
1 do not affect it.  The latter category includes most RISC machines.
1 
1  The implicit clobbering poses a strong restriction on the placement of
1 the definition and use of the condition code.  In the past the
1 definition and use were always adjacent.  However, recent changes to
1 support trapping arithmatic may result in the definition and user being
1 in different blocks.  Thus, there may be a 'NOTE_INSN_BASIC_BLOCK'
1 between them.  Additionally, the definition may be the source of
1 exception handling edges.
1 
1  These restrictions can prevent important optimizations on some
1 machines.  For example, on the IBM RS/6000, there is a delay for taken
1 branches unless the condition code register is set three instructions
1 earlier than the conditional branch.  The instruction scheduler cannot
1 perform this optimization if it is not permitted to separate the
1 definition and use of the condition code register.
1 
1  For this reason, it is possible and suggested to use a register to
1 represent the condition code for new ports.  If there is a specific
1 condition code register in the machine, use a hard register.  If the
1 condition code or comparison result can be placed in any general
1 register, or if there are multiple condition registers, use a pseudo
1 register.  Registers used to store the condition code value will usually
1 have a mode that is in class 'MODE_CC'.
1 
1  Alternatively, you can use 'BImode' if the comparison operator is
1 specified already in the compare instruction.  In this case, you are not
1 interested in most macros in this section.
1 

Menu