[LWN Logo]

From: Larry Smith <lcs@zk3.dec.com>
Subject: Re: Linux and Merced
Date: Mon, 16 Mar 1998 11:57:58 -0500

There is one thing that might get Linux running on Merced in
a viable way that doesn't require herculean efforts to write
complex backends for complex compilers.  I happened to kind
of flash on this on the way into work this morning: gcc can
already generate some type of p-code, I've read.  If someone
were to sit down with a running Merced and write a savvy little
p-code interpreter for it - even one using a proprietary C -
we could, in theory, port Linux to the p-machine and run as an
interpreter program.

Optimizing a p-code interpreter for Merced's three-way multi-
plexing is a special case of the general problem a code generator
has to solve, which makes it a lesser effort.  If the entire
interpreter can fit into cache - not unreasonable given the sizes
of cache Intel is telling us about - then the resulting interpre-
ter could run without _ever_ generating a cache miss for an in-
struction.  Couple that with the reduced size of p-code execut-
ables - p-code is typically one twentieth the size of a RISC
binary, maybe smaller - the size of a typical distribution could
drop to fifteen or sixteen megabytes - small enough to _load_the_
entire_distribution_into_memory_, and run without ever swapping
code.  The bottom line could be a system fully as fast as any
native code version despite the overhead of interpreting, if the
p-code gcc generates is any good.  Certainly it would be a way
for Linux to survive on the next generation hardware until some-
one can write a code generator.

Just a random thought.

-- 
 .-.   .---..---. .---. .-..-. |Politics is the art of looking for
 | |__ | | || |-< | |-<  >  /  |trouble, finding it, misdiagnosing
 `----'`-^-'`-'`-'`-'`-' `-'   |it and then  misapplying the wrong
My opinions. Edit addr to reply|remedies.             Groucho Marx