home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!ames!agate!rsoft!mindlink!a684
- From: Nick_Janow@mindlink.bc.ca (Nick Janow)
- Subject: Re: What's wrong with stack machines?
- Organization: MIND LINK! - British Columbia, Canada
- Date: Fri, 6 Nov 1992 05:44:19 GMT
- Message-ID: <17189@mindlink.bc.ca>
- Sender: news@deep.rsoft.bc.ca (Usenet)
- Lines: 41
-
- lindsay+@cs.cmu.edu (Donald Lindsay) writes:
-
- > Surely typical stack-language programs can be mechanically transformed
- > (recompiled) into non-stack forms.
-
- Sure, and you can emulate a 486 on a 6502; it just doesn't run as fast.
- Stack-oriented programs tend to have a lot of subroutine calls. This would
- bog down a non-stack processor. There are other programming techniques that
- run fast on a stack machine, but not on a non-stack one. I don't think you
- can mechanically transform that stack program to one that runs efficiently on
- a non-stack processor. Stack-oriented programs are structurally different
- from non-stack programs.
-
- > As far as I can tell, the only win for stack machines is code density when
- > speed doesn't matter.
-
- Stack machines tend to be smaller and simpler than the typical processors
- coming out these days (486, Alpha, SPARC, etc), without compromising speed.
- Looking at it the other way, for the same amount of silicon and engineering
- effort, the stack machine would probably be a lot faster.
-
- Code density does affect speed in many cases. If you only have 8Kbytes of
- high-speed RAM, wouldn't you like to be able to stick much of the program in
- that space? Stack machines are optimized for code re-use.
-
- A processor with multiple stacks is probably easier to design for parallel
- operations than one with a large array of random access registers. The RTX,
- for example, allows simultaneous access (one clock cycle) to both stacks,
- memory, and two I/O ports. Future processors might add a floating point
- stack, a string stack, a logic (IF, WHILE, etc) stack, a locals stack, or any
- other specialized stack that was appropriate. Memory access could be split
- into data and instruction. Parallel processing ports could be added. Note
- that present stack processors offer high performance without pipelining or
- memory caching.
-
- Processor design has mainly focused on optimizing for non-stack languages;
- there's a lot to explore in stack processor hardware and software design.
-
- --
-
- Nick_Janow@mindlink.bc.ca
-