Register Transfer Language
From Wikipedia, the free encyclopedia
Register Transfer Language (RTL) is a term used in computer science. It is an intermediate representation used by the GCC compiler.
RTL is used to represent the code being generated, in a form closer to assembly language than to the high level languages which GCC compiles. RTL is generated from the GCC Abstract Syntax Tree representation, transformed by various passes in the GCC 'middle-end', and then converted to assembly language. GCC currently uses the RTL form to do a part of its optimisation work.
RTL is usually written in a form which looks like a Lisp S-expression:
- (set:SI (reg:SI 140) (plus:SI (reg:SI 138) (reg:SI 139)))
This "side-effect expression" says "add the contents of register 138 to the contents of register 139 and store the result in register 140."
The RTL generated for a program is different when GCC generates code for different processors. However, the meaning of the RTL is more-or-less independent of the target: it would usually be possible to read and understand a piece of RTL without knowing what processor it was generated for. Similarly, the meaning of the RTL doesn't usually depend on the original high-level language of the program.
A register transfer language is a system for expressing in symbolic form the microoperation sequences among the registers of a digital module. It is a convenient tool for describing the internal organization of digital computers in concise and precise manner. It can also be used to facilitate the design process of digital systems.