1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00
Mirror of the upstream GNU Guile repository on Savannah. https://www.gnu.org/software/guile/
Find a file
Andy Wingo e6ac66a348 Allow test suite to test multiple targets.
* tests/Makefile: Allow for testing multiple targets.
2019-04-05 16:07:01 +02:00
lightening Support spilling args to stack 2019-04-04 17:06:57 +02:00
tests Allow test suite to test multiple targets. 2019-04-05 16:07:01 +02:00
.gitignore Rework naming of test suite files 2019-03-26 10:02:30 +01:00
.gitlab-ci.yml Tweak test build to run faster, and adapt CI 2019-03-26 12:32:08 +01:00
AUTHORS Prepare for the first alpha release of lightning 2.0. 2013-06-05 20:18:54 -03:00
ChangeLog Archive lightning ChangeLog 2018-10-30 11:42:08 +01:00
ChangeLog.lightning Archive lightning ChangeLog 2018-10-30 11:42:08 +01:00
COPYING switch to GPLv3 2008-01-09 15:50:13 +01:00
COPYING.DOC update FSF address 2008-01-09 15:49:29 +01:00
COPYING.LESSER switch to GPLv3 2008-01-09 15:50:13 +01:00
lightening.h Fix implementation of jit_{gpr,fpr}_is_callee_save 2019-04-04 11:08:54 +02:00
lightning.texi Move lightning.texi up to root, and remove Makefile.am 2018-10-30 11:35:53 +01:00
NEWS Second alpha release 1.99a 2013-07-08 11:58:03 -03:00
README.md Change headers and files to be named "lightening" instead of "jit" 2019-04-03 13:57:48 +02:00
THANKS Implement a correct generation of Fibonacci numbers. 2015-11-30 15:32:48 -02:00

Lightening

Lightening is a just-in-time code generation library derived from GNU Lightning, adapted to the purposes of the GNU Guile project.

Use

gcc -flto -O2 -g -o lightening.o -c lightening/lightening.c
gcc -flto -O2 -g -o my-program lightening.o my-program.c

See the GNU Lightning manual for more on how to program against Lightening (much of the details are the same).

What's the difference with GNU Lightning?

This project is called Lightening because it's lighter-weight than GNU Lightning. When you go to generate code at run-time with GNU Lightning, what happens is that you build up a graph of nodes which GNU Lightning "optimizes" before finally emitting machine code. These optimizations can improve register allocation around call sites. However they are not helpful from a Guile perspective, as they get in the way of register allocation that we need to do; and they actually prevent access to all the registers that we would like to have.

Guile needs a simple, light-weight code generation library. The GNU Lightning architecture-specific backends provide the bulk of this functionality, and Lightening wraps it all in a lightweight API.

Status

Only the x86-64 port is currently usable. I plan to re-enable 32-bit x86 shortly, and then work on 32-bit and 64-bit ARM. Other architectures may come with time, but help is very much appreciated there. The test suite is still in progress but will be fairly comprehensive in terms of API surface.