GCC JIT vs others JIT ....

David Malcolm dmalcolm@redhat.com
Tue Jan 1 00:00:00 GMT 2013


On Wed, 2013-10-23 at 13:22 -0200, Paulo César Pereira de Andrade wrote:

Hi Paulo

> 2013/10/22 Basile Starynkevitch <basile@starynkevitch.net>:
> > Hello David Malcom and all,
> >
> > I am trying to understand what are the conceptual differences between
> > GCC JIT (when it will be mature enough) and other JIT libraries like GNU
> > lightning http://www.gnu.org/software/lightning/ or LLVM
> > http://llvm.org/ or GNU libjit http://www.gnu.org/software/libjit/ from
> > the point of view of the developer using the JIT library.
> >
> > GNU lightning is probably much lower level than GCC JIT. It probably has
> > the advantage of generating quickly rather slow machine code. It mostly
> > gives a small set of register like variables.
> 
>   GNU lightning does not use abstract "values", that may be either a
> register or an immediate, it is required to explicitly state if the argument
> is a register or an immediate, e.g. jit_addr(JIT_R0, JIT_R1, JIT_R2)
> and jit_addi(JIT_R0, JIT_R1, 2). When using immediates, they are
> always the last argument.
> 
>   GNU lightning major limitations are:
> o Can call varargs but does not create varargs jit functions
> o No dynamic alloca
> o No aggregate arguments/return by value
> 
>   The major advantages are:
> o Self contained, but binutils support is advised otherwise without
>   disassembly, debugging may be quite difficult.
> o Tailored for operations that need to know if there is overflow/carry
>   and have the values ready (carry/borrow only need to know about,
>   but multiplication high word and division remainder are quite useful).

...and I'm fairly sure that your code has a *much* lower overhead than
mine (but improving GCC's startup time feels like an interesting
challenge).

>   For starters, I would suggest looking at lightning's check/*.tst files,
> for an overview of how to generate code. For example, bp.tst for
> the classic recursive Fibonacci and fib.tst for the interactive one.
> Other tests may be complex due to using the C preprocessor to
> generate complex macros to brute force test all/most register/value
> combinations.

Thanks.  Looks like the tests use an assembler-like syntax, which I'm
guessing gets parsed by a test harness.

>   A more complex, still WIP, use case example of lightning is
> https://github.com/pcpa/owl (lib/oemit*c files are the lightning
> interfaces)

Thanks for the link (and indeed for the work on the code)

>   Well, enough GNU lightning advertising :-)

:-)

Cheers
Dave



More information about the Jit mailing list