GNU Compiler Collection (GCC) Internals: Machine Desc |
---|
Next: Target Macros, Previous: Loop Analysis and Representation, Up: Top [Contents][Index]
A machine description has two parts: a file of instruction patterns (.md file) and a C header file of macro definitions.
The .md file for a target machine contains a pattern for each instruction that the target machine supports (or at least each instruction that is worth telling the compiler about). It may also contain comments. A semicolon causes the rest of the line to be a comment, unless the semicolon is inside a quoted string.
See the next chapter for information on the C header file.
• Overview: | How the machine description is used. | |
• Patterns: | How to write instruction patterns. | |
• Example: | An explained example of a define_insn pattern.
|
|
• RTL Template: | The RTL template defines what insns match a pattern. | |
• Output Template: | The output template says how to make assembler code from such an insn. | |
• Output Statement: | For more generality, write C code to output the assembler code. | |
• Predicates: | Controlling what kinds of operands can be used for an insn. | |
• Constraints: | Fine-tuning operand selection. | |
• Standard Names: | Names mark patterns to use for code generation. | |
• Pattern Ordering: | When the order of patterns makes a difference. | |
• Dependent Patterns: | Having one pattern may make you need another. | |
• Jump Patterns: | Special considerations for patterns for jump insns. | |
• Looping Patterns: | How to define patterns for special looping insns. | |
• Insn Canonicalizations: | Canonicalization of Instructions | |
• Expander Definitions: | Generating a sequence of several RTL insns for a standard operation. | |
• Insn Splitting: | Splitting Instructions into Multiple Instructions. | |
• Including Patterns: | Including Patterns in Machine Descriptions. | |
• Peephole Definitions: | Defining machine-specific peephole optimizations. | |
• Insn Attributes: | Specifying the value of attributes for generated insns. | |
• Conditional Execution: | Generating define_insn patterns for
predication.
|
|
• Define Subst: | Generating define_insn and define_expand
patterns from other patterns.
|
|
• Constant Definitions: | Defining symbolic constants that can be used in the md file. | |
• Iterators: | Using iterators to generate patterns from a template. |
Next: Target Macros, Previous: Loop Analysis and Representation, Up: Top [Contents][Index]