What programming language is this? It's a Lisp dialect used by GCC internals.

(define_insn "*call_symbol"
   [(call (mem:DI (match_operand:DI 0 "" ""))
          (match_operand 1 "" ""))
    (use (match_operand 2 "" ""))
    (clobber (reg:DI LR_REGNUM))]
   "GET_CODE (operands[0]) == SYMBOL_REF
    && !aarch64_is_long_call_p (operands[0])"
   [(set_attr "type" "call")]

Link to source file


It is called machine description files. These .md files are used to generate a significant part of the C (now C++) code of the back end.

BTW, you could also customize GCC using a Lisp-like language: MELT

Some documentation is linked from MELT documentation page, and to get a global picture about GCC I strongly recommend taking several hours on the (Indian) GCC resource center.

This (mine) answer contains pictures which might be helpful to you.

  • So if I understand correctly, MD is not a Turing-complete programming language but rather a configuration language / DSL with Lispy syntax; and it is not compiled but transpiled to C++ code? – marczellm Jan 9 '15 at 10:20
  • 1
    It is a DSL with Lispy syntax. I don't know if it is not Turing-complete. AFAIK, you can put some C or C++ code inside .md files... so it may become Turing-complete... – Basile Starynkevitch Jan 9 '15 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.