Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #21361

Re: MISC - Stack Based vs. Register Based

From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.lang.forth, comp.arch.fpga
Subject Re: MISC - Stack Based vs. Register Based
Date 2013-04-04 02:07 +0000
Organization Aioe.org NNTP Server
Message-ID <kjin8q$so5$1@speranza.aioe.org> (permalink)
References (1 earlier) <kj7mqk$17p$1@speranza.aioe.org> <5157e1a1$0$6924$e4fe514c@news2.news.xs4all.nl> <kjd7gp$t0n$1@speranza.aioe.org> <kjf48e$5qu$1@dont-email.me> <kjihkv$gdm$1@speranza.aioe.org>

Cross-posted to 2 groups.

Show all headers | View raw


In comp.arch.fpga Rod Pemberton <do_not_have@notemailnotq.cpm> wrote:
> "rickman" <gnuarm@gmail.com> wrote in message
> news:kjf48e$5qu$1@dont-email.me...
>> Weren't you the person who brought CISC into this discussion?
 
> Yes.
 
>> Why are you asking this question about CISC?
 
> You mentioned code density.  AISI, code density is purely a CISC
> concept.  They go together and are effectively inseparable.

They do go together, but I am not so sure that they are inseperable.

CISC began when much coding was done in pure assembler, and anything
that made that easier was useful. (One should figure out the relative
costs, but at least it was in the right direction.)

That brought instructions like S/360 EDMK and VAX POLY. 
(Stories are that on most VAX models, POLY is slower than an
explicit loop.) Now, there is no need to waste bits, and so 
instruction formats were defined to use the available bits.

S/360 (and successors) only have three different instruction lengths,
and even then sometimes waste bits. 

The VAX huge number of different instructions lengths, and also IA32,
does seem to be for code size efficiency. VAX was also defined with
a 512 byte page size, even after S/370 had 2K and 4K pages.
Way too small, but maybe seemed right at the time.

> RISC was about effectively using all the processor clock cycles by
> using fast instructions.  RISC wasn't concerned about the encoded
> size of instructions, how much memory a program consumed, the
> cost of memory, or how fast memory needed to be.

Yes, but that doesn't mean that CISC is concerned with the size
of instructions. 
 
> CISC was about reducing memory consumed per instruction.  CISC
> reduced the average size of encoded instructions while also
> increasing the amount of work each instruction performs.  

Even if it is true (and it probably is) that CISC tends to make
efficient use of the bits, that doesn't prove that is what CISC
was about. 

As above, CISC was about making coding easier for programmers,
specifically assembly programmers. Now, complex instructions take
less space than a series of simpler instructions, but then again
one could use a subroutine call. 

The PDP-10 has the indirect bit, allowing for nested indirection,
which may or may not make efficient use of that bit. S/360 uses
a sequence of L (load) instructions to do indirection. 

Instruction usage statistics noting how often L (load) was 
executed in S/360 code may have been the beginning of RISC.

> CISC was typically little-endian to reduce the space needed 
> for integer encodings.  

This I don't understand at all. They take the same amount
of space. Little endian does make it slightly easier to
do a multiword (usually byte) add, and that may have helped
for the 6502. It allows one to propagate the carry in the
same order one reads bytes from memory. 

But once you add multiply and divide, the advantage is pretty 
small. 

> However, increasing the amount of work per instruction
> produces highly specialized instructions that are the
> characteristic of CISC.  You only need to look at the x86
> instruction set to find some, e.g., STOS, LODS, XLAT, etc.  They
> are also slow to decode and execute as compared to RISC.

Those are not very CISCy compared with some S/360 or VAX 
instructions. Now, compare to S/360 TR which will translate
by looking up bytes in a lookup table for 1 to 256 byte
long strings. (Unless I remember wrong, XLAT does one byte.)
 
> So, if memory is cheap and fast, there is no point in improving
> code density, i.e., use RISC.  If memory is expensive or slow, use
> CISC.

Well, RISC is more toward using simpler instructions that compilers
actually generate and executing them fast. Having one instruction
size helps things go fast, and tends to be less efficient with bits.

Even so, I believe that you will find that RISC designers try to
make efficient use of the bits available, within the single size
instruction constraint.
 
> Arlet mentioned changes to a processor that appeared to me to have
> nothing to do with increasing or decreasing code density.  AISI,
> the changes he mentioned would only affect what was in current set
> of MISC instructions, i.e., either a set of register-based MISC
> instructions or a set of stack-based MISC instructions.  This was
> stated previously.

Decoding multiple different instruction formats tends to require
complicated demultiplexers which are especially hard to do in
an FPGA. Even so, one can make efficient use of the bits
and still be MISC.

-- glen

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-03-29 17:00 -0400
  Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-03-29 21:43 +0000
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-03-29 20:28 -0400
      Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-03-31 18:34 +0000
        Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-02 09:54 -0400
          Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-02 17:20 +0000
            Re: MISC - Stack Based vs. Register Based David Brown <david@westcontrol.removethisbit.com> - 2013-04-03 09:12 +0200
    Re: MISC - Stack Based vs. Register Based Jon Elson <jmelson@wustl.edu> - 2013-04-01 15:11 -0500
  Re: MISC - Stack Based vs. Register Based AKE <assadebrahim2000@gmail.com> - 2013-03-29 18:19 -0700
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-03-30 18:50 -0400
      Re: MISC - Stack Based vs. Register Based Jecel <jecel@merlintec.com> - 2013-04-01 13:18 -0700
        Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-02 10:50 -0400
          Re: MISC - Stack Based vs. Register Based Jecel <jecel@merlintec.com> - 2013-04-02 23:39 -0700
            Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-03 09:54 -0400
              Re: MISC - Stack Based vs. Register Based Jecel <jecel@merlintec.com> - 2013-04-05 14:30 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 17:53 -0400
                Re: MISC - Stack Based vs. Register Based Jecel <jecel@merlintec.com> - 2013-04-06 13:27 -0700
                Re: MISC - Stack Based vs. Register Based Jecel <jecel@merlintec.com> - 2013-04-06 13:37 -0700
        Re: MISC - Stack Based vs. Register Based Paul Rubin <no.email@nospam.invalid> - 2013-04-07 15:21 -0700
          Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-08 01:24 -0400
            Re: MISC - Stack Based vs. Register Based Syd Rumpo <usenet@nononono.co.uk> - 2013-04-08 10:18 +0100
          Re: MISC - Stack Based vs. Register Based Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-08 04:18 -0500
  Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-03-30 08:20 +0100
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-03-30 19:00 -0400
      Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-03-31 13:20 +0200
  Re: MISC - Stack Based vs. Register Based "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-03-30 17:54 -0400
    Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-03-31 09:11 +0200
      Re: MISC - Stack Based vs. Register Based "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-01 20:10 -0400
        Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-02 00:54 +0000
          Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-02 13:31 -0400
            Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-02 19:03 +0000
        Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-02 08:25 +0200
          Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-02 13:33 -0400
        Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-02 13:26 -0400
          Re: MISC - Stack Based vs. Register Based "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-03 20:34 -0400
            Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-04 02:07 +0000
              Re: MISC - Stack Based vs. Register Based albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-04-04 11:16 +0000
                Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-04 13:25 +0200
                Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-04 12:44 +0000
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-04 17:04 -0400
                Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-04 21:34 +0000
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-04 19:30 -0400
                Re: MISC - Stack Based vs. Register Based Mark Wills <markrobertwills@yahoo.co.uk> - 2013-04-05 00:41 -0700
                Re: MISC - Stack Based vs. Register Based Alex McDonald <blog@rivadpm.com> - 2013-04-04 15:30 -0700
                Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-04 23:15 +0000
                Re: MISC - Stack Based vs. Register Based Alex McDonald <blog@rivadpm.com> - 2013-04-04 17:26 -0700
                Re: MISC - Stack Based vs. Register Based albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-04-05 01:17 +0000
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 18:00 -0400
                Re: MISC - Stack Based vs. Register Based "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-08 23:55 -0400
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-04 20:07 -0400
                Re: MISC - Stack Based vs. Register Based Mark Wills <markrobertwills@yahoo.co.uk> - 2013-04-05 00:51 -0700
                Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-05 14:31 +0200
                Re: MISC - Stack Based vs. Register Based Mark Wills <markrobertwills@yahoo.co.uk> - 2013-04-05 07:33 -0700
                Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-05 17:01 +0200
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 18:25 -0400
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-06 17:44 -0400
                Re: MISC - Stack Based vs. Register Based Brad Eckert <hwfwguy@gmail.com> - 2013-04-05 10:14 -0700
                Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-05 20:13 +0200
                Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-05 20:15 +0200
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 18:54 -0400
                Re: MISC - Stack Based vs. Register Based Brad Eckert <hwfwguy@gmail.com> - 2013-04-08 09:57 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-09 10:13 -0400
                Re: MISC - Stack Based vs. Register Based Brad Eckert <hwfwguy@gmail.com> - 2013-04-09 08:55 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-09 14:40 -0400
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 18:49 -0400
                Re: MISC - Stack Based vs. Register Based daveyrotten <danw8804@gmail.com> - 2013-04-09 13:02 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-09 16:07 -0400
                Re: MISC - Stack Based vs. Register Based daveyrotten <danw8804@gmail.com> - 2013-04-09 13:26 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-10 00:33 -0400
                Re: MISC - Stack Based vs. Register Based daveyrotten <danw8804@gmail.com> - 2013-04-10 07:08 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-10 10:13 -0400
                Re: MISC - Stack Based vs. Register Based Sieur de Bienville <morrimichael@gmail.com> - 2013-04-10 21:08 -0700
                Re: MISC - Stack Based vs. Register Based Paul Rubin <no.email@nospam.invalid> - 2013-04-10 22:47 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-11 16:32 -0400
                Re: MISC - Stack Based vs. Register Based "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-18 06:23 -0400
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-18 17:06 -0400
                Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-05 17:33 +0000
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-06 17:37 -0400
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 18:08 -0400
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-06 17:32 -0400
                Re: MISC - Stack Based vs. Register Based Brian Davis <brimdavis@aol.com> - 2013-04-07 14:59 -0700
                Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-08 01:16 -0400
                Re: MISC - Stack Based vs. Register Based albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-04-08 09:52 +0000
            Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-03 22:42 -0400
            Re: MISC - Stack Based vs. Register Based Alex McDonald <blog@rivadpm.com> - 2013-04-04 16:07 -0700
              Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-05 04:10 +0000
                Re: MISC - Stack Based vs. Register Based Alex McDonald <blog@rivadpm.com> - 2013-04-04 23:49 -0700
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-02 12:04 -0400
      Re: MISC - Stack Based vs. Register Based "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-03 20:35 -0400
        Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-04 00:09 -0400
  Re: MISC - Stack Based vs. Register Based the_gavino_himself <visphatesjava@gmail.com> - 2013-04-02 11:17 -0700
  Re: MISC - Stack Based vs. Register Based Syd Rumpo <usenet@nononono.co.uk> - 2013-04-04 09:38 +0100
    Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-04 11:31 +0200
      Re: MISC - Stack Based vs. Register Based "Elizabeth D. Rather" <erather@forth.com> - 2013-04-04 08:36 -1000
        Re: MISC - Stack Based vs. Register Based Brad Eckert <hwfwguy@gmail.com> - 2013-04-05 10:21 -0700
          Re: MISC - Stack Based vs. Register Based "Elizabeth D. Rather" <erather@forth.com> - 2013-04-05 07:53 -1000
    Re: MISC - Stack Based vs. Register Based glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-04-04 12:49 +0000
      Re: MISC - Stack Based vs. Register Based Arlet Ottens <usenet+5@c-scape.nl> - 2013-04-04 15:02 +0200
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-04 18:57 -0400
  Re: MISC - Stack Based vs. Register Based AKE <assadebrahim2000@gmail.com> - 2013-04-05 15:29 -0700
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-05 19:32 -0400
      Re: MISC - Stack Based vs. Register Based anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-06 14:16 +0000
        Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-06 15:50 -0400
          Re: MISC - Stack Based vs. Register Based mhx@iae.nl (Marcel Hendrix) - 2013-04-07 01:33 +0200
            Re: MISC - Stack Based vs. Register Based AKE <assadebrahim2000@gmail.com> - 2013-04-07 02:57 -0700
              Re: MISC - Stack Based vs. Register Based stephenXXX@mpeforth.com (Stephen Pelc) - 2013-04-07 11:02 +0000
              Re: MISC - Stack Based vs. Register Based anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-07 13:51 +0000
                Re: MISC - Stack Based vs. Register Based "Elizabeth D. Rather" <erather@forth.com> - 2013-04-07 09:16 -1000
            Re: MISC - Stack Based vs. Register Based anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-07 14:13 +0000
              Re: MISC - Stack Based vs. Register Based mhx@iae.nl (Marcel Hendrix) - 2013-04-07 17:14 +0200
                Re: MISC - Stack Based vs. Register Based anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-07 15:31 +0000
            Re: MISC - Stack Based vs. Register Based Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-08 18:53 +0200
          Re: MISC - Stack Based vs. Register Based anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-07 14:22 +0000
  Re: MISC - Stack Based vs. Register Based "WJ" <w_a_x_man@yahoo.com> - 2013-04-14 00:19 +0000
    Re: MISC - Stack Based vs. Register Based rickman <gnuarm@gmail.com> - 2013-04-14 09:44 -0400
    Re: MISC - Stack Based vs. Register Based Brad Eckert <hwfwguy@gmail.com> - 2013-04-15 09:39 -0700
      Re: MISC - Stack Based vs. Register Based Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-15 19:28 +0200

csiph-web