jit_bra_l had the logic reversed, and correcting that also corrected
jit_b{lt,le,eq,ge,gt,ne}i_l.
TESTQir and _ALUQir were not properly working with 64 bit immediates,
that require using a temporary register (JIT_REXTMP) as there are no
related opcodes for 64 bit immediates. This corrected jit_bm{s,c}i_l and
jit_bo{add,sub}i_l.
Now, the tests in
http://code.google.com/p/exl/source/browse/trunk/check/lightning/branch.tst
pass.
The x86_64 correction to keep stack aligned in jit_finish* was only
correct for functions being called, but did not correctly handle alignment
of stack arguments.
This changes the usage of some of the jit_local_state fields, and add
two extra ones. Since jit_arg_x now returns either a register offset or
an stack offset, it does not add _XMM0 to nextarg_putfp to distinguish
from stack offsets.
The nextarg_puti field is used to known when run out of integer register
arguments, and should push arguments on the stack.
The new framesize field is used to keep track of jit_arg_x offset on
the stack, when jit_arg_x runs out of registers.
The argssize field is used in a slightly different way now, and is
used to keep track of number of stack slots used to pass arguments, and
nextarg_puti is used in its previous semantics, to also match nextarg_putfp
logic.
It is required to set %al to 0-8 inclusive, telling the number of
xmm registers used to pass arguments.
This also corrects the calculation of _jitl.nextarg_putfp, that
would be incorrect if calling a function with both, float and double
arguments.
Lightning provides at least 6 float registers, so, in this commit,
reduce from 8 to 7 so that code respecting JIT_FPR_NUM should be
safe again't use of JIT_FPTMP.
To not clobber JIT_R2, JIT_REXTMP is defined to the callee save register
%r12, instead of the expected, scratch register %r11.
To have JIT_V_NUM at least at 3, it now also uses %r14, but does not add
%r15, that could be JIT_V(4) to simplify logic of keeping stack 16 bytes
aligned.
2010-08-10 Paulo César Pereira de Andrade <pcpa@mandriva.com.br>
Paolo Bonzini <bonzini@gnu.org>
* 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 <bonzini@gnu.org>
* 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.
2009-02-17 Paolo Bonzini <bonzini@gnu.org>
* 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-07-02 Laurent Michel <ldm@engr.uconn.edu>
* 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-16 Paolo Bonzini <bonzini@gnu.org>
* 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-14 Laurent Michel <ldm@thorgal.homelinux.org>
* 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 <ldm@thorgal.homelinux.org>
* lightning/i386/core-64.h: Add (void) casts for C++ compatibility.
* lightning/i386/asm.h: Likewise.
2008-06-12 Paolo Bonzini <bonzini@gnu.org>
* 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 <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.
2008-06-11 Paolo Bonzini <bonzini@gnu.org>
* 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-03-21 Paolo Bonzini <bonzini@gnu.org>
* 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.