2012-12-22 Paulo Andrade * lib/jit_arm.c: Correct use of wrong argument offset variable in armv7l or float/double argument for varargs function in armv7hl. Correct jit_getarg* logic in software float mode to match expected behavior in other backends, that is, if a function is not called, it is safe to use a few lightning calls before a next jit_getarg* call, as done in the test case check/stack.tst. The proper solution should be to extend the parser in lib/lightning.c to check if there is some float operation that will call some (libgcc?) function, but software float arm should be a very uncommon backend for lightning, so, just load the already in place arguments saved to stack, assuming the register argument was clobbered (what should not be the case most times...). 2012-12-22 Paulo Andrade * check/clobber.ok, check/clobber.tst: New test case doing extensive validation tests to ensure registers not used in a operation are not clobbered. * check/Makefile.am: Update for new test case. 2012-12-21 Paulo Andrade * lib/lightning.c: Partially rewrite/revert code to compute initial register live state at the start of a basic block. The original logic was corrupted when adding optimizations to do as few computations as possible in jit_update. The reglive field must be always a known set of live registers at the start of a basic block. The value that was incorrect was the regmask field, that must be the set of registers that are in unknown state, because they are not known live, neither set (or possibly not set) in the basic block, and *must* store the state at the start of the basic block. 2012-12-20 Paulo Andrade * include/lightning/jit_ppc.h: Correct mismatch of JIT_F{1,5} with enum codes, that were correct, and returned by jit_f(). * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: Properly implement and better describe values when generating stack frames. 2012-12-18 Paulo Andrade * check/stack.ok, check/stack.tst: New files to test data integrity on a deep chain of stack frames. * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c, lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c, lib/jit_x86.c, lib/jit_x86-cpu.c: Calculate _jit->function->stack in the emit stage, otherwise it will calculate it wrong if need to jit_allocai space to spill registers. * lib/lightning.c: Correct wrong offset when updating the "current" jit function pointer in the code that may need to allocate stack space to spill registers. * check/lightning.c: Correct off by one data space check. * check/Makefile.am: Update for new test case. 2012-12-17 Paulo Andrade * check/fop_abs.ok, check/fop_abs.tst, check/fop_sqrt.ok, check/fop_sqrt.tst: New files implementing simple test cases for the extra float operations. * check/Makefile.am: Update for new test cases. * check/alu.inc: Add an extra macro to check for unordered equality on tests where it is expected to use NaN as an argument. * check/lightning.c: Minor change for proper/common argument syntax handling ommiting arguments to options. 2012-12-17 Paulo Andrade * check/Makefile.am: Automatically generate pattern list of tests with alternate jit generation options. This should prevent typos and needing to change multiple places after a change. 2012-12-14 Paulo Andrade * 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. 2012-12-14 Paulo Andrade * lib/jit_x86-x87.c, lib/jit_x86.c: Correct test cases in ix86 when using the x87 coprocessor instead of sse2+. 2012-12-14 Paulo Andrade * include/lightning.h, include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Make jit_ellipsis implementation not backend specific. It is not intended to handle va_list like objects at runtime, as jit_arg* and jit_getarg* return constant values resolved at parse time, so, effectively it is not possible to create printf like jit functions, as there is no va_start, va_arg, va_end, etc, abstraction. This limitation should be kept for the sake of making new ports easier. 2012-12-14 Paulo Andrade * include/lightning.h, lib/lightning.c: Add two extra wrapper functions to avoid need for excess pointer to/from word casts. * check/lightning.c: Only need for pointer to/from word cast now is jit_movi, update accordingly. 2012-12-13 Paulo Andrade * check/varargs.ok, check/varargs.tst: New test cases implementing simple varargs calls with a large amount of arguments to exercise excess arguments on stack. * include/lightning.h: Include config.h if HAVE_CONFIG_H is defined. * lib/jit_arm.c: Allocate a fpr register, not a gpr one for temporary when pushing varargs arguments in the stack. * lib/jit_arm-swf.c: Correct code changing the wrong offset in jit_absr_d and jit_negr_d in software float. * lib/jit_mips.c: Correct calculation of offsets of arguments on stack. * lib/jit_ppc.c: Correct bogus logic for "next" offset of arguments on stack and adjust for fixed offset of stack arguments. 2012-12-12 Paulo Andrade * include/lightning.h, lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Change jit_prepare to no longer receive an argument. If receiving an argument, it should be an ABI specifier, not a boolean if varargs or not, and add the new jit_ellipsis call, to specify where the ellipsis is in the C prototype of the function being called. Note that currently it is not supported to define varargs functions and it will be ignored if calling jit_ellipsis not in a prepare/finish* block, but this should be addressed. * check/allocai.tst, check/alu_add.tst, check/alu_and.tst, check/alu_com.tst, check/alu_div.tst, check/alu_lsh.tst, check/alu_mul.tst, check/alu_neg.tst, check/alu_or.tst, check/alu_rem.tst, check/alu_rsh.tst, check/alu_sub.tst, check/alu_xor.tst, check/alux_add.tst, check/alux_sub.tst, check/bp.tst, check/branch.tst, check/cvt.tst, check/divi.tst, check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst, check/ldstxi-c.tst, check/ldstxi.tst, check/ldstxr-c.tst, check/ldstxr.tst, check/rpn.tst, check/lightning.c: Update for the change to jit_prepare and addition of jit_ellipsis. 2012-12-11 Paulo Andrade * lib/jit_ppc-cpu.c: Make movr a function that checks arguments so that other code can safely assume it is a noop if src and dst are the same register. Implement rem{r,i}{,_u} as a div{,u}/mul/sub. Correct ANDIS, ORIS and XORIS calls to cast the argument to unsigned before the shift to avoid an assertion if the argument had the topmost bit set. Implement lshi, rshi and rshi_u as functions to test for a zero argument, that would otherwise trigger an assertion when computing the shift value. Do a simple implementation of bm{s,c}{r,i} with a temporary, "andr" of arguments and jump based on comparison with zero. Correct typo in ldxi_c. * lib/jit_ppc-fpu.c: Correct wrong arguments to FDIV* and STF*. * lib/jit_ppc.c: Correct wrong check for 6 instead of 8 integer arguments in registers. If calling a varargs function and passing a float or double argument, also either store the value in the stack or in integer registers, as varargs functions do not fetch it from float registers. Add "case" for new functions and incorrectly missing ones. Call libgcc's __clear_cache, that should know what to do if the hardware needs flushing cache before execution. * lib/lightning.c: Do a simple/trivial logic in jit_regset_scan1, that should make it easier for the compiler to optimize it, and that also corrects the previously wrong code for big endian, and that was causing problems in ppc due to not saving all callee save registers as it was not "finding" them in the regset due to the little endian assumption bug. 2012-12-11 Paulo Andrade * 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. 2012-12-10 Paulo Andrade * lib/jit_mips-cpu.c: Correct all current test cases. Call the "xori" not the "XORI" macro for jit_xori implementation, as the XORI macro handles only 16 bit unsigned values. Call the "movr" macro, not the "movi" macro in the special case of adding or subtracting zero. Use the proper temporary register in the jit_andr implementation. 2012-12-09 Paulo Andrade * check/alu.inc, check/alu_add.ok, check/alu_add.tst, check/alu_and.ok, check/alu_and.tst, check/alu_com.ok, check/alu_com.tst, check/alu_div.ok, check/alu_div.tst, check/alu_lsh.ok, check/alu_lsh.tst, check/alu_mul.ok, check/alu_mul.tst, check/alu_neg.ok, check/alu_neg.tst, check/alu_or.ok, check/alu_or.tst, check/alu_rem.ok, check/alu_rem.tst, check/alu_rsh.ok, check/alu_rsh.tst, check/alu_sub.ok, check/alu_sub.tst, check/alu_xor.ok, check/alu_xor.tst, check/alux_add.ok, check/alux_add.tst, check/alux_sub.ok, check/alux_sub.tst, check/branch.ok, check/branch.tst: New test cases for arithmetic and branch tests. * check/Makefile.am: Update for new test cases. * include/lightning/jit_private.h: Make the jit_reg_free_p macro shared by all backends. Previously was added for the arm backend, but is useful in the x86_64 backend when checking state of "special purpose register". Also add the new jit_class_named register class, that must be or'ed with the register value if calling jit_get_reg expecting an specific value, because the specific register value may be zero, that previously was treated as no register requested. * lib/jit_arm-cpu.c: Correct argument order for T2_MVN. * lib/jit_arm-swf.c: Call the proper function for double divide. The "software float" implementation just calls libgcc functions. * lib/jit_arm.c: Return float/double values in the float register if using the hard float ABI. * lib/jit_x86-cpu.c: Change the can_sign_extend_int_p macro to not include -0x80000000L, because there is code that "abuses" it and thinks it can negate the immediate value after calling that macro. Correct implementation of jit_subi that had a wrong code patch logic doing subtraction with reversed arguments. Correct REX prefix calculation in the jit_muli implementation. Correct logic to get/unget %*ax and %*dx registers in divremr and divremi. Correct divremi that was using the symbolic, unique %*ax value in on place (not using the _REGNO name suffix). Correct cut&paste error causing it to use "xor" instead of "or" in one code path of the jit_ori implementation. Correct several flaws when clobbering registers and/or when one of the arguments was %*cx in the rotshr wrapper function implementing most shift operations. * lib/lightning.c: No longer expect that the backend be smart enough to know what to do when asking for a named register if that register is already an argument or is live. It fails if it is an argument, or if register is live, fails if cannot spill. No longer incorrectly assume that eqr_{f,d} and ltgr_{f,d} are safe to inverse value tests in jump thread optimization. 2012-12-05 Paulo Andrade * check/Makefile.am, check/cvt.ok, check/cvt.tst: Add new "cvt" test case to test conversion from/to int/float types. * check/lightning.c: Only define truncr_{f,d}_l in 64 bit mode. * include/lightning.h: Correct typo that caused it to define jit_truncr_{f,d}_l in 32 bit mode. * lib/jit_arm-cpu.c: Avoid assertion failure in the signed/unsigned extend opcodes generation as it shares an interface for 3 argument opcode generation. * lib/jit_x86-cpu.c: Correct wrong argument passed to jit_unget_reg in the andi implementation and wrong byte unsigned extend code generation. * lib/jit_x86-sse.c: Correct conversion from "word" to float or double as is dependent on wordsize. 2012-12-05 Paulo Andrade * check/ldstr-c.ok, check/ldstr-c.tst, check/ldstxi-c.ok, check/ldstxi-c.tst, check/ldstxr-c.ok, check/ldstxr-c.tst: New test case files testing load clobbering the base and/or index register; * check/ldst.inc: New file with common definition for all the ldst* test cases. check/Makefile.am, check/ldsti.tst, check/ldstr.tst, check/ldstxi.tst, check/ldstxr.tst: Update for new common definitions file and new register clobber ldst tests. 2012-12-05 Paulo Andrade * lib/jit_mips-fpu.c: Correct wrong register order in stxr_{f,d} in the mips backend. 2012-12-05 Paulo Andrade * lib/jit_arm-vfp.c: Correct regression found in armv7l with latest test cases. 2012-12-05 Paulo Andrade * check/ldstxi.tst, check/ldstxr.tst: Correct wrong argument order for 32 bit mode tests. * configure.ac: Correct check for ix86 target_cpu. 2012-12-05 Paulo Andrade * check/ldstr.ok, check/ldstr.tst, check/ldsti.ok, check/ldsti.tst, check/ldstxr.ok, check/ldstxr.tst, check/ldstxi.ok, check/ldstxi.tst: New test case files exercising a very large amount of register combinations to verify load/store implementation. * check/Makefile.am: Update for new test cases. * lib/jit_x86-cpu.c: Correct wrong argument order when computing REX prefix for {ld,st}r_T codes; 2012-12-04 Paulo Andrade * lib/jit_mips-fpu.c, lib/jit_mips.c: Implement missing mips jit_sqrtr_{f,d} codes. * check/all.tst, include/lightning.h, lib/jit_print.c: Change declaration order and call order in all.tst of {add,sub}c and {add,sub}x. *c must be called before to set the carry and *x second to use the carry and keep it set. The wrong call order was causing all.tst to fail in mips, where a register is allocated to keep a global carry state. 2012-12-04 Paulo Andrade * include/lightning/jit_mips.h, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c: Correct float/double argument handling and make the mips backend pass the initial test cases. * include/lightning.h, ib/jit_print.c, lib/lightning.c: Add extra enum values for argument handling functions that could not be abstracted to the current codes, that is, when float values need to move from/to gpr from/to fpr. It would be more tempting to add such primitives, but they would have wordsize limitations, and it is not expected to add codes with one gpr argument for 64 bit and two for 32 bit. * lib/jit_ppc.c: Check _jit->function before calling jit_epilog() to avoid a runtime exception. 2012-12-04 Paulo Andrade * include/lightning/jit_mips.h, lib/jit_mips.c: Update to make the mips backend compile in a qemu image. * lib/jit_ppc.c: Minor adaptations to help in having the ppc backend compilable. 2012-12-03 Paulo Andrade * 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. 2012-12-03 Paulo Andrade * check/all.tst, check/lightning.c: Only declare or use 64 bit interfaces on 64 bit builds. * check/fib.tst: Use simpler logic to not need preprocessor conditionals for 32 or 64 bit. * include/lightning.h: Only declare 64 bit macros on a 64 bit build. Code using lightning must know about wordsize and the jit generation limitations, also, this way it generates a compile time failure, not a runtime assertion. * include/lightning/jit_x86.h: Correct typo in macro name. * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c, lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c, lib/jit_x86.c, lib/jit_x86-cpu.c: Correct wrong code to get current jit function pointer. * lib/lightning.c: Move call to the simplify() optimization to after register liveness is known. Previous code did work by accident but now with proper test cases the problem was noticed. * lib/jit_disasm.c: Always cast bfd_vma to long long when passing it as printf argument. 2012-12-03 Paulo Andrade * configure.ac, check/Makefile.am, check/check.sh, doc/Makefile.am, include/lightning/Makefile.am, lib/Makefile.am: Correct make distcheck. 2012-12-02 Paulo Andrade * lib/jit_ppc.c: Assign copyright ownership to FSF. * lib/jit_x86-cpu.c: Correct integer multiplication that was generating code with reversed register arguments. * check/rpn.ok, check/rpn.tst: New test case file. 2012-12-02 Paulo Andrade * lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c: Actually change copyright owner to FSF as avertised. * lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c, lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: New files implementing initial code different jit backends. * include/lightning/jit_private.h: Add extra field to the private jit_patch_t type, required by the arm port. * lib/Makefile.am: Update for the new backend implementation files. 2012-12-02 Paulo Andrade * check/Makefile.am: Add proper "make clean" rule and missing check.sh to EXTRA_DIST. 2012-12-02 Paulo Andrade * .gitignore: Update pattern of ignored files. * check/Makefile.am: Add rule to build liblightning.la dependency in case of running "make check" before building the library. 2012-12-02 Paulo Andrade * lightning/Makefile.am, lightning/asm-common.h, lightning/core-common.h, lightning/fp-common.h, lightning/funcs-common.h, lightning/i386/Makefile.frag, lightning/i386/asm-32.h, lightning/i386/asm-64.h, lightning/i386/asm.h, lightning/i386/core-32.h, lightning/i386/core-64.h, lightning/i386/core.h, lightning/i386/fp-32.h, lightning/i386/fp-64.h, lightning/i386/fp.h, lightning/i386/funcs.h, lightning/ppc/asm.h, lightning/ppc/core.h, lightning/ppc/fp.h, lightning/ppc/funcs.h, lightning/sparc/asm.h, lightning/sparc/core.h, lightning/sparc/fp.h, lightning/sparc/funcs.h: Removed. The core logic is used in the new code, and new mips and arm ports will be added. At first, sparc will not be supported as it has not yet been ported to the new engine. 2012-12-02 Paulo Andrade * 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 , 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 * .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 * 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. 2011-02-28 Paolo Bonzini * lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_, fix jit_mul{i,r}_{l,ul}. 2010-08-20 Paolo Bonzini * lightning/i386/fp-64.h: Return patch address from jit_bXYr_{f,d}. Reported by Paulo César Pereira de Andrade. * lightning/ppc/fp.h: Likewise. * lightning/sparc/fp.h: Implement FP branches. 2010-08-18 Paolo Bonzini * lightning/i386/fp-64.h: Fix jp in jit_bner_{f,d}. 2010-08-18 Paolo Bonzini * lightning/i386/fp-32.h: Fix -D_ASM_SAFETY compilation. Reported by Paulo César Pereira de Andrade. 2010-08-15 Paolo Bonzini * tests/ldst.c: Update. * tests/Makefile.am: Use -ffloat-store to compile it. 2010-08-15 Paolo Bonzini * lightning/i386/core.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s, jit_ldxr_s): Move... * lightning/i386/core-32.h: ... here. * lightning/i386/core-64.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s, Use movsbq and movswq. 2010-08-10 Paulo César Pereira de Andrade * lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir. (jit_movbrm): Check index register as well. * lightning/i386/fp-64.h: Add jit_extr_f_d and jit_extr_d_f. * lightning/fp-common.h: Add jit_extr_f_d and jit_extr_d_f. 2010-07-28 Paolo Bonzini * tests/Makefile.am: Add ldst test. * tests/Makefile.in: Regenerate. * tests/ldst.c: New. * tests/ldst.ok: New. 2010-07-28 Paolo Bonzini * THANKS: Add Paulo Cesar Pereira de Andrade. * doc/porting.texi: Fix ordering of arguments in jit_stxi. * lightning/i386/core-32.h (jit_replace): Remove cmp argument. * lightning/i386/fp-64.h (jit_movi_f): Fix. 2010-07-26 Paolo Bonzini * lightning/i386/core-32.h (jit_replace): Move here (removed 2009-03-01). 2010-07-19 Paolo Bonzini * build-aux/lightning.m4: Always set and replace lightning_frag. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.h.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * doc/lightningize.1: Regenerate. * doc/version.texi: Regenerate. * lightning/Makefile.in: Regenerate. * opcode/Makefile.in: Regenerate. * tests/Makefile.in: Regenerate. 2009-03-01 Paolo Bonzini * lightning/i386/core-64.h: Use Mike's macros for x86-64 too. * lightning/i386/core.h: Remove jit_replace. 2009-02-27 Mike Spivey * lightning/i386/core.h: Rewrite shift-handling macros. * lightning/fp-common.h: Fix jit_extr_{f_d,d_f}. 2009-02-17 Mike Spivey * lightning/i386/core.h: Fix blunder in operand order. 2009-02-17 Paolo Bonzini * lightning/i386/fp-32.h: Another fix to jit_fp_btest. 2009-02-17 Paolo Bonzini * lightning/fp-common.h: Define double branches if missing. * lightning/i386/asm.h: Define JC and JNC mnemonics. * lightning/i386/fp-32.h: Fix jit_fp_btest. All reported by Mike Spivey. 2008-10-09 Paolo Bonzini * lightning/ppc/funcs.h (jit_flush_code): Subtract 1 from end. Reported by Eli Barzilay and Matthew Flatt. 2008-08-23 Nix * lightning/i386/Makefile.frag: fp-32.h and fp-64.h are target files. 2008-07-02 Laurent Michel * lightning/ppc/funcs.h (jit_flush_code): modified the computation of start/end. The pointer arithmetic was done without casting. It prevented compilation with recent gcc versions. * lightning/ppc/core.h (jit_pushr_i): The offset for the store was incorrect. Should have been 4 bytes below SP (not above). * lightning/ppc/core.h (jit_popr_i): The offset for the load was incorrect. Should have been 0 (not +8). 2008-06-17 Paolo Bonzini * lightning/i386/asm-64.h: Forward IMULQir to IMULQirr, fix REXQ order for IMULQirr. 2008-06-17 Paolo Bonzini * lightning/i386/core.h: Fix _rN vs. _rR. 2008-06-16 Paolo Bonzini * lightning/i386/core.h: Use jit_save in jit_replace. Move JIT_R definition... * lightning/i386/core-32.h: ... here; define jit_save so that the core.h has no effect on the 32-bit backend. * lightning/i386/core-64.h: Place JIT_R1/JIT_R2 in R10/R11, place outgoing arguments in the right spot from the beginning, define jit_save, fix jit_reg8/jit_reg16. 2008-06-15 Paolo Bonzini * lightning/i386/core-64.h: Rewrite argument passing to support up to 6 arguments and generate less code. 2008-06-14 Laurent Michel * lightning/i386/core-64.h (jit_movi_l): When the operand is 0, the XOR should be on a quadword. * lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack alignment. (jit_ret): Always use LEAVE. 2008-06-13 Laurent Michel * lightning/i386/core-64.h: Add (void) casts for C++ compatibility. * lightning/i386/asm.h: Likewise. 2008-06-12 Paolo Bonzini * lightning/i386/core.h: Move JIT_V definition... * lightning/i386/core-32.h: ... here. * lightning/i386/core-64.h: ... and here. Avoid dancing between RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13. 2008-06-11 Paolo Bonzini * 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. 2008-06-11 Paolo Bonzini * lightning/i386/core-32.h: Use MOVLir instead of jit_movi_l to implement jit_movi_p. 2008-06-11 Paolo Bonzini * lightning/i386/core-32.h: Use separate __APPLE__ and SysV prolog/ret macros. Subtract 12 bytes in __APPLE__ case to keep stack aligned, and always use LEAVE in the epilog. 2008-06-11 Paolo Bonzini * lightning/i386/core-i386.h: Fix C++ incompatibility. 2008-06-10 Laurent Michel * lightning/i386/core-i386.h: Fix jit_replace8 for case when one of the operands is _EAX. 2008-05-19 Paolo Bonzini * tests/run-test: Avoid CRLF issues on mingw. 2008-03-21 Paolo Bonzini * lightning/i386/core-64.h: Fix jit_{ld,st}{,x}i_{i,l}. Remove jit_ld{,x}i_ul. * lightning/core-common.h: Make jit_ld{,x}{i,r}_ul always a synonym of the _l variant. * doc/porting.texi: Document this. 2008-03-19 Paolo Bonzini * lightning/i386/core-64.h: Fix uses of jit_qop_. 2008-03-19 Paolo Bonzini * lightning/i386/core-64.h: Add boolean operations. 2008-03-19 Paolo Bonzini * lightning/i386/asm-64.h: Add LEAQmr. 2008-03-19 Paolo Bonzini * lightning/i386/core-64.h: Misc bugfixes. 2008-03-19 Paolo Bonzini * lightning/i386/core-i386.c: Remove jit_ldr_i, jit_ldxr_i. * lightning/i386/core-32.h: Add jit_ldr_i, jit_ldxr_i. * lightning/i386/core-64.h: Add jit_ld{r,xr,i,xi}_{ui,l,ul}; move jit_ldr_i, jit_ldxr_i, jit_str_l, jit_stxr_l with others. 2008-03-19 Paolo Bonzini * lightning/asm-common.h: Add _s32P. 2008-03-19 Paolo Bonzini * lightning/i386/core-64.h: Implement long mul/div/mod. 2008-03-19 Paolo Bonzini * lightning/i386/asm-i386.h: Cast memory address to long for JCCim. 2008-03-15 Paolo Bonzini * lightning/asm-common.h: Add underscores around __unused__ attribute. 2008-03-15 Paolo Bonzini * lightning/ppc/core.h: Avoid some "value computed is not used" warnings. * lightnings/tests/allocai.c: Silence other warnings. 2008-03-14 Paolo Bonzini * lightningize.in: Fix some problems (not all). 2008-03-14 Paolo Bonzini * lightning/i386/core-32.h: Avoid some "value computed is not used" warnings; reported by Sam Steingold. 2008-03-08 Paolo Bonzini * lightning/i386/core-32.h: Fix stxr_c(_EAX, _EBX, _ESI). 2008-02-13 Paolo Bonzini * lightning/i386/asm-32.h: Avoid redefinition of _r1, reported by Sam Steingold. * lightning/i386/asm-64.h: Likewise. 2008-02-08 Paolo Bonzini * lightning/i386/asm-i386.h: Don't define _VOID, reported by Reini Urban. 2008-02-03 Paolo Bonzini * build-aux/lightning.m4: Add --with-lightning-prefix option, suggested by Sam Steingold. 2008-01-14 Paolo Bonzini * lightning/i386/core-64.h: Use CALLsr, not CALLLsr. 2008-01-13 Paolo Bonzini * lightning/i386/core-i386.h: Move jit_calli and jit_callr... * lightning/i386/core-32.h: ... here. * lightning/i386/core-64.h: Redefine them. 2008-01-05 Paolo Bonzini * lightning/i386/fp-32.h: Fix sub(a,0,a). * lightning/tests/3to2.c: Add new testcases. * lightning/tests/3to2.ok: Add new testcases. 2008-01-02 Paolo Bonzini * lightning/i386/fp-32.h: Fix sub(a,b,a) with a ~= JIT_FPR0. * lightning/tests/3to2.c: New. * lightning/tests/3to2.ok: New. 2007-11-07 Paolo Bonzini * opcode/Makefile.am: Fix AM_CPPFLAGS. 2007-08-12 Paolo Bonzini * lightning/i386/core-i386.h: Improve encoding of set* instructions. * lightning/i386/core-64.h: Fix jit_bra_l. * tests/sete.c: New. * tests/sete.ok: New. 2007-06-29 Paolo Bonzini * tests/bp.c: Upgrade to GPL/LGPLv3. * lightning/i386/asm-32.h: Upgrade to GPL/LGPLv3. * lightning/i386/asm-64.h: Upgrade to GPL/LGPLv3. * lightning/i386/core-32.h: Upgrade to GPL/LGPLv3. * lightning/i386/core-64.h: Upgrade to GPL/LGPLv3. * lightning/i386/fp-64.h: Upgrade to GPL/LGPLv3. * lightning/sparc/asm.h: Upgrade to GPL/LGPLv3. * lightning/sparc/core.h: Upgrade to GPL/LGPLv3. * lightning/sparc/fp.h: Upgrade to GPL/LGPLv3. * lightning/sparc/funcs.h: Upgrade to GPL/LGPLv3. * lightning/i386/asm-i386.h: Upgrade to GPL/LGPLv3. * lightning/i386/core-i386.h: Upgrade to GPL/LGPLv3. * lightning/i386/fp-32.h: Upgrade to GPL/LGPLv3. * lightning/i386/funcs.h: Upgrade to GPL/LGPLv3. * lightning/ppc/asm.h: Upgrade to GPL/LGPLv3. * lightning/ppc/core.h: Upgrade to GPL/LGPLv3. * lightning/ppc/fp.h: Upgrade to GPL/LGPLv3. * lightning/ppc/funcs.h: Upgrade to GPL/LGPLv3. * lightning.h: Upgrade to GPL/LGPLv3. * tests/add.c: Upgrade to GPL/LGPLv3. * tests/fib.c: Upgrade to GPL/LGPLv3. * tests/testfp.c: Upgrade to GPL/LGPLv3. * tests/fibdelay.c: Upgrade to GPL/LGPLv3. * tests/fibit.c: Upgrade to GPL/LGPLv3. * tests/funcfp.c: Upgrade to GPL/LGPLv3. * tests/incr.c: Upgrade to GPL/LGPLv3. * tests/printf.c: Upgrade to GPL/LGPLv3. * tests/printf2.c: Upgrade to GPL/LGPLv3. * tests/rpn.c: Upgrade to GPL/LGPLv3. * tests/rpnfp.c: Upgrade to GPL/LGPLv3. * lightning/asm-common.h: Upgrade to GPL/LGPLv3. * lightning/core-common.h: Upgrade to GPL/LGPLv3. * lightning/fp-common.h: Upgrade to GPL/LGPLv3. * lightning/funcs-common.h: Upgrade to GPL/LGPLv3. * opcode/dis-buf.c: Upgrade to GPL/LGPLv3. * opcode/disass.c: Upgrade to GPL/LGPLv3. * opcode/i386-dis.c: Upgrade to GPL/LGPLv3. * opcode/sparc-dis.c: Upgrade to GPL/LGPLv3. * opcode/sparc-opc.c: Upgrade to GPL/LGPLv3. * lightningize.in: Upgrade to GPL/LGPLv3. * opcode/bfd.h: Upgrade to GPL/LGPLv3. * opcode/i386.h: Upgrade to GPL/LGPLv3. * opcode/sparc.h: Upgrade to GPL/LGPLv3. 2007-01-26 Thomas Girard * lightning/Makefile.am: Add clean-local target. 2006-12-02 Paolo Bonzini * lightning/i386/asm-i386.h: Add CVTTS?2SIL. * lightning/i386/asm-64.h: Add CVTTS?2SIQ. * lightning/i386/fp-64.h: Use it. * lightning/Makefile.am: Place files in nodist_lightning_HEADERS. 2006-11-23 Paolo Bonzini * lightning/core-common.h: Add casts in "*i_p" variants. * lightning/i386/asm-32.h: Add _r1. * lightning/i386/asm-64.h: Likewise, and add SSE instructions. * lightning/i386/asm-i386.h: Merge SSE instructions from Gwenole. Use short form for 16-bit AX instructions. Remove _r1 * lightning/i386/core-64.h: Add FP ABI support in its infancy. * lightning/i386/core-i386.h: Move jit_arg_f and jit_arg_d... * lightning/i386/core-32.h: ... and jit_prepare_f and jit_prepare_d... * lightning/i386/fp-32.h: ... here. * lightning/i386/fp-64.h: Write the code. * lightning/sparc/fp.h: Fix jit_extr_{f_d,d_f} register order. 2006-11-22 Paolo Bonzini * lightning/i386/asm-i386.h: Move x86-64 instructions... * lightning/i386/asm-64.h: ... here. * lightning/i386/fp-32.h: Fix bugfixes worked around in froofyJIT. Add JIT_FPRET. * lightning/sparc/fp.h: Likewise. * lightning/ppc/fp.h: Likewise. * lightning/fp-common.h: Adjust for JIT_FPRET. * tests/funcfp.c: Adjust for JIT_FPRET. * tests/rpnfp.c: Adjust for JIT_FPRET. 2006-11-20 Paolo Bonzini * lightning/i386/asm-i386.h: Add an underscore to macros without a parameter. 2006-11-20 Paolo Bonzini * lightning/i386/core-i386.h: Move jit_movip, jit_check8, jit_reg8, jit_reg16, jit_movbrm... * lightning/i386/core-32.h: ... here. * lightning/i386/core-64.h: Redefine them. Fix other bugs. * tests/printf.c: Do not do a varargs call. 2006-11-20 Paolo Bonzini * lightning/i386/asm-i386.h: Check in rewrite from Basilisk II. * lightning/i386/asm-32.h: Adjust. * lightning/i386/asm-64.h: Adjust. * lightning/i386/fp-32.h: Adjust. * lightning/i386/core-32.h: Adjust. Add jit_{ld,ldx,st,stx}i*. * lightning/i386/core-64.h: Adjust. Add jit_{ld,ldx,st,stx}i*. * lightning/i386/core-i386.h: Adjust. Remove these patterns. 2006-11-20 Paolo Bonzini * lightning/i386/asm-i386.h: Merge 64-bit cleanliness changes from mzscheme. Add SSE. * lightning/i386/asm-64.h: Likewise. 2006-11-20 Paolo Bonzini Ludovic Courtes * lightning/i386/core-32.h: Disable jit_push and jit_pop if stack not needed. * lightning/i386/core-64.h: Disable jit_push and jit_pop if stack not needed. * lightning/sparc/core.h: Merge final implementation of jit_pushr and jit_popr. * lightning/ppc/core.h: Fix implementation of jit_pushr and jit_popr to work (more or less) across function calls. * tests/push-pop.c, tests/push-pop.ok: New test. * tests/Makefile.am: Run it. 2006-11-20 Paolo Bonzini * lightning/asm-common.h: Make 64-bit safe. * lightning/i386/funcs.h: Make 64-bit safe. * lightning/i386/asm-64.h: More merge from mzscheme. * lightning/i386/asm-i386.h: More merge from mzscheme. * lightning/i386/core-32.h: More merge from mzscheme. * lightning/i386/core-64.h: More merge from mzscheme. * lightning/i386/core-i386.h: More merge from mzscheme. * tests/rpnfp.c, tests/testfp.c, tests/funcfp.c: Skip if no floating-point support. 2006-11-04 Paolo Bonzini * tests/rpn.c: Remove pushr/popr. 2006-11-04 Paolo Bonzini * lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1. * lightning/ppc/funcs.h: Store frame size into _jitl. Store R1 before the STMW, so that the offset is unchanged when we patch the STMW. * lightning/i386/core.h: Define JIT_FP to be EBP. * lightning/i386/core-32.h: Implement jit_allocai, put LEAVE in the epilog if jit_allocai was used. * lightning/i386/core-64.h: Implement jit_allocai, put LEAVE in the epilog if jit_allocai was used. 2006-11-04 Ludovic Courtes * lightning/sparc/core.h: Implement jit_allocai. * tests/allocai.c: New. * tests/Makefile.am: Point to new tests. 2006-11-03 Paolo Bonzini * lightning/ppc/core.h: Fix jit_bms using BNE rather than BGT. "AND." does signed comparisons. 2006-10-31 Paolo Bonzini * doc/porting.texi: Rename JIT_FP to JIT_AP. * lightning/core-common.h: Likewise. * lightning/i386/core-i386.h: Likewise. * lightning/fp-common.h: Provide default versions of jit_getarg_[fd]. * lightning/i386/fp-32.h: Don't provide jit_getarg_[fd]. * lightning/ppc/fp.h: Likewise. 2006-10-31 Ludovic Courtes * doc/using.texi (The instruction set): Clarified the use of `JIT_RET' and documented `jit_retval'. * tests/ret.c (generate_function_proxy): After `jit_finish', use `jit_retval_i' to move FUNC's return value into the correct register. 2006-10-31 Paolo Bonzini Ludovic Courtes * tests/divi.c, tests/divi.ok, tests/movi.c, tests/movi.ok: New. * tests/ldxi.c: Ensure large pointer is generated. * tests/Makefile.am: Point to new tests. * lightning.h: Include funcs-common.h before funcs.h. * lightning/sparc/core.h: Fix bugs in modi/divi. 2006-10-30 Paolo Bonzini * lightning/Makefile.am: Use "ln -sf". * lightning/core-common.h: Define jit_negr_l if necessary. 2006-10-30 Paolo Bonzini * lightning/i386/asm.h (MOVS*, MOVZ*): Use correct _r[124] macros. 2006-10-29 Paolo Bonzini * configure.ac: Use lightning.m4 macros. * lightning.m4: Refactor to use common code in configure.ac. Move... * build-aux/lightning.m4: ... here. * lightningize.in: Support suffixes. * opcode/disass.in: Adapt to changes in configure.ac. * lightning/ppc/funcs.h: Use __APPLE__ instead of _CALL_DARWIN. * lightning/i386/core-32.h: Likewise. 2006-10-26 Paolo Bonzini * configure.ac: Fix compilation test. * lightning/Makefile.am: Symlink LIGHTNING_TARGET_FILES in non-distribution mode. * lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES. 2006-10-26 Paolo Bonzini * configure.ac: Subst cpu. * lightning/core-common.h: Make tests pass on i386. * lightning/i386/asm-32.h: Make tests pass on i386. * lightning/i386/asm-64.h: Make tests pass on i386. * lightning/i386/asm-i386.h: Make tests pass on i386. * lightning/i386/core-32.h: Make tests pass on i386. * lightning/i386/core-64.h: Make tests pass on i386. * lightning/i386/core-i386.h: Make tests pass on i386. * tests/Makefile.am: Include files from cpu directory. 2006-10-26 Paolo Bonzini * lightning/i386/asm.h: Move to asm-i386.h * lightning/i386/asm-32.h: New, from Matthew Flatt. * lightning/i386/asm-64.h: New, from Matthew Flatt. * lightning/i386/core.h: Move to core-i386.h * lightning/i386/core-32.h: New, from Matthew Flatt. * lightning/i386/core-64.h: New, from Matthew Flatt. * lightning/i386/fp.h: Move to fp-32.h * lightning/i386/fp-64.h: New, dummy. * lightning/i386/Makefile.frag: New. * lightning/Makefile.am: Support per-target Makefile fragments. * configure.ac: Support per-target Makefile fragments and CPU suffixes. 2006-10-16 Paolo Bonzini * lightning/i386/i386.h (jit_flush_code): Fix syntax error. :-( 2006-07-06 Paolo Bonzini Ludovic Courtes * doc/using.texi: Clarify "Using autoconf" section and rename it to "Bundling lightning" * lightning.m4: Work also if lightning is not bundled. 2006-07-06 Paolo Bonzini Ludovic Courtes * lightning/ppc/core.h (_jit_mod): Replace with... (_jit_mod_big, _jit_mod_small): ... these. (jit_modi_i, jit_modi_ui): Rewrite. * tests/modi.c, tests/modi.ok: New tests. 2006-05-18 Matthew Flatt * lightning/i386/asm.h: Fix test for extending the mprotect area towards lower addresses. 2006-05-16 Bruno Haible * lightning/asm-common.h: Don't use __func__ nor __FUNCTION__ if not compiling with GNU C. 2006-02-16 Paolo Bonzini * lightning/ppc/core.h: Fix jit_ldxi_* with big displacement. 2006-01-23 Paolo Bonzini * configure.ac: Fix comments in config.h.in. 2005-11-25 Paolo Bonzini * lightning/sparc/fp.h: Fix header comment. * lightning/ppc/fp.h: Fix header comment. 2005-04-27 Paolo Bonzini * lightning/i386/asm.h (JCm, JCSm, JNCm, JNCSm): New. 2004-11-26 Paolo Bonzini * lightning/ppc/funcs.h (_jit_epilog): Remove unused variable. 2004-11-13 Paolo Bonzini * lightning/i386/funcs.h [__linux__]: Include sys/mman.h. 2004-11-09 Paolo Bonzini * lightning/sparc/fp.h: Fix fp-to-integer conversions. * lightning/ppc/testfp.c: Test fp-to-integer conversions of integer numbers. * lightning/ppc/testfp.ok: Adjust for the above. 2004-11-08 Paolo Bonzini * lightning/ppc/testfp.c: Always flush code before testing it. 2004-11-08 Paolo Bonzini * lightning/ppc/fp.h: Do not clobber f31. 2004-11-08 Paolo Bonzini * 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. 2004-10-12 Paolo Bonzini * lightning/i386/fp.h: Fix bugs in conditional branches. 2004-10-10 Paolo Bonzini * lightning/i386/funcs.h: Fix pasto in jit_flush_code. 2004-10-08 Paolo Bonzini * lightning/ppc/fp.h: Optimized conditional branches. 2004-09-20 Paolo Bonzini * lightning/ppc/asm.h: Fix more typos. 2004-09-20 Paolo Bonzini * lightning/ppc/asm.h: Fix typos, replace `26' with JIT_AUX. 2004-09-20 Paolo Bonzini * lightning/ppc/fp.h: Added conditional branches. 2004-09-18 Laurent Michel * lightning/ppc/fp.h (jit_unler_d, jit_unltr_d, jit_unger_d, jit_ungtr_d, jit_ltgt_d, jit_uneq_d): Implemented missing tests to fully support testfp. (jit_floorr_d_i, jit_ceilr_d_i, jit_roundr_d_i, jit_truncr_d_i): New macros. * lightning/ppc/asm.h: Added missing opcodes FCTIWZ and MTFSFI. * lightning/ppc/funcs.h (_jit_prolog): Fixed minor mistake in the initialization of _jitl.nextarg_geti, relying on the JIT_AUX macro as well to get the register offset. 2004-09-07 Paolo Bonzini * lightning/ppc/funcs.h: Fix typo. 2004-09-06 Paolo Bonzini * tests/funcfp.c: Use %g. Remove C99 variable declarations. * tests/testfp.c: Don't use __builtin_nan. * lightning/ppc/core.h: Add three V registers. * lightning/ppc/funcs.h: Adjust. * lightning/sparc/core.h: Some fixes related to FP argument passing. Move R0 to %g2, use %o7 for JIT_BIG2. * lightning/sparc/fp.h: Some fixes related to FP argument passing. 2004-09-02 Paolo Bonzini * lightning/sparc/core.h: Add another V register, move R0 to %o7. 2004-07-15 Paolo Bonzini * lightning/i386/funcs.h: Implement jit_flush_code, in order to support Fedora's exec-shield. 2004-07-14 Paolo Bonzini * lightning/core-common.h: Add more jit_extr_*_* macros. * lightning/doc/using.texi: Be clearer about the order of arguments in jit_extr_*_*. * lightning/doc/porting.texi: Add more jit_extr_*_* macros. * lightning/i386/fp.h: Fix typo in jit_extr_i_d. 2004-07-14 Paolo Bonzini * lightning/ppc/funcs.h: Adjust offset of LR into stack frame if running under the Darwin ABI. 2004-07-13 Paolo Bonzini * lightning/i386/fp.h: Rename jit_exti_d to jit_extr_i_d. 2004-07-13 Paolo Bonzini * lightning/ppc/core.h: Fix thinko. * lightning/i386/core.h: Fix jit_lti_ui. * lightning/core-common.h: Add missing macros. * lightning/ppc/fp.h: Rename jit_neg_* to jit_negr_*. * lightning/i386/fp.h: Rename jit_neg_* to jit_negr_*. * lightning/sparc/fp.h: Rename jit_neg_* to jit_negr_*. * lightning/fp-common.h: Rename jit_neg_* to jit_negr_*. * doc/porting.texi: Add undocumented macros. 2004-07-12 Paolo Bonzini * doc/porting.texi: Add missing macros. 2004-07-12 Paolo Bonzini * lightning/ppc/funcs.h: Don't generate trampolines. Separate prolog and epilog generation. * lightning/ppc/core.h: Generate epilog explicitly. Don't reserve r31 anymore. * lightning/core-common.h: Remove call to jit_setup_code. 2004-07-09 Paolo Bonzini * lightning/lightning.h.in: Avoid preprocessor warnings. * lightning/lightning-inst.h: Likewise. * lightning/i386/core.h: Define JIT_R, JIT_R_NUM, JIT_V, JIT_V_NUM. * lightning/ppc/core.h: Likewise. * lightning/sparc/core.h: Likewise. * lightning/i386/fp.h: Define JIT_FPR, JIT_FPR_NUM. * lightning/ppc/fp.h: Likewise. * lightning/sparc/fp.h: Likewise. * lightning/core-common.h: Define fixed register names. * lightning/fp-common.h: Likewise for FP regs. 2004-07-09 Paolo Bonzini * lightning/ppc/funcs.h: Fix location where return address is stored. * lightning/i386/asm.h: Add a trailing _ to opcodes without any parameter. * lightning/i386/core.h: Adjust for the above. 2004-04-15 Paolo Bonzini * lightning/i386/fp.h: Change "and" to "_and" to satisfy C++ compilers. 2004-04-14 Paolo Bonzini * lightning/sparc/fp.h: Use memcpy to implement jit_movi. * lightning/ppc/fp.h: Use memcpy to implement jit_movi. Move floating-point opcodes... * lightning/ppc/asm.h: ... here. 2004-04-14 Paolo Bonzini * lightning/core-common.h: Add jit_finishr. * lightning/ppc/core.h: Add jit_callr and jit_finishr. * lightning/i386/core.h: Add jit_callr. * lightning/sparc/core.h: Add jit_callr. Fix typo. 2004-04-14 Paolo Bonzini * lightning/i386/core.h: Fix pasto in jit_b*_ui. 2004-03-30 Laurent Michel * lightning/ppc: Implement PowerPC floating point (ChangeLog entry missing). 2004-03-12 Paolo Bonzini * lightning/fp-common.h: Load/store macros are not the same for floats and doubles anywhere, but jit_retval may be. * lightning/i386/asm.h: Fix = mistaken for == in ESCrri. * lightning/i386/core.h: Fix typo in jit_prepare_[fd]. * lightning/i386/fp.h: Rewritten. * tests/testfp.c: Add tests for unordered comparisons. * tests/testfp.ok: Add results. 2004-03-15 Paolo Bonzini Merge changes from Laurent Michel. * lightning/asm-common.h: Add _jit_I_noinc. * lightning/core-common.h: Support jit_init, jit_setup_code, jit_patch_at. Return patchable IP from jit_movi_p. * lightning/funcs-common.h: Provide defaults for jit_setup_code, jit_start_pfx, jit_end_pfx * lightning/i386/core.h: Add jit_patch_at, jit_patch_movi. * lightning/ppc/core.h: Likewise. * lightning/sparc/core.h: Likewise. * lightning/ppc/asm.h: Fix generation of branch destination displacements in _FB and _BB * lightning/ppc/core.h: Generate trampolines in the user area. * lightning/ppc/funcs.h: Add a few casts. * tests/bc.c: New testcase. * lightning/i386/asm.h: Wrap into #ifndef LIGHTNING_DEBUG. * lightning/ppc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG. * lightning/sparc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG. 2004-03-09 Paolo Bonzini * lightning/sparc/fp.h: Rewrite. Move macros for FP code generation... * lightning/sparc/asm.h: ... here. * lightning/sparc/core.h: Rename jit_prepare to jit_prepare_i, jit_retval to jit_retval_i. * lightning/ppc/core.h: Rename jit_prepare to jit_prepare_i, jit_retval to jit_retval_i. * lightning/i386/core.h: Rename jit_prepare to jit_prepare_i, jit_retval to jit_retval_i. * lightning/core-common.h: Provide backwards compatible synonyms for the above. * lightning/fp-common.h: Rewrite. * lightning-inst.h: Include fp unconditionally. * lightning.h.in: Include fp unconditionally. * tests/Makefile.am: Enable fp tests. * tests/fib.c: Use jit_retval_i. * tests/fibit.c: Cast codeBuffer to char *. * tests/funcfp.c: Use new fp macros. * tests/printf.c: Use jit_retval_i. * tests/rpnfp.c: Use new fp macros. * tests/testfp.c: Use new fp macros. 2004-03-02 Paolo Bonzini * lightning/i386/core.h: generate correct code when doing lt/le/ge/etc. on ESI and EDI. Use MOVZX/MOVSX where possible. * lightning/i386/asm.h: Add macros for MOVZX/MOVSX. Move macros for x87 here, and add many of them. * lightning/i386/fp.h: Use new macros for x87. 2004-02-06 Paolo Bonzini * lightning/i386/core.h: avoid generating MOV reg, reg. * lightning/sparc/core.h: fix several bugs. * lightning/ppc/core.h: fix several bugs. * tests/rpn.c: rewritten. 2004-01-08 Paolo Bonzini * tests/rpnfp.c: new example, suggested by Basile Starynkevitch. * tests/rpnfp.ok: new example. 2003-12-12 Paolo Bonzini * tests/add.c: new test, suggested by Steve Dekorte. * tests/add.c: new test. 2003-11-14 Paolo Bonzini John Redford * lightning/asm-common.h: change the 'pc' field of _jit to be a union of various data types, because ISO C99 doesn't permit using ++ on a = cast. Change the incremented casts of _jit.pc to be _jit.x.uc_pc, _jit.x.us_pc, etc. * all files: change all non-cast instances of _jit.pc to be _jit.x.pc. * lightning/i386/core.h: remove casts from jit_might. 2003-05-25 Paolo Bonzini * lightning/i386/core.h: use JITSORRY in jit_replace * lightning/asm-common.h: define JITSORRY 2003-05-14 Paolo Bonzini * lightning/i386/core.h: fix missing comma in several load/store macros. * lightning/core-common.h: fix long/unsigned long/pointer jit_pushr/jit_popr. * lightning/ppc/funcs.h: correctly align stack pointer No changelogs for the assemblers (lightning directory) until 1.0 2003-03-27 Paolo Bonzini * tests/printf2.c: new test 2001-05-03 Paolo Bonzini * tests/printf.c: made the message platform independent 2001-01-19 Paolo Bonzini * configure.in: support cross-assembling * disass/bfd.h, disass/dis-asm.h, disass/dis-buf.c, disass/i386-dis.c, disass/i386.h, disass/ppc-dis.c, disass/ppc.h, disass/ppc-opc.c, disass/sparc-dis.c, disass/sparc.h, disass/sparc-opc.c: new files, from GDB * disass/disass.c, disass/Makefile.am: new files * tests/fib.c, tests/fibit.c, tests/incr.c, tests/printf.c, tests/rpn.c, tests/testfp.c, tests/Makefile.am: support disassembling