Title: A Simple and a Retargetable Code Generator for TCGS
Abstract: The Twente Compiler Generator System (TCGS) is a parser-generator system which is typically used to generate a compiler that, given an input program, generates abstract stack code. A code generator for TCGS translates this stack code generated by a TCGS compiler to assembler code for a particular target machine.
This thesis discusses two code generators for TCGS: GUMP and COGGEN.
The simplest strategy to translate stack code into assembler code is to macro expand each stack code instruction to an equivalent sequence of assembler code instructions. This simple strategy is used in the code generator GUMP.
COGGEN, which stands for Code-Generator Generator, is a retargetable code generator. The intermediate language used in COGGEN modules is the Register Transfer Language (RTL). COGGEN consists of several modules. COGGEN’s expander translates abstract stack code of the TCGS compiler to RTL-code. COGGEN’s assigner maps the temporaries in the RTL-code upon machine registers of the target machine. From a machine description, COGGEN’s transformer builds the transducer, an automaton which translates RTL-code to assembler code for the target machine.
Both code generators are implemented for Intel’s 8086 microprocessor. Code generated with GUMP86 is 40 times faster than TCGS’ interpreter and code generated with COGGEN86 is roughly 65 times faster than TCGS’ interpreter.
Publication Year: 1995
Publication Date: 1995-07-14
Language: en
Type: article
Access and Citation
AI Researcher Chatbot
Get quick answers to your questions about the article from our AI researcher chatbot