1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00
Commit graph

419 commits

Author SHA1 Message Date
Andy Wingo
3c76115aec Update version.texi 2018-10-30 10:48:00 +01:00
Paulo Andrade
94a188844d Correct typo and values in jit_sparc-sz.c 2018-04-25 16:02:52 -03:00
Paulo Andrade
d2ff737812 HPPA: Correct wrong regarg_p check
If argument registers are in incremental order in the global _rvs
vector, the check if a register argument is reversed.
  Adapted from a regression found in sparc 64.
2018-04-20 15:01:44 -03:00
Paulo Andrade
2cea99361b Build and pass all tests on 32 and 64 bit sparc
* include/lightning/jit_private.h: Add new register classes to
	flag float registers and double only registers, required for sparc64
	where only low 32 bit fpr registers can be used for single precision
	operations.
	Add new 128 bit jit_regset_t type for sparc64 register set.

	* include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
	lib/jit_sparc-sz.c, lib/jit_sparc.c: Update for 64 bits sparc.

	* lib/lightning.c: Update for new jit_regset_t required for sparc64.
2018-04-20 10:37:37 -03:00
Paulo Andrade
ed5589ce59 Build and pass all test cases on Alpha Linux
* check/lightning.c, include/lightning.h: Add the new jit_va_push
	interface. That should be called when passing a va_list to a C
	function. This is required because on Alpha a va_list is passed
	by value, and lightning does not know about data types, so, cannot
	understand it is pushing a va_list as argument.

	* lib/jit_names.c, lib/lightning.c: Minor changes for the new
	jit_code_va_push.

	* check/cva_list.c: Update only test case using jit_va_push, to
	pass a va_list to a C function.

	doc/body.texi: Better documentation of the varargs interface.

	* jit_alpha.c, jit_alpha-cpu.c: Update to properly push a
	C va_list and correctly calculate varargs offset.

	* lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_alpha-sz.c,
	lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
	lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_mips-sz.c, lib/jit_mips.c,
	lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_s390-sz.c, lib/jit_s390.c,
	lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-sz.c, lib/jit_x86.c:
	Update for the new jit_va_push interface.
2018-02-26 09:48:50 -03:00
Paulo Andrade
b64b82ca51 Always set t12 to address of called function
* lib/jit_alpha-cpu.c: Always set t12 to the address of the
	current function, to properly work on all systems. Previously
	the shortcut did only work on Tru64. For Linux and glibc the
	change is required.
2018-02-22 13:17:28 -03:00
Paulo Andrade
2cf092efe4 Correct logic error with jit_live in jit_retr
* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c:
	Correct wrong logic in usage of jit_live in jit_retr. The
	problem is that if a temporary is required during epilog,
	the return register might be allocated, so, jit_live must always
	be used.
2018-02-22 13:05:04 -03:00
pcpa
59f32e85c3 Add extra argument to jit_update to prevent recursion on branches
* lib/lightning.c: Avoid deep recursions when computing live
	register ranges.
2018-01-31 17:09:29 -05:00
pcpa
68dc475474 Correct issues with 32 bit big endian mips abis
* lib/jit_mips-cpu.c: Correct frame size and varargs
	initialization for the n32 abi.
	* lib/jit_mips.c, lib/jit_mips-fpu.c: Correct 32 bit abis
	in big-endian.
2018-01-31 08:52:27 -05:00
pcpa
df57fa95eb GNU lightning 2.1.2 release 2017-09-14 13:27:48 -04:00
pcpa
19439d47cb Correct binutils version detection 2017-09-14 13:27:09 -04:00
pcpa
c72b92333d GNU lightning 2.1.1 release 2017-09-14 10:44:34 -04:00
pcpa
3fc2eb2f95 Update copyright year 2017-09-14 10:44:12 -04:00
pcpa
7259f9dc8a Adapt for binutils 2.29
* configure.ac: Add check for binutils 2.29 prototype to the
	disassembler function.
	* lib/jit_disasm.c: Adapt for binutils 2.29 change.
2017-09-13 11:39:30 -04:00
pcpa
d761499315 Add a second pass to compute live register ranges
* include/lightning/jit_private.h, lib/lightning.c: Add a
	second pass from start when computing register live ranges.
	This should be used temporarily, and is required for certain
	loop constructs, with several consecutive blocks not referencing
	a live register.
2017-05-09 13:27:37 -04:00
pcpa
aa939b8ef8 Correct wrong live information for some code patterns
* lib/lightning.c: Correct wrong movr simplification,
	remove no longer needed code to set return registers live
	and update live register set when reaching a label boundary,
	but do not descend if the block has been already visited.
	The later need some tuning for complex code generation, where
	it will still have issues.
2016-05-05 17:55:29 -03:00
pcpa
b00c750830 Correct wrong movr simplification 2016-05-05 11:19:45 -03:00
Paulo Andrade
be32b6ad15 Correct wrong check for argument of value 2 in check/fib.tst. 2015-11-30 17:04:47 -02:00
Paulo Andrade
76876dd7bf Implement a correct generation of Fibonacci numbers.
* doc/body.texi: Change documentation to no longer say
	it is a variant of the Fibonacci sequence, and document
	a proper implementation.
	Thanks to Jon Arintok for pointing out that the Fibonacci
	sequence generation was incorrect. It was documented, but
	still confusing.

	* check/fib.tst, check/fib.ok, check/bp.tst, check/bp.ok,
	doc/ifib.c, doc/rbif.c: Implement a proper Fibonacci
	sequence implementation.
2015-11-30 15:32:48 -02:00
Paulo Andrade
fd57359498 Correct missing jit_unget_reg calls 2015-11-04 17:05:51 -02:00
pcpa
17e78965a2 mips: Pass tests for variadic jit functions on new abi
* lib/jit_mips-cpu.c: Correct definition of htonr_ul.
	Correct prolog/epilog/va* routines to work on o64 abi.

	* lib/jit_mips-fpu.c: Correct load of double literal
	argument when not using a data buffer.
	Remove alignment correction in vaarg_d if using the
	new mips abi.

	* lib/jit_mips.c: Correct code to allow creating variadic
	jit functions when using the new mips abi.

	* lib/jit_rewind.c: Minor adjust for rewind when using
	the new mips abi, if there are varargs arguments in
	registers.
2015-07-03 20:53:34 -03:00
Paulo Andrade
c6b8fb2a74 ia64: Pass all tests for variadic jit functions
* lib/jit_ia64-cpu.c: Search backward for the last output
	register used, otherwise would stop too early if a float
	argument used the slot.
	Correct offset of first va_list argument, and use proper
	va_list abi.

	* lib/jit_ia64-fpu.c: Add new functions to move a gpr
	to a fpr register, to counterpart the ones that move a
	fpr to a gpr. These are required to properly implement
	jit_getarg*_{f,d} on complex prototypes, or variadic
	jit functions.

	* lib/jit_ia64-sz.c: Update for support to jit variadic
	functions.

	* lib/jit_ia64.c: Implement proper abi for variadic
	jit functions.
2015-06-06 22:28:20 -03:00
pcpa
d0a5bd8d3d Implement new synthesized IR codes sequences
* lib/jit_rewind.c: New file implementing generic functions
	to "rewind", or rewrite IR code sequences.

	* include/lightning.h: Add several new codes, that previously
	were a function call, that would synthesize the operation.
	Now, there is a code for the operation, and a new flag to
	know an operation is synthesized.

	* include/lightning/jit_private.h: Add several new macros to
	help construct synthesized IR code sequences.

	* lib/Makefile.am: Update for lib/jit_rewind.c.

	* lib/jit_disasm.c: Update for a small rework on jit_node_t,
	so that --enable-devel-disassembler does not need a change
	in the layout of jit_node_t.

	* lib/jit_names.c: Update for the new codes.

	* lib/jit_print.c: Update to print more readable output, and
	flag synthesized IR code sequences.

	* lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
	lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_x86-sz.c,
	lib/jit_x86.c: Update for new synthesized IR code sequences.

	* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu., lib/jit_ppc-sz.c,
	lib/jit_ppc.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
	lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_s390-fpu.c,
	lib/jit_s390-sz.c, lib/jit_s390.c: Update for new synthesized
	IR code sequences and correct bugs in the initial varargs
	implementation support.

	* lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_hppa-sz.c,
	lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
	lib/jit_sparc-sz.c, lib/jit_sparc.c: Add generic, untested
	support for the new synthesized	IR code sequences. Known
	most likely broken right now, and should be corrected once
	access to these hosts is available.

	* lib/lightning.c: Update for new IR codes, and add support
	for not yet existing instructions that change third argument.

	* size.c: Change to use different tables for LE and BE PowerPC.
	Correct a wrong endif for x32.
2015-06-04 18:53:07 -03:00
pcpa
7f1e0dfb34 Move definition of jit_va_ codes, cosmetic change. 2015-05-25 16:06:55 -03:00
pcpa
e21db9c421 Use an actual, invalid code, as last jit code. 2015-05-25 16:00:01 -03:00
pcpa
1ce1d00db8 Move multiply defined macro to a single header file. 2015-05-25 15:53:17 -03:00
pcpa
0b6cc01eea Intermediate, fully functional, rework for variadic functions
* check/cva_list.c: New file implementing a test to ensure
	the value returned by jit_va_start is a valid C va_list.

	* check/va_list.ok: New simple helper file, as now the
	va_list.tst test is enabled.

	* check/va_list.tst: Rewritten for an extensive variadic
	jit functions test.

	* check/Makefile.am: Update for the new tests.

	* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
	lib/jit_arm.c: Correct broken software float in a previous
	commit. Note that the hard float abi implementation is known
	broken at this time, for special cases involving variadic
	functions, and should be corrected next.

	lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c: Correct
	the jit_va_list_t semantics to match C va_list.
2015-05-25 15:20:24 -03:00
pcpa
237c90295a Bump library major.
* lib/Makefile.am: Bump library major. This is a preparation
	for a rework that was due for quite some time, but that is
	now required to properly implement variadic jit functions.
	The rework is mainly required to know at prolog parsing, if
	a function is variadic or not. This will benefit a few
	backends, and is mandatory for the hard float arm abi.
	The rework was already planned for quite some time, to
	be able to use a variable stack framesize, and for leaf
	functions optimization where applicable.
	The change will be source compatible, but will change
	some internals, and jit_code_t values, as some new will
	be added.
	The only behavior change is that, jit_arg_register_p may
	change return value on hard float arm abi, if called before
	or after jit_ellipsis. Common sense anyway, would say to
	make that call after jit_ellipsis, but documentation
	should be updated for it.
2015-05-24 14:44:04 -03:00
pcpa
316dfc6e5e aarch64: Correct va_list offsets and double load.
* lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: Correct base
	aarch64 varargs code.
2015-05-24 14:34:16 -03:00
pcpa
97f69a9c9c Correct make check for systems without gcc.
* check/lightning.c: Clearly run check if clang is the system
	compiler.
2015-05-24 13:50:58 -03:00
Paulo Andrade
d6a5a90d5a alpha: Save correct offset if loading a vararg double. 2015-05-20 23:19:16 -03:00
pcpa
bd38cfa9c9 sparc: Add initial jit_va_ calls to sparc
* lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c, lib/jit_sparc.c:
	Add base support to jit vararg functions to the sparc backend.
2015-05-20 14:33:31 -03:00
pcpa
9a90a28360 alpha: Add initial jit_va_ calls to alpha
* lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c, lib/jit_alpha.c:
	Add base support to jit vararg functions to the alpha backend.
2015-05-20 13:09:22 -03:00
pcpa
fdd55b903a hppa: Add initial jit_va_ calls to hppa
* lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c, lib/jit_hppa.c:
	Add base support to jit vararg functions to the hppa backend.
2015-05-19 19:39:28 -03:00
Paulo Andrade
6d8f8eb604 ia64: Add initial jit_va_ calls to ia64
* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c:
	Add base support to jit vararg functions to the ia64 backend.
2015-05-10 19:35:40 -03:00
Paulo Andrade
a3063df782 ia64: Do not use a dangling pointer for double to integer copy
* lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
	and movi_f_w implementation to work when not using a
	data buffer. This causes the check varargs.tst to
	work when passing "-d" to the lightning test tool.
2015-05-10 18:33:05 -03:00
Paulo Andrade
f48e07b58b ia64: Implement cache flush.
* lib/jit_ia64.c: Implement inline assembly cache flush,
	required on multiprocessor systems.
2015-05-10 16:22:26 -03:00
pcpa
a5ab4c7718 mips: Add initial jit_va_ calls to mips
* lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c:
	Add base support to jit vararg functions to the mips backend.
	Currently only supported on the o32 abi, until access to a
	n32 system is arranged.
2015-05-06 20:02:17 -03:00
pcpa
b42bb8b7a1 Remove wrong comment after cut and paste 2015-05-05 20:57:18 -03:00
pcpa
cc217f0608 ppc: Add initial jit_va_ calls to ppc
* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c:
	Add base support to jit vararg functions to the PowerPC backend.
2015-05-05 20:55:05 -03:00
pcpa
2c8b5e530c s390: Add initial jit_va_ calls to s390
* lib/jit_s390-cpu.c, lib/jit_s390-fpu.c, lib/jit_s390.c:
	Add base support to jit vararg functions to the s390 backend.
2015-05-02 21:15:16 -03:00
pcpa
8cb302f337 arm: Add initial jit_va_ calls to arm
* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
	lib/jit_arm.c: Add base support to jit vararg
	functions to the arm backend.
2015-05-01 14:05:00 -03:00
pcpa
0986ae8a86 aarch64: Add initial jit_va_ calls to aarch64
* lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
	lib/jit_aarch64.c: Add base support to jit vararg
	functions to the aarch64 backend.
2015-04-30 17:40:14 -03:00
pcpa
6329945281 Correct update of on stack vararg double argument pointer 2015-04-30 14:04:32 -03:00
pcpa
e4fe5186e6 Update the correct fp offset and add assertions 2015-04-30 10:17:17 -03:00
pcpa
d639674549 Add initial support to implement vararg jit functions
* include/lightning.h, include/lightning/jit_private.h,
	lib/jit_names.c, lib/lightning.c: Add initial support
	for the new jit_va_start, jit_va_arg, jit_va_arg_d, and
	jit_va_end interfaces. The jit_va_start call is supposed
	to return a va_list compatible pointer, but not yet
	decided if it will be "declared" stdarg compatible,
	as for now only x86 support has been added (and should
	be compatible), but issues may arise on other backends.

	* check/lightning.c: Add wrappers to call the new jit_va_*
	interfaces.

	* lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
	jit_va_* for x86.

	* lib/jit_x86-sz.c: Add fields, but not yet fully updated,
	as this is an intermediate commit.

	* lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
	lib/jit_alpha-sz.c, lib/jit_alpha.c,
	lib/jit_arm-sz.c, lib/jit_arm.c,
	lib/jit_hppa-sz.c, lib/jit_hppa.c,
	lib/jit_ia64-sz.c, lib/jit_ia64.c,
	lib/jit_mips-sz.c, lib/jit_mips.c,
	lib/jit_ppc-sz.c, lib/jit_ppc.c,
	lib/jit_s390-sz.c, lib/jit_s390.c,
	lib/jit_sparc-sz.c, lib/jit_sparc.c: Prepare for the
	new jit_va_* interfaces. Not yet implemented, and will
	cause an assertion if used.

	* check/va_list.tst: Simple early test case, that works
	on x86_64, x32, ix86, cygwin, and cygwin64.
2015-04-27 21:12:32 -03:00
pcpa
a15f261afc Update copyright date 2015-04-26 14:33:41 -03:00
pcpa
1507bc7ee5 Properly correct read of freed memory 2015-03-08 16:22:10 -03:00
pcpa
20955b2bfc Correct read of freed memory 2015-03-01 11:38:41 -03:00
pcpa
531a88aeeb Add missing ellipsis in allocar.tst 2015-02-17 17:39:58 -02:00