INSTRUCTION SETS FOR EVALUATING ARITHMETIC EXPRESSIONS.

E. G. Coffman, Ravi Sethi

Research output: Contribution to journalArticle

1 Scopus citations

Abstract

The evaluation of arithmetic expressions on both register-oriented and stack-oriented machines can be studied using the same model because registers can be treated as a stack during the evaluation of expression trees, without loss in code efficiency. The machine model in this paper has a hardware stack in which all computations take place. Register-register and register-memory instructions are modeled by considering four possible instructions for each binary operator, depending on whether one or two operands are taken from the stack and on whether the left or the right operand is on top of the stack. There is a cost associated with each operation code, as well as costs for accessing a value in a register or in memory. The minimum cost of computing an expression tree is used to compare machines. As part of the framework that allows the comparisons to be performed, a parameterized algorithm for determining the number of stores that must occur in an optimal computation is developed. This algorithm forms the basis of an optimal code generation algorithm.

Original languageEnglish (US)
Pages (from-to)457-478
Number of pages22
JournalJournal of the ACM
Volume30
Issue number3
DOIs
Publication statusPublished - Jul 1983
Externally publishedYes

    Fingerprint

ASJC Scopus subject areas

  • Computational Theory and Mathematics
  • Computer Graphics and Computer-Aided Design
  • Hardware and Architecture
  • Information Systems
  • Software
  • Theoretical Computer Science

Cite this