Code Generation and Storage Allocation for Machines with Span-Dependent Instructions
- 1 January 1979
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 1 (1), 71-83
- https://doi.org/10.1145/357062.357067
Abstract
Many machine languages have two instruction formats, one of which allows addressing of “nearby” operands with “short” (e.g. one word) instructions, while “faraway” operands require “long” format (e.g. two words). Because the distance between an instruction and its operand depends upon the formats of the intervening instructions, the formats of different instructions may be interdependent. An efficient technique is discussed which optimally assigns formats to instructions in a given program and is practical in space as well as time. The more sophisticated problem of arranging operands within programs is discussed. Unfortunately, it is unlikely that an efficient algorithm can guarantee even a good approximation for this problem, since it is shown that r -approximation is NP-complete. Finally, implications of these problems for hardware and software design are considered.Keywords
This publication has 4 references indexed in Scilit:
- Assembling code for machines with span-dependent instructionsCommunications of the ACM, 1978
- P-Complete Approximation ProblemsJournal of the ACM, 1976
- A process for the determination of addresses in variable length addressingCommunications of the ACM, 1976
- How to keep the addresses shortCommunications of the ACM, 1971