GNU Compiler Collection (GCC) Internals: Mode Iterators

Next: Code Iterators, Up: Iterators   [Contents][Index]


16.23.1 Mode Iterators

Ports often need to define similar patterns for two or more different modes. For example:

  • If a processor has hardware support for both single and double floating-point arithmetic, the SFmode patterns tend to be very similar to the DFmode ones.
  • If a port uses SImode pointers in one configuration and DImode pointers in another, it will usually have very similar SImode and DImode patterns for manipulating pointers.

Mode iterators allow several patterns to be instantiated from one .md file template. They can be used with any type of rtx-based construct, such as a define_insn, define_split, or define_peephole2.

• Defining Mode Iterators:    Defining a new mode iterator.
• Substitutions:    Combining mode iterators with substitutions
• Examples:    Examples