Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!ut-sally!seismo!gatech!akgua!whuxlm!whuxl!houxm!hropus!riccb!ihopa!ihnp4!inuxc!pur-ee!pucc-j!pucc-k!acz From: acz@pucc-k (John R. Jackson) Newsgroups: net.lang.c Subject: What to do with lots of registers Message-ID: <1409@pucc-k> Date: Fri, 27-Jun-86 12:19:43 EDT Article-I.D.: pucc-k.1409 Posted: Fri Jun 27 12:19:43 1986 Date-Received: Mon, 30-Jun-86 03:31:17 EDT Reply-To: jrj@pucc-j.UUCP (John R. Jackson) Organization: Purdue University Computing Center Lines: 63 Keywords: register Sorry this is lengthy, but here goes. I do maintenance and development on the C compiler for the CDC Cyber 205 supercomputer. Among other oddities about the hardware are a very large set of general purpose registers (256 of them!). All (non-vector) operations are performed register to register, so it is best to have as many variables declared register as possible. Since most C programs do not often use the register declaration, I need to study how to automatically promote locals. I am aware of some work done at HCR in this area, and would appreciate any information they can give me. I would also appreciate any ideas anyone has. I am aware of the problems of anything pointing to anything, but it will be better to help most of the cases and then go back and disable the promotion where it causes problems (via the auto keyword???). A second use of the register file could be to hold global variables. Since most routines only have a few local variables, even promoting everything will not use the registers fully. One possibility I am considering is an extension to the register declaration to specify what register the variable should be assigned to. Something like: sub (parm) register parm; { register (0x9a) global; . . . } The register storage declaration for parm would be treated as normal, i.e. the next available free register will be assigned. The global declaration would force register #9A to be used. Variables declared in this way would not be saved across function calls, unless they happen to overlap a register that will be saved anyway. The scope would be the routine the variable was declared in. An alternative, or extension, would allow the register storage class to be used outside the function body, again with the syntax extension to specify a particular register. The scope would then be the rest of the source file just like any other external or static variable. Note that I am not particularly interested in the portability issue. My intent is to provide a performance boost for programs designed for the 205. This compiler already has so many syntax extensions for vector references, one more isn't going to make any difference. Does the C standard say anything about either of these issues? By the way, how do I get a copy? Please reply by mail as much as possible, as I do not want to start a net war about this. Thanks in advance. John R. Jackson Senior 205 Systems Programmer ARPANET: jrj@asc.Purdue.EDU Purdue University Computing Center or jrj@purdue-asc.ARPA Mathematical Sciences Bldg. BITNET: JACKSON@PURCCVM West Lafayette, IN 47907 USENET: jrj@pucc-j.UUCP 317/494-1787