tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] TCC code generation for a stack based VM


From: Fabrice Bellard
Subject: Re: [Tinycc-devel] TCC code generation for a stack based VM
Date: Tue, 02 Nov 2004 21:13:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Hi,

I really think that a register based VM target would be simpler to add to TCC, and surely faster than a stack based VM.

I suggest the following parameters:

- 3 general integer registers, 3 general double registers, load and store based.

- For each instruction you have at most 3x3 = 9 versions, which you can generate easily with the C preprocessor.

- Each instruction is 16 bit wide, some are longer to integrate 16 or 32 bit constants. 16 bit wide ops can be interesting to avoid one table indirection in the interpreter loop.

- Extend the ELF format for this virtual machine so that you can generate object and executables easily.

Fabrice.

Mirar wrote:
Unfortunately it is not in my hands to change the requirements.


It was just an idea :)


On the other hand, if we would use TCC for JIT compiling then for
every new processor we would need to write a code generator wich we
would like to avoid.


Nah, you would require TCC to work for every new processor. The code
would stay the same (since it would be in C)? I didn't know you
switched processors that often.
TCC is rather small though (a few 100k), quite comparable to an
interpreter.

Why not make a registered based byte code interpreter, it might be
easier then rewriting tcc? (I haven't seen any answer whether tcc can
do that yet, but...)

/Mirar


_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel









reply via email to

[Prev in Thread] Current Thread [Next in Thread]