I've just been looking at the TCC compiler.

http://bellard.org/tcc/

Advantages:
=========

- Cross platform - works on Windows and Linux
- Almost C99 compliant
- Supports GNU inline asm
- Compiles GNU .asm files
- Compiles and links unbelievably quickly, even on Windows
- Very small comprehensible codebase
- LGPL v2+
- produces native Windows binaries

Disadvantages:
===========

- Doesn't support SSE asm instructions (probably wouldn't be hard to
add support for these - the codebase is quite comprehensible)
- 32 bit x86 assembly only (the latest version supports "x86_64
targets", but I am not sure what this means)
- probably doesn't optimise as well as gcc (though I did some basic
loop timings and they were fine)

Well I just had a play, and it assembled almost all the k8 .asm files
in MPIR and almost all of the mpn .c files. The exceptions were the
multifunction files, due to the fact that a couple of defines are
missing (easily fixed and my fault) and perfsqr.c (perfsqr.h is
missing - also not the fault of tcc). It takes about 6s total to
assemble and compile all that stuff! That's faster than a 16 core
parallel build on Selmer!!!!!!!!!!!!!!!!

There also seems to be some issue with alloca.h which I needed to work
around, as I know nothing about alloca.h.

I'm actually really keen to build MPIR with TCC because I can also use
TCC to build FLINT on Windows. I checked and the longlong.h I use for
FLINT compiles fine with tcc. The only issue I can find with using it
to compile FLINT is that for (unsigned long i = 0; i < count; i++)
doesn't compile. It expects unsigned long i; for (i = 0; i < count;
i++). However a very simple script could easily fix this for all files
in FLINT. I'm sure this could also be easily fixed in TCC itself as
they are moving towards full c99 support and quite a few gnu
extensions.

There seem to be some issues with tcc development stalling, but it
isn't a dead project. The last release was May 20th.

I'm kind of confused about one thing. It looks to me that it supports
linux calling conventions. This is great if true, but maybe the
calling conventions don't differ on x86 32?

Anyhow, unless someone talks me out of it, I'm going to make a git
repo for MPIR-tcc tomorrow on Selmer. If anyone would like to help,
just let me know. I plan to use MinGW for M4, makefiles and a basic
script environment. That could be totally avoided with little effort,
but I think in the long run it'll just be a lot easier.

Bill.

--

You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.


Reply via email to