tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Stack based target machine


From: Nick Kelsey
Subject: Re: [Tinycc-devel] Stack based target machine
Date: Wed, 22 Jun 2005 08:58:00 -0700
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hi Anton,

Very interesting.

Have you looked at GNU cgen?
It is a related concept in some ways - you write a script to describe the architecture and it generates a big chunk of the assembler port (GAS) and generates the simulator code for running c-torture simulation (via GDB I think). The catch - the script is a Scheme script and compiled with Guile... completely unreadable :-)

With your application I can see two big advantages:
1) The script is highly readable - huge plus
2) The host VM code will integrate well with other applications (ie not targeted only for use with building a new GNU toolchain). A little bit of generic wrapper code and the VM could be linked to provide a simulator that fits the GNU testbed model. The question would be how practical/interesting/useful would it be to extend to include a description of the assembler language and getting it to generate the bulk of the assembler port?

On the subject of TCC am making progress - TCC is simple and elegant once you get your head around a few things. I will post back once the core of the backend is in a more useful state. Looking at generated code there are some obvious situations where adding another instruction to the instruction set will help... I am sure there are lots more that are not so obvious... if you are interested I would welcome your help.

Nick

Anton Ertl wrote:

*This message was transferred with a trial version of CommuniGate(tm) Pro*
Nick Kelsey wrote:
Unfortunately they have insufficient resources to run TCC natively, so I am looking at compiling to a virtual machine.

In November I wrote here about using Vmgen
<http://www.complang.tuwien.ac.at/anton/vmgen/> to build a stack-based
VM for tcc.  For such a project I would volunteer to do the work
having to do with Vmgen, but I would need to cooperate with someone
who finds his way around tcc and can deal with the object file
format.

For your project, Vmgen would not help you for the VM interpreter on
the embedded platform, but if you also want an interpreter on the
server side for debugging the programs or the tcc port, it might still
be worth it.

I am leaning towards the idea of a stack based VM to keep things simple on the VM side (ie no general purpose registers thus no register decoding and addressing required by the host cpu). In reality the hardest aspect will be the compiler port so that will dictate the VM architecture more than anything else.

Yes.  I am more a believer in stack-based VMs myself, but in your case
a register-based VM might be beneficial; however, it's probably best
to do what fits easiest in tcc.

- anton


_______________________________________________
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]