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

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!ukma!darwin.sura.net!sgiblab!sgigate!odin!mash.wpd.sgi.com!mash
  3. From: mash@mash.wpd.sgi.com (John R. Mashey)
  4. Subject: Re: What's wrong with stack machines? [$15 RISC versus RTX...]
  5. Message-ID: <1992Nov6.200453.26691@odin.corp.sgi.com>
  6. Sender: news@odin.corp.sgi.com (Net News)
  7. Nntp-Posting-Host: mash.wpd.sgi.com
  8. Organization: Silicon Graphics, Inc.
  9. References:  <17189@mindlink.bc.ca>
  10. Date: Fri, 6 Nov 1992 20:04:53 GMT
  11. Lines: 127
  12.  
  13. In article <17189@mindlink.bc.ca>, Nick_Janow@mindlink.bc.ca (Nick Janow) writes:
  14.  
  15. |> Stack machines tend to be smaller and simpler than the typical processors
  16. |> coming out these days (486, Alpha, SPARC, etc), without compromising speed.
  17. |> Looking at it the other way, for the same amount of silicon and engineering
  18. |> effort, the stack machine would probably be a lot faster.
  19. Maybe; but comparing an embedded-control implementation with these is
  20. apples-to-oranges...
  21. |> Code density does affect speed in many cases.  If you only have 8Kbytes of
  22. |> high-speed RAM, wouldn't you like to be able to stick much of the program in
  23. |> that space?  Stack machines are optimized for code re-use.
  24. Sure, but caches work, and in *fast* machines, I-cache bandwidth is much less of
  25. an issue than in dealing with D-cache misses...
  26.  
  27. |> A processor with multiple stacks is probably easier to design for parallel
  28. |> operations than one with a large array of random access registers.  The RTX,
  29. Why?
  30. |> for example, allows simultaneous access (one clock cycle) to both stacks,
  31. |> memory, and two I/O ports.  Future processors might add a floating point
  32. |> stack, a string stack, a logic (IF, WHILE, etc) stack, a locals stack, or any
  33. |> other specialized stack that was appropriate.  Memory access could be split
  34. |> into data and instruction.  Parallel processing ports could be added.  Note
  35. |> that present stack processors offer high performance without pipelining or
  36. |> memory caching.
  37. |> 
  38. |> Processor design has mainly focused on optimizing for non-stack languages;
  39. |> there's a lot to explore in stack processor hardware and software design.
  40. SO, if this is all true, why haven't stack machines taken over everything?
  41.  
  42. Let's look at some *data*:
  43.  
  44. There are many sweeping assertions above; one must be very careful
  45. to avoid apples-oranges comparions that end up in sweeping claims.
  46. In the useful article "Performance of the Harris RTX 2000 Stack Architecture
  47. versus the Sun 4 SPARC and Sun 3 M68020 Architectures", by
  48. Keown, Koopman, Collins, in Computer Archiecture News, 20, 3 (June 1992),
  49. there is some good information, including the proper qualifier near the
  50. beginning:
  51.  
  52. "The only stack architecture available to us for benchmarking is a 16-bit embedded controller which is not suitable for executing UNix or workstation
  53. applications.  Therefore, we chose to use the Stanford Integer benchmarks
  54. instead of the more comprehensive, but unsuitable for RTX execution,
  55. SPEC benchmarks."
  56.  
  57. The conclusions reached in the paper (RTX is OK in comparison with
  58. SUN-4-110 & 68020) are probably OK ... however, the 110 was not the most
  59. efficient implementation of SPARC, and some other RISCs were certainly
  60. more efficient than the early SPARC implementations.  Hence: 
  61.  
  62. Included are actual times for various CPUs [RTX @ 10Mhz, SPARC @ 14.28Mhz,
  63. MC68020 @ 16.7Mhz, for the Stanford Integer benchmarks.  To these I'll add
  64. corresponding times for 16.7Mhz Sun-4s, 16.7Mhz R2000s (MIPS RC2030),
  65. & 25Mhz R3000s (MIPS M/2000), from 1990's MIPS Performance Brief Issue 3.9:
  66.  
  67. Time in seconds:
  68. System        Bubble    Intmm    Perm    Queen    Quick    Tower
  69. RTX, 10Mhz    0.76    0.47    0.44    0.34    0.41    0.52
  70. SPARC, 14Mhz    0.22    0.42    0.15    0.12    0.19    0.25    Sun4-110
  71. SPARC, 16.7Mhz    0.12    0.15    0.11    0.09    0.12    0.17    Sun4-200
  72. R2000, 16.7Mhz    0.083    0.079    0.093    0.067    0.069    0.102    MIPS RC2030
  73. R3000,25Mhz    0.054    0.052    0.065    0.043    0.046    0.069    MIPS M/2000
  74.  
  75. REL PERF    9.2X    5.9X    4.7X    5.1X    5.9X    5.1X    R2000 > RTX
  76.  
  77.  
  78. Notes:
  79. 1) I have reasonable confidence that the versions of the benchmarks being
  80. used were reasonably consistent, by comparing the Sun4-110 & Sun4-200 numbers.
  81.  
  82. 2) These benchmarks, of course, are fairly small in code size, i.e.,
  83. like 500-1000 bytes of code.  Hence the large (for the time) caches on the
  84. SUns & MIPS machines turns out to be fairly irrelevant.
  85.  
  86. 3) The relative performance numbers compare 16.7MHz R2000 system to 10MHz RTX.
  87.  
  88. 4) Given the cache sizes used by these benchmarks, consider, for example,
  89. a 16.7MHz IDT R3041, which has (I think) 2KB of on-chip I-cache + 512 bytes
  90. of on-chip D-cache; being an R3000-derivative, it has cache refill characteristics more like the R3000 above than an R2000.  I'd guess that
  91. this chip would perform about the same as the R2000 above on these benchmarks;
  92. a 20Mhz one would be about that much faster.  Eyeballing this, it looks like
  93. if the clock rates were EQUAL, the 3041 would have a 3X performance
  94. advantage on these benchmarks.  (Of course, clock speeds are not equal; hence
  95. a 20Mhz 3041 would probably run 6X faster than a 10Mhz RTX....)
  96.  
  97. Despite being full 32-bit chips, here are the 3041 prices (in large quantities):
  98.     16.7Mhz:    $15
  99.     20Mhz        $19
  100. And, if you really need bigger caches, MMUs, etc, you can work your way up thru
  101. 5-6 versions with different combinations.
  102.  
  103. Now, this data says nothing about other attributs of the chips, including
  104. ability or not to run FORTH programs, context-switching, etc.  On the other
  105. hand, it pretty clearly says this particular stack architecture, for running
  106. the small C codes, is significantly outperformed by a $15 chip that shares
  107. the same instruction set used up though project supercomputers & mainframe-like
  108. systems, and that must pay the price in die space and cost for being 32 bits,
  109. rather than 16 bits.  It does NOT say there is no role for 16-bit, stack-oriented micro-controllers: if they do the job, they OUGHT to be cheaper and smaller.
  110.  
  111. HOWEVER, at least some chip families (such as MIPS) already have something like 12-15 different implementations. 
  112.  
  113. PLEASE STOP COMPARING a 16-bit microcontroller to the high-end implementations of such families, which have large caches, aggressive pipelines, MMUs, serious floating point, have 32-bit or even 64-bit architectures, and are required to run a wide variety of operating systems and languages well, and which are
  114. required to run at speeds that make simple memory systems impossible.  (As the
  115. cited paper says, " The RTX does not use cache memories, but instead uses
  116. system memory that is fast enough to guarantee single-cycle memory access."
  117. That's *exactly* the right thing to do if you are speed-constrained anyway ...
  118. and if we could design systems that had single-cycle access to main memory
  119. at 150Mhz, we'd be *really* happy, but we can't...) 
  120.   
  121. REASONABLE COMPARISONS compare against the $15 chips, not against the $500-1000 chips....  and I suspect the answers that come out are:
  122.     a) The embedded control world, there is room for a wide variety of
  123.     designs tuned for different things.
  124.     b) If code-space is *the* limiting problem, stack machines are good, or
  125.     maybe hybrid things like Hobbits.
  126.     c) If a (4,8, 16)-bit chip does the job, it ought to be cheaper
  127.     than using a 32-bit one; this is an orthogonal issue to stack versus
  128.     general register, of course.
  129.     d) FORTH chips will run FORTH effectively; the data above doesn't
  130.     suggest competitiveness on C code... 
  131.     e) When RISC is played for low-cost, it can get pretty low cost
  132.     and still keep good performance.  [It would be nice to have ARM
  133.     numbers, for example, but I don't have them handy].
  134.  
  135.  
  136. -john mashey    DISCLAIMER: <generic disclaimer, I speak for me only, etc>
  137. UUCP:    mash@sgi.com 
  138. DDD:    415-390-3090
  139. USPS:   Silicon Graphics 7U-005, 2011 N. Shoreline Blvd, Mountain View, CA 94039-7311
  140.