Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!well!jax From: jax@well.UUCP (Jack J. Woehr) Newsgroups: comp.lang.forth Subject: Re: FORTH, RISC, and other new architectures Summary: Well, Howdy There, AMD! Keywords: 29000, stack, depth, RISC Message-ID: <12989@well.UUCP> Date: 3 Aug 89 04:48:16 GMT References: <385@ryn.esg.dec.com> <975@key.COM> <26573@amdcad.AMD.COM> Reply-To: jax@well.UUCP (Jack J. Woehr) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 65 In article <26573@amdcad.AMD.COM> tim@amd.com (Tim Olson) writes: ... original posting deleted, but yes the transputer is not a very effective Forth engine ... > >Yes, large standard register files are not very effective in speeding up >FORTH. However, the Am29000 register file is different. There are 128 >local registers, which are offset from the register stack pointer >(global register 1). Thus, the local register file can act like a stack >cache, holding the top (or all!) of the operand stack. > >FORTH primatives (compiled in-line) then look like: > > + DUP SWAP >add lr1, lr1, lr0 add lr127, lr0, 0 add tmp, lr0, 0 >add gr1, gr1, 4 sub gr1, gr1, 4 add lr0, lr1, 0 > add lr1, tmp, 0 > >with lr0 pointing to the top of stack, lr1 the next of stack, etc. A >"smart" FORTH compiler would be able to remove the extraneous >stack-adjustment instructions and change the local variable references >accordingly. > VERY Interesting!!! Just got hold of the 29000 User's Manual today, thanx to AMD's eager and friendly marketing division. Is this to be taken to mean that you have a Forth up and running on some 29000-based boards or machines? More info, please! >The FORTH notion of separate operand and control stacks can also be >implemented by splitting the local register file into two 64-register >chunks, and keeping two shadow stack pointers, swapping the correct >pointer into the real stack pointer when required. > >This raises a couple of questions: > >First, are 64 words of control and operand stack enough? How deeply >nested to FORTH words typically get? Well, one opinion on that is expressed in the Forth 83-Standard, q.v. (downloadable from RCFB, phonenum below). But answer is qualified yes. >Second, does a typical FORTH program (coded with in-line primatives and >call-threaded) spend most of its time executing FORTH primatives or >executing the thread of control for user-written words? > Depends on the programmer, the system, etc., but the answer would tend towards the latter. Not all Forths are threaded the same. The new Forth Stack/RISC chips like the SC32 are VERY efficient in this respect. At the opposite extreme, an indirect-threaded Forth can spend 1/3 of its life executing the threading routine NEXT. There is all sorts of middle ground in this. Tell us more about what you are doing with the 29000! {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} {} {} {} jax@well ." Sysop, Realtime Control and Forth Board" FIG {} {} jax@chariot ." (303) 278-0364 3/12/2400 8-n-1 24 hrs." Chapter {} {} JAX on GEnie ." Tell them JAX sent you!" Coordinator {} {} {} {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}