home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / arch / 10417 < prev    next >
Encoding:
Text File  |  1992-11-05  |  3.6 KB  |  85 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!stanford.edu!bcm!rice!cliffc
  3. From: cliffc@rice.edu (Cliff Click)
  4. Subject: Re: RTX and SC32
  5. In-Reply-To: lamaster@pioneer.arc.nasa.gov's message of Wed, 4 Nov 1992 19:10:38 GMT
  6. Message-ID: <CLIFFC.92Nov5101357@miranda.rice.edu>
  7. Sender: news@rice.edu (News)
  8. Organization: Center for Research on Parallel Computations
  9. References: <17131@mindlink.bc.ca> <1992Nov4.191038.12063@news.arc.nasa.gov>
  10. Date: Thu, 5 Nov 1992 16:13:57 GMT
  11. Lines: 72
  12.  
  13. lamaster@pioneer.arc.nasa.gov (Hugh LaMaster) writes:
  14. >  So, the question remains:  are there any Forth operations which are not
  15. >  efficiently supported on the current crop of RISCs, and are on the 
  16. >  named Forth machines?  If so, what operations are they, and why?
  17. >  Could they be added to the current RISC architectures without major damage?
  18.  
  19. I try to compare a popular RISC (Sparc) to a hypothetical Forth machine,
  20. sort of the cross section of Forth machines I've seen.  Lets assume similar
  21. implementation technologies ('cause a Viking's going to blow the doors off
  22. any current Forth chip but it comes with 10x transistors).  Ok, here goes:
  23.  
  24. 1) Zero-cycle return
  25.  
  26.   The return is folded into the last arithmetic op of the subroutine.
  27.   The instruction following the subroutine call executes on the very next
  28.   cycle, no delay slot.  My Sparc (very RISCy) takes 2 cycles: 1 for 
  29.   the "return" and in the delay slot a "restore".  Note that getting the
  30.   return parameter into the TOS slot is only slightly less difficult than 
  31.   getting the return parameter into the return-result register.  Graph 
  32.   coloring register allocators win the day here.
  33.  
  34. 2) 1 cycle call
  35.  
  36.   Calls take 1 cycle, no delay slot.  On a Sparc, 1 for the call and 1 for
  37.   the "save".  
  38.  
  39. 3) (Sparc only) Hardware support for the stack
  40.  
  41.   Window overflow/underflow penalties are similar to the hardware supported 
  42.   stack overflow/underflow mechanisms on Forth machines.  However, the 
  43.   granularity on a Forth machine is much better (1 word vs 16) so that 
  44.   small recursive programs behave more reasonably.
  45.  
  46. 3) Denser code
  47.  
  48.   Forth machines tend to have 8 or 16 bit opcodes, and you do NOT always 
  49.   need gobs of 'em to get the same job done.  Personal experience suggests
  50.   the code is denser by up to a factor of 2.  Naturally the RISC guys can
  51.   throw silicon at this problem: big I-cache and a fat path to memory.
  52.  
  53. Many other things can remain essentially the same between the architectures.
  54. An 8 bit opcode can reference the top 16 stack elements, so 32 bits can
  55. do a "push r1", "push r2", "op", "pop r3" - basically imitate a 3-address
  56. instruction.  And I've seen the chip which can do all 4 in 1 50Mhz cycle
  57. (really it was a 200Mhz internal clock).  No Viking technology here, it was
  58. under 33,000 transistors.
  59.  
  60. You can cache the top 16/256/whatever stack elements onchip.
  61. You can multi-port access to the top 16 stack elements.
  62.  
  63. You can cache the top 16/whatever RETURN stack elements onchip as well.
  64. This is how the zero-cycle return works.
  65.  
  66. Of course, you can add an I-cache and D-cache as well.  But the built-in
  67. stacks basically amount to "caches" focused on serving a particular access
  68. pattern.
  69.  
  70. And now a soapbox:
  71.  
  72. Compiler technolgy is driven by computer archetectures.
  73. If a big-name company produced a blazing stack machine and handed a few
  74. out to CS departments doing compiler research, compiler researchers 
  75. (like myself, hint, hint) would find the moral equivalent of the
  76. "graph coloring register allocator" for stack machines.
  77.  
  78. End soapbox.
  79.  
  80.  
  81. Cliff
  82. --
  83. Through a gentle rain / the moon throws silver shadows /
  84. and tears fall like pearls.                    Cliff Click (cliffc@cs.rice.edu)
  85.