Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.arch Subject: Re: Hybrid stack/register machines Message-ID: <1814@rlgvax.UUCP> Date: Fri, 16-Mar-84 23:17:19 EST Article-I.D.: rlgvax.1814 Posted: Fri Mar 16 23:17:19 1984 Date-Received: Sun, 18-Mar-84 07:25:39 EST References: <177@harvard.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 39 > Has anybody produced "stack" machines that keep some large portion of > the top frame in the processor, instead of memory? So to speak -- in > "registers"? The number of frame elements in the processor could be fixed, > or they could be in a small, dedicated, high speed cache. Highspeed > register flushing would be a must; maybe it could be done in parallel > with setting up call frames. > It seems to me that this approach could get many of the benefits of both > stack machines (simpler compiler technology) and register machines (fast > access for frequently used variables). I know that some compiler manipulations > that I don't see done very often (does UNIX mislead me?) simulate this, and > that a normal cache is still slower than registers. When you say "stack machines", it usually refers to machines whose instruction set implements Reverse Polish Notation; there is a "push" or "load" instruction which pushes something onto an evaluation stack, and the arithmetic instructions take the top N elements of the evaluation stack, pop them off, perform the arithmetic operation, and push the result back on to the stack. Most such machines implement the top few elements of the stack in fast "registers" (although those "registers" are not usually accessible directly). The elements of the stack kept in registers take the place of registers used for temporary results in general register machines. One could also give such a machine general registers; data can be pushed from them or popped into them just like it could be pushed from or popped into memory locations. These registers would work exactly like registers used for variables in general register machines. Presumably, these general registers would still have very short names and could be accessed more quickly than memory locations. (The Xerox Mesa machine (which is a stack machine) has special versions of the "push" instruction that push things at a very small offset from the beginning of the current activation record; this means that some variables can have the same short names. For instance, there are 2-byte "push" instructions with an 8-bit offset and 3-byte "push" instructions with a 16-bit offset; however, these special "push" instructions fit into only one byte, with the offset encoded into the op code.) Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy