Browse Prior Art Database

Prologue and Epilogue Code Generation

IP.com Disclosure Number: IPCOM000089634D
Original Publication Date: 1977-Nov-01
Included in the Prior Art Database: 2005-Mar-05
Document File: 2 page(s) / 14K

Publishing Venue

IBM

Related People

Ris, FN: AUTHOR [+2]

Abstract

A technique is described for implementing certain almost-machine-level text units as calls to internal or external subroutines. The technique is used in the environment of the final code generation process for a machine with a primitive instruction set, such as a microprocessor or a microprogrammable machine architecture.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Prologue and Epilogue Code Generation

A technique is described for implementing certain almost-machine-level text units as calls to internal or external subroutines. The technique is used in the environment of the final code generation process for a machine with a primitive instruction set, such as a microprocessor or a microprogrammable machine architecture.

Multiplication on machines which have no hardware multiply or architectural assistance generally comprises a subroutine of several dozen instructions. A code skeleton of this size is in general too cumbersome to be inserted in-line each time a multiplication is required. Hence, the question arises how best to implement out-of-line expansion in the final text without unnecessary imposition of the details on the higher text levels. Flexibility of maintenance is also an important consideration, since the generation strategy for such a complex piece of code is likely to change more often than that for a simpler, more straight- forward code pattern where the number of degrees of freedom is considerably less.

The approach used by Wulf [*] builds into an early stage of the compiler the knowledge that the operation will be implemented by a subroutine call. An early text transformation is thus made to reflect this knowledge, and the linkage is handled much as for any other procedural invocation. This approach works in the cited instance because there is a stable source language and target machine. Further, the target machine is sufficiently regular so that all subroutine linkages can be handled in the same way without serious degradation in the quality of code generated.

The subject environment differs substantially in that for the desired target machines, asymmetries in the register organization mitigate against using general calling sequences when not absolutely necessary. Further, a much higher degree of compiler flexibility and maintainability is required.

Consider first out-of-line generation of the actual multiplication code. In this case, linkage code must be generated for each occurrence of a multiply instruction, and at the end of the code, the subroutine itself must be generated, but only if a multiplication has occurred...