GLOBAL METHODS IN THE FLOW GRAPH APPROACH TO R.~TARGETABLE MICROCODE GKNERATION Robert A. Mueller, Joseph Varghese, and Vicki H. Allan Department of Computer Science Colorado State University Fort Collins, Colorado, 80523 Abstract We have reported on local retargetable microcode gen- eration methods based on the too graph model in pre- vious papers. In this paper, we consider the extension of thcsc methods to global rctargetablc rrdcrocodc generation. This includes intermediate representa- tions of basic blocks containing control flow directives and tbeir construction from global program dags, resource allocation and its interaction with code gcn- eration, machine-independent semantics and pro- cedures for global microcode generation, and global compaction. The emphasis is on issues and promising directions for research on global mcthods v/s a v./.s final results and definitive answers, as it reflects the early stages of our research. 1. ]ntroduelJo~x As with general-purpose programming, microprogram- rning can often be simplified and reliability improved through the use of symbolic languages and automatic translators for those languages. For machine- independent languages we require translation systems that, ideally, can be ported with modest effort and high reliability. This is accomplished by organizing the machine-dependent component of the translation sys- tem into two components: a machine-independent algo- rithm that uses machine-independent semantic rules and a description of a target microengine represented in a machine description language. The machine-dependent component is collectively called a m~croeode gevteral0v-. A mierocode generator translates a machine-independent intermediate language representation produced by a parser and enhanced by flow analysis and optimization into a machine code representation. When organized as described above, it becomes a retwrgetable raicrocode gerteralor I. This paper's view of a high-level language IThjs terminology is consistent with that used in the analogous domain of compiler code generation [Gana82]. This work was supported in part by NSF grant MCS- 8107481. translation system employing a retargetable ratcro- code generator, as discussed in [MuelS3], [MuelS4a], and [Mue184b], is shown in Figure 1.1. Note that the interface between the machine- independent and machine-dependent components of the translation system is a program flow graph. A pro- g'ram flow graph G=(N,E,r) is a directed graph (N,E), where N is a set of nodes representing straight-line sequences of instructions that are always entered at the beginning and exited at the end of the sequence (called basic blocks), E is the edge relation on N with an edge directed from one node to another represent- ing potential control flow from the former to the latter, and r is a distinguished start vertex such that for any node teen there is a path from r to n. Local retarget- able microcode generation methods which are directed at individual basic blocks are reported in ([MueiS0],[Muel8~], [MuelS3],[MuelS4a],[MuelS4b]). In this paper, enhancements of those proposals for global retargetable microcode generation are considered. There are several central issues to be addressed in cnhaneing these methods as such. Intermediate t'epresenL~Lions of basic blocks must be exLended to include control flow directives to allow for the genera- tion of micro-instructions for control store sequencing. Extensions to ss~,tbol£c assertion rcprcsentations of basic blocks and their construction are discussed in section 2. This is easily done, given a global program dag that can be efficiently computed using a symbolic cxceution algorithm [Rci~l] that providcs additional program structural information needed for opthntza- tions, such as code mot/era and comrrm~ sztb-exirressio~t processing. Before beginning the process of translating the machine-independent representations into microcode, the abstract variable and operation references are replaced by target machine register and function references. 'rials is called resource al, locatiol,t. The nature of the resource allocation problem in the con- text of the proposed method and its interaction with the kernel microcode generator component are dis- cussed in section 3, while section 4 addresses machine-independent semantics and procedures for the extended symbolic assertions with control flow directives. In section 5, the global compaction prob- lem is considered and current plans for post- rnicrocode generation optimization are presented, finishing with conclusions and proposals for future work in section 6. 275 CH2088/84/OOOO/O275501.OO©I9841EEE