IT lexicon › Programming › Machine description (GCC)

Machine description (GCC)

Programming På svenska → Updated: 2026-11-07

GCC's .md files, where each processor architecture is described as Lisp-like RTL patterns that build-time tools turn into C code.

Every backend under gcc/config/ has its .md files. define_insn ties an RTL pattern to an assembly line, with conditions and operand constraints in the same letter language inline assembly uses. define_expand controls how GIMPLE is lowered to RTL through standard names such as addsi3, define_split breaks instructions apart, and define_peephole2 is GCC's peephole optimizer. Generator programs like genrecog turn the lot into C when the compiler itself is built.

The S-expressions are a legacy of Richard Stallman's Lisp background, and they have aged better than you might expect. The x86 backend's files run to tens of thousands of lines. LLVM's equivalent is TableGen.

← Back to the lexicon