1995Unpublished venueRequires access

A Simple and a Retargetable Code Generator for TCGS

Theo C. Ruys

Open publisher page 0 citations

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.

About this research paper

What this paper is about

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.

Why it matters

A significance statement is not available in the OpenAlex record.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available 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.

Key concepts: Computer science, Object code, Unreachable code, Code generation, Dead code, Programming language, Compiler, Redundant code

Related papers

Back to paper searchBrowse research topicsOriginal source
A Simple and a Retargetable Code Generator for TCGS — Research Paper | ScholarLens