Premium
Code generation using an orthogonal model
Author(s) -
Cordy James R.,
Holt Richard C.
Publication year - 1990
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380200306
Subject(s) - computer science , code generation , operand , code (set theory) , set (abstract data type) , generator (circuit theory) , class (philosophy) , programming language , template , selection (genetic algorithm) , machine code , independence (probability theory) , encode , theoretical computer science , artificial intelligence , key (lock) , compiler , operating system , power (physics) , statistics , physics , biochemistry , mathematics , chemistry , quantum mechanics , gene
This paper describes a new systematic approach to code generation. The approach is based on an orthogonal model, in which implementation of language‐level operators (‘operators’) and addressing operators (‘operands’) is achieved by two independent subtasks. Each of these phases is specified using a set of decision trees that encode the set of possible implementation templates for each language feature and the set of constraints under which each can be applied. Code selection in each phase is achieved by interpreting these trees using a single comprehensive selection algorithm. The method easily extends to machine independence across a large class of target computers by abstracting the implementation templates into machine‐independent implementation strategies. The selection algorithm is then modified to select between implementation strategies based on a machine capability ‘menu’ that describes each target machine in terms of the subset of implementation strategies for which it has corresponding instruction sequences. The method has been used to implement a prototype machine‐independent code generator for the Concurrent Euclid programming language whose generated code density is consistently within four per cent of production machine‐dependent code generators across its entire target class of five modern computers.