/* THIS IS THE OPTIMIZING VERSION OF THE XPL COMPILER, PREPARED BY R. A. VOWELS X X CCCCC OOOOO M M X X C C O O MM MM X X C C O O M M M M X X C C O O M M M M X X C O O M M M M XX C O O M M M XX C O O M M X X C O O M M X X C C O O M M X X C C O O M M X X C C O O M M X X CCCCC OOOOO M M THE COMPILER FOR X P L W. M. MCKEEMAN J. J. HORNING D. B. WORTMAN INFORMATION & COMPUTER SCIENCE COMPUTER SCIENCE COMPUTER SCIENCE, DEPARTMENT, DEPARTMENT, UNIVERSITY OF STANFORD STANFORD CALIFORNIA AT UNIVERSITY, UNIVERSITY, SANTA CRUZ, STANFORD, STANFORD, CALIFORNIA CALIFORNIA CALIFORNIA 95060 94305 94305 DEVELOPED AT THE STANFORD COMPUTATION CENTER, CAMPUS FACILITY, 1966-69 AND THE UNIVERSITY OF CALIFORNIA COMPUTATION CENTER, SANTA CRUZ, 1968-69. The Optimizing version of XPL was delevoped by: R. A. Vowels, formerly of Department of Computer Science Royal Melbourne Institute of Technology, 124 La Trobe Street, MELBOURNE 3000 Victoria AUSTRALIA. email address is now: robin_v@bigpond.com Outline: This optimizing XCOM compiler is a standard implementation of XPL and is based on McKeeman, Horning, and Wortman's improved XCOM (which employs hashed symbol table generation). It includes the extra built-in function COREHALFWORD. The following areas have been optimized: procedure calls when the argument and corresponding parameter are of the same type, and when the argument is a constant; constant subscripts; use of CORELHALFWORD and COREWORD; string constants of length one; iterative DO statements by transferring code to the end of the loop. String constants of length one do not require a descriptor, hence more descriptors are available for string variables. Comparison operations are treated as commutative, and an improved Commute algorithm is used. Halfword instructions are generated for BIT(16) variables. These areas have been improved or re-written: calls on OUTPUT, catenation, integer-to-string conversion, multiply, divide, and MOD. An emitter for SS-type instructions has been added. The compiler achieves an 11% reduction in object code compiling itself, an 11% increase in compilation rate, a 55% increase in compilation speed when the $ E toggle is set. Special treatment for catenating a string to an integer substantially decreases consumption of the free string area, and decreases string moves. The latter improvement is most noticeable on small core machines. Core requirements: less than the improved XCOM on which it is based (approx. 98000 bytes). Symbol table size is 468. ports: IBM System 370 portability: The compiler is written in XPL. The code generators are machine-specific. This version distributed by Robin Vowels. Date: 11 November 1993. 11 December 1998. DISTRIBUTED THROUGH THE SHARE ORGANIZATION. */ /* FIRST WE INITIALIZE THE GLOBAL CONSTANTS THAT DEPEND UPON THE INPUT GRAMMAR. THE FOLLOWING CARDS ARE PUNCHED BY THE SYNTAX PRE-PROCESSOR */ DECLARE NSY LITERALLY '91', NT LITERALLY '42'; DECLARE V(NSY) CHARACTER INITIAL ('', ';', ')', '(', ',', ':', '=', '|', '&', '^', '<', '>', '+', '-', '*', '/', 'IF', 'DO', 'TO', 'BY', 'GO', '||', '_|_', 'END', 'BIT', 'MOD', 'THEN', 'ELSE', 'CASE', 'CALL', 'GOTO', 'WHILE', 'FIXED', 'LABEL', 'RETURN', 'DECLARE', 'INITIAL', '', '', 'PROCEDURE', 'LITERALLY', 'CHARACTER', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '