1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-04 22:40:25 +02:00
Commit graph

419 commits

Author SHA1 Message Date
Paulo Cesar Pereira de Andrade
d4a2a1ba07 Correct branches and several ALU operations with 64 immediates
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.
2010-08-29 11:55:11 +02:00
Paulo Cesar Pereira de Andrade
67e1051827 Account stack alignment on jit functions with odd number of arguments.
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.
2010-08-25 20:50:41 -03:00
PCPA
fe9f114745 Implement x86_64 support for multiple integer and float 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.
2010-08-25 07:02:52 -03:00
PCPA
d04cfb05ac Change jit_finish to work with varargs functions in x86_64.
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.
2010-08-25 06:55:50 -03:00
PCPA
100fbd17fb Change JIT_FPR_NUM to 7 to prevent clobber of JIT_FPR(7)
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.
2010-08-25 06:47:42 -03:00
PCPA
ec36c13183 Change JIT_REXTMP to not clobber 6th argument.
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-25 06:45:42 -03:00
Paulo Cesar Pereira de Andrade
3eb42b42b6 Change JIT_REXTMP, JIT_R, JIT_V to use 64-bit registers 2010-08-24 12:37:29 +02:00
Paulo Cesar Pereira de Andrade
58043d717d Add safety check on number of integer and float arguments on x86_64. 2010-08-24 12:37:29 +02:00
Paulo Cesar Pereira de Andrade
adc42ad2ad Define extra SSE2 xmmN registers and set JIT_FPTMP to the topmost one. 2010-08-24 12:37:29 +02:00
Paulo Cesar Pereira de Andrade
fb86d498a4 Change jit_getarg_{c,uc,s,us,i,ui} to extr_l to sign extend on 64 bits. 2010-08-24 12:37:20 +02:00
Paolo Bonzini
9564132c94 more fixes to fp branches
2010-08-20  Paolo Bonzini  <bonzini@gnu.org>

	* 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-20 10:08:43 +02:00
Paolo Bonzini
688e75a092 fix x86_64 jit_bner_{f,d}
2010-08-18  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/fp-64.h: Fix jp in jit_bner_{f,d}.
2010-08-19 09:44:35 +02:00
Paolo Bonzini
7e19a3da19 fix -D_ASM_SAFETY compilation of beqr_d and bne_d
2010-08-18  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/fp-32.h: Fix -D_ASM_SAFETY compilation.
	Reported by Paulo César Pereira de Andrade.
2010-08-18 10:05:42 +02:00
Paolo Bonzini
e19b41c9f0 ldst test update
2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

	* tests/ldst.c: Update.
	* tests/Makefile.am: Use -ffloat-store to compile it.
2010-08-15 06:41:42 -04:00
Paolo Bonzini
64ccd054f2 fix 64-bit load with sign extension
2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

	* 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-15 06:32:19 -04:00
Paolo Bonzini
ceaf1b05cf fix jit_extr_f_d and jit_extr_d_f for x86-64
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-08-15 06:29:51 -04:00
Paulo César Pereira de Andrade
5cef649486 fix two bugs in load/store for i386
* lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir.
(jit_movbrm): Check index register as well.
2010-08-10 08:35:35 -04:00
Paolo Bonzini
5ea118e8a9 add ldst test
2010-07-28  Paolo Bonzini  <bonzini@gnu.org>

	* tests/Makefile.am: Add ldst test.
	* tests/Makefile.in: Regenerate.
	* tests/ldst.c: New.
	* tests/ldst.ok: New.
2010-07-28 23:29:24 +02:00
Paolo Bonzini
128ad6a4e7 fix i386 jit_replace and x86_64 jit_movi_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.
2010-07-28 23:29:13 +02:00
Paolo Bonzini
2ecf6a2c28 fix jit_movbrm in the i386 backend
2010-07-26  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core-32.h (jit_replace): Move here (removed
	2009-03-01).
2010-07-26 09:14:18 +02:00
Paolo Bonzini
21ece8cdcd always set and replace lightning_frag
2010-07-19  Paolo Bonzini  <bonzini@gnu.org>

	* 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.
2010-07-19 14:40:08 +02:00
Paolo Bonzini
ef7d11decb always set and replace lightning_frag
2010-07-19  Paolo Bonzini  <bonzini@gnu.org>

	* build-aux/lightning.m4: Always set and replace lightning_frag.
2010-07-19 14:34:35 +02:00
Paolo Bonzini
7179d226ed fix x86 shifts
2009-03-01  Paolo Bonzini  <bonzini@gnu.org>

        * 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  <mike@comlab.ox.ac.uk>

        * lightning/i386/core.h: Rewrite shift-handling macros.
        * lightning/fp-common.h: Fix jit_extr_{f_d,d_f}.
2009-03-01 17:59:41 +01:00
Paolo Bonzini
e6c352bc3e fix blunder in operand order (i386)
2009-02-17  Mike Spivey  <mike@comlab.ox.ac.uk>

	* lightning/i386/core.h: Fix blunder in operand order.
2009-02-19 20:23:30 +01:00
Paolo Bonzini
d671ec726d another fix to jit_fp_btest
2009-02-17  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/fp-32.h: Another fix to jit_fp_btest.
2009-02-17 12:20:19 +01:00
Paolo Bonzini
a76f19c5ef fix problems with i386 32-bit floating point branches
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.
2009-02-17 09:57:23 +01:00
Paolo Bonzini
f87b2f6df8 subtract 1 from the final byte being flushed in PPC jit_flush_code
2008-10-09  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/ppc/funcs.h (jit_flush_code): Subtract 1 from end.
	Reported by Eli Barzilay and Matthew Flatt.
2008-10-09 10:19:26 +02:00
Paolo Bonzini
da92a86557 fix installation bug
2008-08-23  Nix  <nix@esperi.org.uk>

	* lightning/i386/Makefile.frag: fp-32.h and fp-64.h are target files.
2008-08-23 15:33:54 +02:00
Laurent Michel
b3817a102e fix miscellaneous PPC-32 back-end bugs
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-07-10 16:09:05 +02:00
Paolo Bonzini
66c8a682af fix IMULQir and IMULQirr
2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/asm-64.h: Forward IMULQir to IMULQirr,
	fix REXQ order for IMULQirr.
2008-06-17 15:20:23 +02:00
Paolo Bonzini
aa56a6b65f fix _rN vs. _rR
2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core.h: Fix _rN vs. _rR.
2008-06-17 10:21:52 +02:00
Paolo Bonzini
8b2f05549c move JIT_R1/JIT_R2 to R10/R11 for the x86_64 backend
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-17 09:32:35 +02:00
Paolo Bonzini
6ee7c12349 rewrite x86-64 argument passing to support up to 6 arguments
2008-06-15  Paolo Bonzini  <bonzini@gnu.org>

        * lightning/i386/core-64.h: Rewrite argument passing to
	support up to 6 arguments and generate less code.
2008-06-16 14:09:10 +02:00
Laurent Michel
0b676371fa fix x86-64 jit_movi_l (x, 0) and 16-byte stack alignment in the prolog
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-16 08:05:56 +02:00
Laurent Michel
297ed204de add (void) casts for C++ compatibility
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-13 17:14:04 -07:00
Paolo Bonzini
240905434b move x86-64 JIT_V1/JIT_V2 in R12/R13
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-12 22:51:50 -07:00
Paolo Bonzini
66aef1c644 detect 32-/64-bit variant of i386 back-end at include time (not configure time)
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 19:00:37 -07:00
Paolo Bonzini
ef7eb772be use MOVLir directly to implement i386 32-bit jit_movi_p
2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core-32.h: Use MOVLir instead of jit_movi_l
	to implement jit_movi_p.
2008-06-11 12:41:26 -07:00
Paolo Bonzini
e3461957f6 fix stack alignment for Apple 32-bit ABI
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-06-11 12:37:24 -07:00
Paolo Bonzini
4bc1260c51 fix C++ incompatibility in i386 back-end
2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core-i386.h: Fix C++ incompatibility.
2008-06-11 08:01:15 -07:00
Laurent Michel
1e9000649c fix jit_replace8 for case when one of the operands is _EAX.
2008-06-10  Laurent Michel  <ldm@engr.uconn.edu>

	* lightning/i386/core-i386.h: Fix jit_replace8 for
	case when one of the operands is _EAX.
2008-06-10 16:47:07 -07:00
Paolo Bonzini
5ab8cddd61 avoid CRLF issues on mingw
2008-05-19  Paolo Bonzini  <bonzini@gnu.org>

	* tests/run-test: Avoid CRLF issues on mingw.
2008-05-19 10:58:41 +02:00
Paolo Bonzini
beb5fa12ec add .gitattributes file 2008-04-10 11:30:17 +02:00
Paolo Bonzini
4865ed3451 fix several load/store patterns for x86-64.
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.
2008-03-21 09:08:38 +01:00
Paolo Bonzini
1014c9bb12 fix uses of jit_qop_ with 4 parameters
2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core-64.h: Fix uses of jit_qop_.
2008-03-19 15:04:06 +01:00
Paolo Bonzini
f4bf06ad41 add long boolean operations for x86-64
2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core-64.h: Add boolean operations.
2008-03-19 09:57:13 +01:00
Paolo Bonzini
00f73f17d4 add LEAQmr for x86-64
2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/asm-64.h: Add LEAQmr.
2008-03-19 09:57:12 +01:00
Paolo Bonzini
9a188c1b29 misc. x86-64 bugfixes
2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/i386/core-64.h: Misc bugfixes.
2008-03-19 09:57:11 +01:00
Paolo Bonzini
90e08b1cda add missing x86-64 memory operations
2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	* 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},
	jit_ldr_i, jit_ldxr_i, jit_str_l, jit_stxr_l.
2008-03-19 09:56:19 +01:00
Paolo Bonzini
91cfad4175 add _s32P
2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	* lightning/asm-common.h: Add _s32P.
2008-03-19 09:56:05 +01:00