"Jenny Brien" <jennifer@[EMAIL PROTECTED]
> wrote in message
news:op.t4r035zcaozhuq@[EMAIL PROTECTED]
> On Fri, 11 Jan 2008 08:34:02 -0000, Rod Pemberton
> <do_not_have@[EMAIL PROTECTED]
> wrote:
> > "Jenny Brien" <jennybrien@[EMAIL PROTECTED]
> wrote in message
> >
news:ab815318-9e67-4709-a479-a5fdae1bd429@[EMAIL PROTECTED]
> >> I'm interested in the minimal set needed to implement the normal
Forth
> >> stack operators.
> >
> > Then these might be of use which use rstack:
> >
> I'm thinking more of minimal hardware requirement in terms of registers
> and opcodes. I know that it's /possible/ to do any manipulation with
just
> the two stacks and a single register, but it's not very efficient.
>
What is your background EE or CS, etc.? Is this for an existing cpu? new
cpu? virtual machine?
> I'm thinking more of minimal hardware requirement in terms of registers
> and opcodes.
What do you have or are considering so far? I've been mentioning x86
(80486
or later actually) since that's what I'm currently using. As shown
throughout this thread, some of the FORTH words map directly to the
instructions of x86 which are somewhat "****table", e.g., more RISC like
than
CISC (push,pop,mov). While others can be built from those, and probably
only a few require the more "non-****table" x86 CISC instructions.
Although I'm mildy familiar with programming in FORTH, I'm by no means a
FORTH programmer. I know much more about the internals of FORTH than
programming in it - which is why I've kept asking _you_ questions about
used
words, etc... And, why I'm a bit surprised no one has referred me to the
c.l.f. FAQ. Anyway, there is much in this thread, and probably other
c.l.f.
posts searchable via Google Groups.
I've mentioned Koopman a few times in this thread, but without indication
of
familiarity or lack of from you. Are you familiar with FORTH related
works
of Charles Moore, Leo Brodie, Anton Ertl, Brad Rodriquez, Phil Koopman,
Jim
Brooks, Byte magazine articles? E.g., have you reviewed Charles Moore's
various cpu's such as the F21? Or, his Machine or Color FORTH for his
cpu's?
I'm sure they did much work trying to find the optimal set of registers
needed for FORTH. They may have even tried to optimize the FORTH words.
What about Phil Koopman's analysis on FORTH instruction usage? The
dynamic
instruction frequencies, while out of date, should still be somewhat valid
today. Are you familiar with a basic FORTH virtual machine as presented
by
Brad Rodriquez in "Moving FORTH", e.g., W, IP, PSP, RSP, UP, and/or X,
TOS?
Differences between "threading" types: STC, DTC, ITC, TTC? I'm familiar
with much of that, but what I learned of it was many years ago... roughly
'88 and '92 - so I've probably forgotten much - perhaps even some things
critical to this discussion... But, fortunately, almost all of it is
online
today and I can review. :-)
Some links related to what we've been discussing:
"A STUDY OF FORTH INSTRUCTION FREQUENCIES" in "Stack Computers" by Phil
Koopman
http://www.ece.cmu.edu/~koopman/stack_computers/sec6_3.html
"Stack Computers" main index
http://www.ece.cmu.edu/~koopman/stack_computers/index.html
Chuck Moore's F21 cpu, MachineFORTH et. al...
http://www.ultratechnology.com/
Brad Rodriquez's "Moving FORTH" series on older FORTH implementations.
http://www.zetetics.com/bj/papers/
Jim Brooks "Fig-FORTH internals"
http://www.jimbrooks.org/web/forth/forthInternals.php
> The fastest code needs at least n+1 registers or stacks to re-sort n
> items. If all were are on the hardware stack to begin with then 2SWAP
> would take 8 moves (pop all to registers, push all back in order),
reduced
> to 6 with the top two items cached. Using a second stack instead of
> multiple registers hurts more than I thought at first; using my rcheme I
> cannot implement 2SWAP in fewer than 13 moves.
Is this for an existing cpu? If not, then you just renumber or reorder
the
registers using electronic circuitry for a SWAP,ROLL,ROT. You don't have
to
actually move the values around... If so, then a fast native ROT or ROLL
would help for 2SWAP.
:2SWAP ROT >R ROT R>;
:2SWAP 3 ROLL 3 ROLL;
For ****fting more than just a few stack items on x86, i.e., you need ROLL
or
more than one ROT - like for 2SWAP, you might consider using one of x86's
underused CISC string instructions, rep movsb, instead of a sequence of
push's, pop's, and mov's. It requires some overhead to setup, so it's
probably not good for smaller moves... i.e., good for n ROLL, if n is
large
enough.
Rod Pemberton


|
53 Posts in Topic:
|
"Rod Pemberton" |
2008-01-06 00:26:01 |
|
mhx@[EMAIL PROTECTED]
(M |
2008-01-06 09:22:17 |
|
"Rod Pemberton" |
2008-01-06 04:37:47 |
|
mhx@[EMAIL PROTECTED]
(M |
2008-01-06 11:00:53 |
|
"Rod Pemberton" |
2008-01-06 06:10:48 |
|
"Rod Pemberton" |
2008-01-06 06:24:17 |
|
mhx@[EMAIL PROTECTED]
(M |
2008-01-06 12:58:34 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 08:27:20 |
|
Coos Haak <chforth@[EM |
2008-01-06 21:16:07 |
|
"Ed" <nospam |
2008-01-07 17:51:08 |
|
Albert van der Horst < |
2008-01-07 17:22:03 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 13:00:32 |
|
none <""jan\ |
2008-01-06 14:07:31 |
|
mhx@[EMAIL PROTECTED]
(M |
2008-01-06 15:27:04 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 08:32:53 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 08:05:30 |
|
stephenXXX@[EMAIL PROTECT |
2008-01-06 13:42:55 |
|
"Rod Pemberton" |
2008-01-06 06:09:25 |
|
stephenXXX@[EMAIL PROTECT |
2008-01-06 13:46:06 |
|
"Rod Pemberton" |
2008-01-06 18:25:08 |
|
stephenXXX@[EMAIL PROTECT |
2008-01-07 10:58:44 |
|
"Rod Pemberton" |
2008-01-07 21:39:25 |
|
"Rod Pemberton" |
2008-01-07 22:57:58 |
|
Albert van der Horst < |
2008-01-08 08:13:03 |
|
"Rod Pemberton" |
2008-01-08 05:07:03 |
|
Albert van der Horst < |
2008-01-08 18:26:32 |
|
Alex McDonald <blog@[E |
2008-01-08 03:04:52 |
|
Roelf Toxopeus <these3 |
2008-01-06 15:24:29 |
|
winston19842005 <bjjly |
2008-01-06 10:13:11 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 08:01:26 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 08:52:02 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 08:54:01 |
|
Bernd Paysan <bernd.pa |
2008-01-06 18:34:43 |
|
helmwo@[EMAIL PROTECTED]
|
2008-01-06 10:27:48 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 13:26:05 |
|
Bernd Paysan <bernd.pa |
2008-01-06 23:02:25 |
|
kenney@[EMAIL PROTECTED]
|
2008-01-07 09:47:13 |
|
foxchip <fox@[EMAIL PR |
2008-01-06 13:43:00 |
|
Jenny Brien <jennybrie |
2008-01-08 14:06:38 |
|
Bill <bill@[EMAIL PROT |
2008-01-08 21:20:47 |
|
"Rod Pemberton" |
2008-01-09 04:57:34 |
|
Jenny Brien <jennybrie |
2008-01-10 09:50:29 |
|
"Rod Pemberton" |
2008-01-11 03:34:02 |
|
"Jenny Brien" & |
2008-01-11 17:49:07 |
|
"Rod Pemberton" |
2008-01-12 04:31:21 |
|
astrobe <fdubois76@[EM |
2008-01-14 09:31:33 |
|
foxchip <fox@[EMAIL PR |
2008-01-19 10:11:10 |
|
stephenXXX@[EMAIL PROTECT |
2008-01-20 15:33:32 |
|
ygrek <ygrek@[EMAIL PR |
2008-01-06 12:31:47 |
|
"Rod Pemberton" |
2008-01-06 17:58:45 |
|
anton@[EMAIL PROTECTED]
|
2008-01-06 18:22:00 |
|
"Rod Pemberton" |
2008-01-06 18:18:56 |
|
ygrek <ygrek@[EMAIL PR |
2008-01-07 09:05:18 |
|