tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Re: C67 Support


From: Fabrice Bellard
Subject: Re: [Tinycc-devel] Re: C67 Support
Date: Sun, 16 Mar 2003 15:12:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.1) Gecko/20020828

Peter "Firefly" Lund wrote:
On Sun, 16 Mar 2003, Fabrice Bellard wrote:


ELF is very simple if no relocation are done. All we need is to define a
correspondant machine id for TMS320C6xx.


I know -- but if tcc is the only tool that uses ELF, what's the point ?

You are right :-) I made this proposal just to ensure that the ELF/COFF generator can be selected independantly from the CPU.

Ok for pointer and longs (it is needed for 64 bit CPUs). For ints I am
not sure it is useful and it would be more complicated.


For easier portability testing using only one machine -- no, I don't know
how hard it would be and of course it is not like I'm going to push
patches for it to you tomorrow.  tcc needs many other things first.


Do you agree that only compile time selection is needed for that ?


Errr... possibly yes.  Compile-time for what?  For the compiler?  No.
For the compiled program?  Why, naturally.

Sorry, I meant compile time when compiling the compiler. It means that you won't have an option tcc -EL or tcc -EB to force little or big endian for example.

Bochs is incredibly slow and written in C++.


Some of the slow speed is because it has to handle the hardware and it
does that in a not so efficient way.  Some of it is because it has to
handle memory mapping.  Some of it is due to a speed bug in the screen
updating code.  And then some of it is due to it not being a JIT -- but
that is not the most important part.

Right. From what I have seen in the code of bochs, it would be difficult to use it as a fast user space emulator (dispatching is done with functions, lazy flag evaluation is not optimal). Moreover, I find the code of bochs quite redundant - I factorized all the opcodes which gives a rather small and simple code.

Let me guess...

1) You first write a main loop as an interpreter with a big switch in it.
2) when that works you compile (in the true sense of the word) snippets
from that switch between the cases as the translation for a piece of code.

I got that idea, too, about a year ago (I was playing with Moscow ML to
see how I could speed it up).  Unfortunately, somebody else had invented
that technique and published on it in 1998:

http://citeseer.nj.nec.com/piumarta98optimizing.html

(my actual implementation was somewhat different: it required less code
and was slightly faster and tighter but you had to inspect the code the
compiler generated -- but you really have to with Piumarta/Riccardi's
implementation, too, because it is not as truly portable as it looks like)

Thank you for the reference - I'll add it in the documentation. I was sure I did not invent this method since 'executor' was also using similar ideas. But I went much further than explained in the article you mention, at the cost of slightly more CPU dependancy (the CPU dependancy is about the same as a dynamic linker such as ld.so). The goal was to achieve higher speed than just suppressing the dispatch stage.

Fabrice.





reply via email to

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