* configure.ac: Force -mlp64 to CFLAGS on HP-UX ia64 port.
It is the only supported mode, and expects gcc as C compiler.
* include/lightning.h, lib/jit_ia64-cpu.c, lib/jit_ia64.c:
Correct ia64 port to work on HP-UX that runs it in big endian
mode.
* configure.ac, check/Makefile.am, doc/Makefile.am: Do not
explicitly link to -ldl, but instead autodetect the library
with dlopen, dlsym, etc.
* check/lightning.c: Add workaround to apparently buggy
getopt in HP-UX that sets optind to the wrong index, and
use RTLD_NEXT on HP-UX instead of RTLD_DEFAULT to dlsym
global symbols.
* include/lightning.h: Rework definitions of wordsize and
byte order to detect proper values on HP-UX.
* lib/lightning.c: Minor correction to use MAP_ANONYMOUS
instead of MAP_ANON on HP-UX.
* lib/jit_hppa.c: Float arguments must be passed on integer
registers on HP-UX, not only for varargs functions.
Add code to properly clear instruction cache. This was
not required on Debian hppa port, but may have been working
by accident.
* lib/jit_hppa-cpu.c: Follow pattern of HP-UX binaries and
use bve,n instead of bv,n to return from functions.
* lib/jit_hppa-fpu.c: For some reason "fst? frX,rX,(rY)" did
not work on the tested computer (HP-UX B.11.23 U 9000/785 HP-UX)
so the code was changed, at first for __hpux only to add the
base and offset register and use the instruction with an
immediate (zero) offset.
Many thanks to Trent Nelson from snakebite.org for giving access to a
build farm with several different architectures and operating systems.
* check/lightning.c, lib/jit_disasm.c, lib/jit_ppc-cpu.c,
lib/jit_ppc-fpu.c, lib/jit_ppc.c, include/lightning.h,
include/lightning/jit_ppc.h, include/lightning/jit_private.h:
Adapt code to work on 32 bit AIX ppc using gcc. Most changes
are basically to adapt the elf64 logic to 32 bit, as it does
not use the same convention of 32 bit Darwin ppc.
* check/stack.tst: Add a fake memcpy function to the test
case if running under AIX, as it is not available to dlsym.
* configure.ac: Check for getopt.h header, not available in
AIX.
* include/lightning/jit_hppa.h, lib/jit_hppa-cpu.c,
lib/jit_hppa-fpu.c, lib/jit_hppa.c: New files implementing
the hppa port. Built on Debian Linux PA-RISC 2.0, 32 bit.
* check/float.tst: Add preprocessor for hppa expected
values when converting NaN and +-Inf to an integer.
* check/ldst.inc: Ensure double load/store tests use an
8 byte aligned address by default.
* lib/lightning.c: Correct a bug found during tests in
the new port, where qmul* and qdiv* were not properly
setting one of the result registers as modified in the
function, what would be a problem if the only "write"
usage were the qmul* or qdiv*.
* check/varargs.tst, check/varargs.ok: Add one extra
interleaved integer/double test to validate proper code
generation in the extra case.
* check/lightning.c, configure.ac, include/lightning.h,
include/lightning/Makefile.am,
include/lightning/jit_private.h, lib/Makefile.am,
lib/jit_disasm.c: Update for the hppa port.
* include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
lib/jit_ia64-fpu.c, lib/jit_ia64.c: New files implementing
the basic infrastructure of an Itanium port. The code
compiles and can generate jit for basic hello world like
functions.
* check/lightning.c, configure.ac, include/lightning.h,
include/lightning/Makefile.am, include/lightning/jit_private.h,
lib/Makefile.am, lib/lightning.c: Update for the Itanium
port.
* lib/jit_mips-cpu.c, lib/jit_mips.c: Correct typo and
make the jit_carry register local to the jit_state_t.
This matches code reviewed in the Itanium port, that
should use the same base logic to handle carry/borrow.
* configure.ac, include/lightning/jit_private.h, lib/lightning.c:
Remove dependency on gmp. Only a simple bitmap was required, and
that was not enough reason to force linking to gmp and possible
complications caused by it.
* include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c,
lib/jit_sparc-fpu.c, lib/jit_sparc.c: New files implementing
the basic framework of the sparc port.
* configure.ac, include/lightning.h, include/lightning/Makefile.am,
include/lightning/jit_private.h, lib/jit_disasm.c: Update
for the sparc port framework.
* lib/jit_mips.c: Correct reversed retr/reti logic.
* lib/jit_ppc.c: Correct misspelled __LITTLE_ENDIAN.
* lib/lightning.c: Always do byte hashing in hash_data, because
the logic to "compress" strings causes large pointers to not
be guaranteed aligned at 4 byte boundaries.
Update for the sparc port framework.
* check/Makefile.am: "make debug" target should pass only
the main test tool program as argument for running gdb
* configure.ac: Add the --enable-assertions options.
* doc/Makefile.am, doc/body.texi, doc/lightning.texi:
Major rewrite of the documentation to match the current
implementation.
* doc/version.texi: Automatic date update.
* doc/ifib.c, doc/incr.c, doc/printf.c, doc/rfib.c, doc/rpn.c:
Implementation of the documentation examples, that are also
compiled during a normal build.
* doc/p-lightning.texi, doc/porting.texi, doc/toc.texi,
doc/u-lightning.texi, doc/using.texi: These files were
renamed in the documentation rewrite, as the documentation
was significantly trimmed due to full removal of the porting
chapters. Better porting documentation should be added but
for the moment it was just removed the documentation not
matching the implementation.
* lib/jit_note.c: New file implementing a simple string+integer
annotation, that should be used to map filename and line number
to offsets in the generated jit.
* include/lightning.h, lib/lightning.c: Update for the new
note code.
Add an extra mandatory argument to init_jit, that is used
as argument to bfd_openr.
Change from generic void* to char* the argument to jit_note
and add an extra integer argument, to map to filename and
line number.
* check/ccall.c, check/lightning.c, include/lightning/jit_private.h,
lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_ppc.c,
lib/jit_print.c, lib/jit_x86.c: lib/Makefile.am: Update for the
new annotation code.
* configure.ac, check/Makefile.am: Update to work with latest
automake.
* check/lightning.c: Remove the ".cpu name value" syntax,
as it was not able to do proper changes before the jit
internal data structure was initialized. Now it supports
several getopt options to force using different jit
generation options, effectively replacing the previous
syntax.
* check/run-test: Add simple extra logic to handle differently
named test scripts, used to test things like x87 coprocessor
in ix86, and arm instruction set or software float in armv7l.
* configure.ac: Add some AC_RUN_IFELSE calls to figure at
compile time if can test different code generation options,
and update Makefile generation accordingly.
* check/Makefile.am, lib/jit_arm.c, lib/jit_x86.c: Update to
properly work with the test tool updating the jit_cpu global
information.
* check/check.arm.sh, check/check.swf.sh, check/check.x87.sh:
New wrapper files passing -mthumb=0, mvfp=0 and -mx87=1 to
the test tool, if applicable, so that it can validate alternate
code generation options on test hosts that support them.
* configure.ac: Only default to using the builtin disassembler
if on GNU/Linux. This should be temporary, due to requiring
/proc/self/exe.
Correctly check $target_cpu for powerpc.
* include/lightning/jit_ppc.h: Correctly implement jit_v_num.
* include/lightning/jit_private.h: Declare proper prototype
for jit_init_debug and jit_finish_debug.
* lib/jit_ppc-cpu.c: Remove code to save/restore callee save
float registers, as it is not required since those float
registers are not usable currently.
Change prolog and epilog generation to, at least comparing
code, match what gcc generates in "gcc -O0", but it is still
failing in Darwin PPC, apparently due to the __clear_cache
call not being enough, as frequently it will also fail to
execute, and the code buffer is all zeroes.
* lib/lightning.c: Do not fail in jit_regset_scan1 calls due
to passing 64 as argument on computers with 64 registers.
* configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
lib/jit_arm-swf.c, lib/jit_arm.c, check/Makefile.am: Correct
implementation of the arm backend port to build and pass the
current test cases. Tested on armv7 with softfp abi.
* lib/jit_disasm.c: Rename and change prototype of static
disassemble function as in the arm backend it is required
to access state information stored in the jit_state_t object.
* check/3to2.tst, check/add.tst: Correct test case code assuming
JIT_RO and JIT_RET are the same, and even if they are the same,
the logic was incorrect because it must always call jit_retval*
to fetch a function call return before any other instruction.
The arm backend hash a special condition if jit_retval is not
called, because "r0" is not JIT_R0, but is JIT_RET and *also*
the first argument for a called function, so JIT_RET must be
only used as an argument to jit_retval.
* TODO: New file listing important tasks to be resolved.
2012-12-02 Paulo Andrade <pcpa@gnu.org>
* tests/Makefile.am, tests/3to2.c, tests/3to2.ok, tests/add.c,
tests/add.ok, tests/allocai.c, tests/allocai.ok, tests/bp.c,
tests/bp.ok, tests/divi.c, tests/divi.ok, tests/fib.c, tests/fib.ok,
tests/fibdelay.c, tests/fibdelay.ok, tests/fibit.c, tests/fibit.ok,
tests/funcfp.c, tests/funcfp.ok, tests/incr.c, tests/incr.ok,
tests/ldst.c, tests/ldst.ok, tests/ldxi.c, tests/ldxi.ok,
tests/modi.c, tests/modi.ok, tests/movi.c, tests/movi.ok,
tests/printf.c, tests/printf.ok, tests/printf2.c, tests/printf2.ok,
tests/ret.c, tests/ret.ok, tests/rpn.c, tests/rpn.ok, tests/rpnfp.c,
tests/rpnfp.ok, tests/sete.c, tests/sete.ok, tests/testfp.c,
tests/testfp.ok, tests-run-test: Removed previous test suite, in
favor of a newer one in the check subdirectory.
* check/3to2.ok, check/3to2.tst, check/add.ok, check/add.tst,
check/allocai.ok, check/allocai.tst, check/bp.ok, check/bp.tst,
check/divi.ok, check/divi.tst, check/fib.ok, check/fib.tst:
New sample input for the new test program, loosely matching
several of the previous test cases.
* check/Makefile.am: New test suite makefile.
* check/check.sh, check/run-test: New wrapper files for the
new test suite.
* check/lightning.c: New file. The main driver of the new test
suite, that compiles to a parser of a very simple assembly like
language, generates jit and executes it.
* check/all.tst: New file. A generic debug and sample test file
with a directive to prevent it from being executed, and useful to
read disassembly of all possible instructions, using a fixed set
of registers.
* include/Makefile.am, include/lightning.h,
include/lightning/Makefile.am, include/lightning/jit_arm.h,
include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
include/lightning/jit_private.h, include/lightning/jit_x86.h,
lib/Makefile.am, lib/jit_disasm.c, lib/jit_print.c,
lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c,
lib/jit_x86.c, lib/lightning.c: New files. These files are
written from scratch, only by <pcpa@gnu.org>, and have now
copyright assignment to the FSF. This is the core of the new
lightning rework. Previously it was integrated in code with
a garbage collector and several custom types like vectors and
hash tables, so this first code merge with lightning converts
that code into a library extracting only the jit bits, and at
first only for x86_64 GNU/Linux.
* lightning.h, m4/lightning.m4: Removed. These are no longer
required in the new lightning code.
.gitignore, Makefile.am, configure.ac: Update for the new
lightning code.
2012-12-02 Paulo Andrade <pcpa@gnu.org>
* .cvsignore: Removed for extra cleanup.
* build-aux: Rename directory to m4.
* m4: Renamed to "default" name and for consistency with merge
with code rework to be imported in lightning.
* .gitignore, configure.ac, Makefile.am, doc/Makefile.am:
Update for build-aux to m4 rename.
2012-12-01 Paulo Andrade <pcpa@gnu.org>
* opcode/Makefile.am, opcode/Makefile.in, opcode/ansidecl.h,
opcode/bfd.h, opcode/dis-asm.h, opcode/dis-buf.c, opcode/disass.c,
opcode/i386-dis.c, opcode/i386.h, opcode/ppc-dis.c, opcode/ppc-opc.c,
opcode/ppc.h, opcode/sparc-dis.c, opcode/sparc-opc.c, opcode/sparc.h,
opcode/sysdep.h: Removed. Do not bundle GNU binutils files.
* aclocal.m4, configure, Makefile.in, config.h.in, doc/Makefile.in,
lightning/Makefile.in, tests/Makefile.in: Removed. Do not maintain
autogenerated files that also generate too much diff noise when
regenerated in git.
* build-aux/help2man, build-aux/texinfo.tex, build-aux/texi2dvi:
Removed. Buildenvironment must have an up to date version from
upstream installed.
* build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
build-aux/install-sh build-aux/mdate-sh build-aux/missing: Removed.
Do not maintain a copy of automake files in git. Release tarballs
must use an up to date version.
* lightningize.in, doc/lightningize.1: Removed. Do not encourage
bundling lightning in other packages. It should use a system package
or a proper thirdy part subdirectory.
* INSTALL: Removed. Autoreconf removes it and creates a symlink
when regenerating files, so, avoid conflicts in git and let
automake create the symlink.
* .gitignore: Add INSTALL and autogenerated files.
* configure.ac, Makefile.am: Update for removal of opcode subdir,
auto generated files and lightningize.
* tests/Makefile.am, tests/3to2.c, tests/add.c, tests/bp.c,
tests/fib.c, tests/fibdelay.c, tests/fibit.c, tests/funcfp.c,
tests/incr.c, tests/printf.c, tests/rpn.c, tests/rpnfp.c,
tests/sete.c, tests/testfp.c: Update for removal of opcode subdir.
* doc/Makefile.am: Update for removal of lightningize.
* configure.ac, lightning/ppc/funcs.h, lightning/sparc/funcs.h,
lightning/i386/fp.h, lightning/i386/core.h, lightning/i386/asm.h,
tests/3to2.c, tests/add.c, tests/bp.c, tests/fib.c, tests/fibdelay.c,
tests/fibit.c, tests/funcfp.c, tests/incr.c, tests/printf.c,
tests/rpn.c, tests/rpnfp.c, tests/sete.c, tests/testfp.c:
Remove LIGHTNING_CROSS, it is half supported and incomplete.
* tests/3to2.c, tests/funcfp.c, tests/rpnfp.c: Remove preprocessor
check on JIT_FPR. If no hardware registers are available, the backend
must provide an alternative for software float.
* lightning/ppc/core.h, lightning/sparc/core.h, tests/Makefile.am:
Remove JIT_NEED_PUSH_POP. It is absolutely not trivial to implement
properly on some backends due to stack alignment constraints, and
whenever it is required, using jit_allocai and using a properly
aligned stack vector, or a heap buffer, is better.
* tests/push-pop.c, tests/push-pop.ok: Removed due to
JIT_NEED_PUSH_POP no longer available.
2008-06-11 Paolo Bonzini <bonzini@gnu.org>
* build-aux/lightning.m4: Adjust LIGHTNING_BACKENDS, don't
use suffix support to distinguish i386/x86_64.
* lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES
to distribute *-32.h and *-64.h files now.
* lightning/i386/asm-i386: Moved to...
* lightning/i386/asm.h: Include the appropriate subtarget file.
* lightning/i386/core-i386: Moved to...
* lightning/i386/core.h: Include the appropriate subtarget file.
* lightning/i386/fp.h: New, include the appropriate subtarget file.
* lightning/i386/asm-32: Do not include asm-i386.h.
* lightning/i386/asm-64.h: Likewise.
* lightning/i386/core-32: Do not include core-i386.h.
* lightning/i386/core-64.h: Likewise.
* lightning/Makefile.am: Adjust for renamed files.
* configure.ac: Define LIGHTNING_TARGET here.
* opcode/disass.c: Change list of valid LIGHTNING_TARGET values.
* lightningize.in: Robustify against missing subtarget files.
Patches applied:
* lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-7
Added a test case for `ldxi' with big immediate operands.
git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-26
2004-11-08 Paolo Bonzini <bonzini@gnu.org>
* lightning.h: New name of...
* lightning-inst.h: ... this file.
* lightning.h.in: Removed.
* opcodes/disass.c: Include config.h.
* tests/add.c: Include config.h.
* tests/bp.c: Include config.h.
* tests/fib.c: Include config.h.
* tests/fibdelay.c: Include config.h.
* tests/fibit.c: Include config.h.
* tests/funcfp.c: Include config.h.
* tests/incr.c: Include config.h.
* tests/printf.c: Include config.h.
* tests/printf2.c: Include config.h.
* tests/rpn.c: Include config.h.
* tests/rpnfp.c: Include config.h.
* tests/testfp.c: Include config.h.
git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-4