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

277 commits

Author SHA1 Message Date
pcpa
dbb9fe1e81 x86_64: Correct wrong inline assembly in jit_get_cpu
* lib/jit_x86.c: Rewrite incorrect inline assembly that could
	truncate a variable in a callee save register. Now it simply
	tells gcc that the register is clobbered, instead of using a
	*32 bit* swap with a temporary variable. The problem only
	happens when compiling with optimization.
2014-02-19 15:29:26 -03:00
pcpa
6e75c0352d Rewrite jit_regset_scan1 for easier optimization.
* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
	include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
	include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
	include/lightning/jit_s390x.h, include/lightning/jit_sparc.h,
	include/lightning/jit_x86.h: Change jit_regset_t to an
	unsigned type, to allow safe right shift.

	* lib/lightning.c: Rewrite jit_regset_scan1 to allow easier
	compiler optimization.
2014-02-19 14:38:14 -03:00
pcpa
b1d3217b63 GNU lightning 2.0.3 release 2014-01-08 17:48:33 -02:00
pcpa
8567d28d60 x86: Correct wrong x87 optimization.
* lib/jit_x86-x87.c: Correct wrong optimization when
	loading the log(2) constant.
2013-12-03 15:11:11 -02:00
pcpa
0b0d63d892 x86: Ensure the x87 stack is empty when calling a function.
* lib/jit_x86-cpu.c: Use the emms instruction before
	calling any function. This is particularly important
	when using c99 complex functions as it can easily
	overflow the x87 stack due to the way lightning uses
	the x87 stack as a flat register file.
2013-12-03 15:09:48 -02:00
pcpa
c162b9d836 x86: Correct wrong x87 float indexed store code generation.
* lib/jit_x86-x87.c: Correct wrong code generation due
	to comparing the base and not the value register with
	%st(0) in stxi_f.
2013-12-02 19:17:03 -02:00
pcpa
4e5368d291 Correct wrong call in ldi_f if address does not fit in 32 bit.
This would only happen in x86_64, where x87 registers are not used
neither "exported".
2013-12-02 18:15:14 -02:00
pcpa
479c2eda3c x86: Use aligned offset for x87 to/from sse move.
* lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
	stack offset for float/double x87 to/from sse move.
2013-12-02 17:58:00 -02:00
pcpa
6fa5123855 ARM: Minor changes that should allow building on non gnu-linux/gcc.
* configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
	changes that should at least allow building lightning
	on Apple iOS7.
2013-11-27 15:05:27 -02:00
pcpa
67d994cc5e Sync after regenerating version.texi. 2013-11-27 13:44:49 -02:00
pcpa
f65ceb6c33 GNU lightning 2.0.2 release 2013-11-04 14:06:33 -02:00
pcpa
a264ccee75 Add assertion to detect double patching.
This triggers the bug at the right point, otherwise, double patching
may be quite hard to track.
2013-10-16 01:13:46 -03:00
pcpa
fe3aee2706 PPC: Correct wrong ldxi_l simplification in 64 bit mode
* lib/jit_ppc-cpu.c: Correct wrong shortcut for ldxi_l with
	a zero offset, that was calling ldr_i instead of ldr_l.
2013-10-08 16:39:14 -03:00
pcpa
2d4bac43a9 ARM: Do not use ldrt/strt by default
* include/lightning/jit_arm.h, lib/jit_arm-cpu.c: Do not use
	by default load/store instructions that map to ldrt/strt.
	There is already the long displacement version for positive
	offsets, and when using a (shorter) negative offset it does
	not map to ldrt/strt. At least on qemu strt may cause
	reproducible, but unexpected SIGILL.
2013-10-08 12:26:52 -03:00
pcpa
72f3e65a6d ARM: Correct wrong offset for load/store of floats.
* lib/jit_arm-vfp.c: Correct wrong load/store offset
	calculation when the displacement is constant but too
	large to use an instruction with an immediate offset.
2013-10-08 01:20:19 -03:00
pcpa
0e94048174 Rerun tests on supported backends after bogus self test correction
2013-10-07 Paulo Andrade <pcpa@gnu.org>

	* check/self.c: Extend tests to validate jit_callee_save_p
	does not cause an assertion on valid arguments, and test
	extra registers defined on some backends.

	* configure.ac: Do not ignore environment CFLAGS when
	checking if need to test runtime configurable options,
	like use x87 when sse2 is available, arm instruction set
	instead of thumb, etc.

	* include/lightning/jit_arm.h: Correct wrong jit_f macro
	definition.

	* include/lightning/jit_ia64.h, include/lightning/jit_ppc.h:
	Correct wrong jit_r macro definition.

	* lib/jit_x86-x87.c, lib/jit_x86.c: Actually use the
	reserved stack space for integer to/from float conversion.
	The stack space was also changed to ensure it is 8 bytes
	aligned. Also, for Solaris x86 in 32 bit mode, an alternate
	truncr_d was implemented because for some reason it is
	failing with SIGILL if using the "fisttpl" instructions,
	that must be available on p6 or newer, but for the sake of
	making all tests pass, implement a 486 or newer sequence
	if "sun" is defined.
2013-10-07 17:04:00 -03:00
pcpa
52bfc67192 MIPS: Build and pass all test cases on mips64.
* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
	lib/jit_mips-sz.c, lib/jit_mips.c, size: Build and
	pass all test cases on Irix big endian mips using
	the 64 bit abi.
2013-10-04 00:01:31 -03:00
pcpa
485584546a Correct source of the self test case and a missed check failure. 2013-10-03 19:05:52 -03:00
pcpa
36a60d7aa3 Correct wrong dates in ChangeLog 2013-10-02 23:19:54 -03:00
pcpa
565c3a064e MIPS: Correct abi detection.
* include/lightning/jit_mips.h: Add proper mips abi detection.
2013-10-02 23:18:06 -03:00
pcpa
f42a251ff1 Correct misplaced check for already visited blocks 2013-10-01 13:51:01 -03:00
pcpa
1bd169cfa3 X86: %r12 may be used as an index register.
* lib/jit_x86-cpu.c: Correct not properly tested case of using
	%r12 as index register, what was causing an invalid assertion.
	%r12 is mapped to the "extra" JIT_R3 register, and test cases
	only test "standard" lightning registers.
2013-09-30 13:30:21 -03:00
pcpa
ff73547603 IA64: Force sync of instructions in get-jit-size build mode. 2013-09-28 14:19:33 -03:00
pcpa
0ad5e08ee5 ARM: Correct build when disassembler is disabled. 2013-09-27 13:19:49 -03:00
pcpa
ae6101f662 IA64: Correct some wrong checks value range checks.
* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
	off by one range checks (that were only accepting values
	one less than the maximum allowed) and an invalid test
	condition check that was forcing it to always use
	indirect jumps even when reachable with an immediate
	displacement.
2013-09-25 00:30:42 -03:00
pcpa
2e209eb61d GNU lightning 2.0.1 release 2013-09-24 18:20:41 -03:00
pcpa
b768fab8b1 Add code to calculate code buffer size based on devel time information.
* lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
	lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
	lib/jit_s390x-sz.c, lib/jit_size.c, lib/jit_sparc-sz.c,
	lib/jit_x86-sz.c: New files implementing static tables
	with longest known instructions length generated to match
	a lightning instruction. These tables should make it easier
	to make it very unlikely to ever miscalculate, or by too
	much, the size of a code buffer.

	* lib/jit_size.c: New file that aids to either collect
	jit code size information, or use the information depending
	on build options.

	* size.c: New helper file that parses input for, and create
	an initial jit_$arch-sz.c file, that needs some minor edit
	for arches with multiple configurations.

	* configure.ac, Makefile.am: Add the new, devel mode only
	--enable-devel-get-jit-size configure option, that sets
	compile time flags to collect jit code size information,
	that will be used as input for the "noinst size program".

	* lib/jit_aarch64.c, lib/jit_arm.c, lib/jit_disasm.c,
	lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_memory.c,
	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c,
	lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c: Minor
	changes for the --enable-devel-get-jit-size build mode,
	as well as the "production build mode" with jit code
	size information.
2013-09-24 03:31:54 -03:00
pcpa
95e3fbc8bc Add the new jit_pointer_p predicate interface.
* include/lightning.h, lib/lightning.c: Add the new
	jit_pointer_p interface, that returns a boolean value
	telling if the pointer argument is inside the jit
	code buffer. This is useful to avoid the need to add
	extra labels and calls to jit_address to figure bounds
	of code buffer, and still keep internal data private.
2013-09-14 14:43:05 -03:00
pcpa
948315f45e Make jit_get_note a public interface.
* include/lightning.h, include/lightning/jit_private.h,
	lib/jit_note.c: Change the code argument of jit_get_note
	to a jit_pointer_t and make jit_get_note a public interface.
	It was intended so since start, as a way to map an offset
	in the code to a function name, file name and line number
	mapping.
2013-09-13 18:57:32 -03:00
pcpa
5a2df005c5 Correct wrong example and mt unsafe code in the arm backend.
* doc/body.texi: Correct reversed arguments in example of
	usage in a (possibly) multi threaded, multiple jit_state_t
	environments.

	* include/lightning/jit_arm.h, include/lightning/jit_private.h,
	lib/jit_arm-cpu.c, lib/jit_arm.c: Make a previously, non
	documented, global state private to the related jit_state_t
	generating code.
2013-09-12 00:24:19 -03:00
pcpa
a62f405751 Add the jit_callee_save_p interface and extra register definitions.
* check/self.c, check/self.ok: New files implementing simple
	consistency check assertions. At first validating some macros
	that use values from different sources agree.

	* check/Makefile.am: Update for the new test case.

	* include/lightning.h,  lib/lightning.c: Add the new
	jit_callee_save_p() call, that is intended to be used when
	writing complex code using lightning, so that one does not
	need to verify what backend is being used, or have access to
	private data, to query if a register is callee save or not;
	on several backends the scratch registers are actually callee
	save.

	* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
	include/lightning/jit_hppa.h, include/lightning/jit_mips.h,
	include/lightning/jit_ppc.h, include/lightning/jit_sparc.h,
	include/lightning/jit_x86.h: Add an explicit definition for
	JIT_R3-JIT_Rn, JIT_V3-JIT_Vn and JIT_F6-JIT_Fn when applicable.
	This allows one to write code based on "#if defined(JIT_XN)"
	and therefore, not need to check what is the current backend
	or have access to private data structures. This is particularly
	useful when writing virtual machines with several specialized,
	global registers.

	* lib/jit_ia64.c: Properly flag the callee save general
	purpose registers as such, so that jit_callee_save_p() works
	as intended.
2013-09-10 21:41:49 -03:00
pcpa
15a3ec2567 Use the logic to workaround float NaN and Inf Hercules bug conditional
* check/lightning.c, configure.ac: Conditionally use the
	code written to workaround a bug in the Hercules emulator,
	as isnan and isinf are not available at least on HP-UX ia64.
 enter the commit message for your changes. Lines starting
2013-09-10 21:29:15 -03:00
pcpa
13d521bded S390X: Correct values of float registers saved on stack.
* lib/jit_s390x-cpu.c: Spill/reload correct callee save
	float registers.
2013-09-10 21:26:13 -03:00
pcpa
455237673b HPPA: Correct bogus logic when calling function pointers.
* lib/jit_hppa-cpu.c: Correct code to call a function stored
	in a register or a patched function address.
2013-09-10 21:23:25 -03:00
pcpa
183ed91756 IA64: Correct code to save/restore r2 used as lightning JIT_FP.
* lib/jit_ia64-cpu.c: Correct incorrect logic when restoring
	the value of the "r2" callee save register.
2013-09-10 21:17:44 -03:00
pcpa
c6ced6662d Add missing jit_clear_state to documentation sample. 2013-09-09 19:21:49 -03:00
pcpa
b279feb7c5 Add fallback logic instead of error if cannot figure __WORDSIZE.
This was an issue on FreeBSD 8.x, and the logic used is the same as
FreeBSD 9.1 stdint.h.
2013-09-09 19:19:45 -03:00
pcpa
b8770059dc Correct wrong test and update of arm thumb offset information.
* lib/jit_arm-cpu.c, lib/jit_arm.c: Correct wrong test and update
	of the thumb offset information, when checking if needing to
	patch a jump from arm to thumb mode. The problem would happen when
	remapping the code buffer, and the new address being lower than
	the previous one.
2013-08-29 17:08:05 -03:00
pcpa
ba182b139a Avoid possible problem if built with gcc 4.8 or newer.
The problem happens due to undefined behavior in post increment when
accessing data through an union and the data being modified in the
expression.
2013-08-29 12:59:40 -03:00
pcpa
bc0786e933 test for zlib in configure.ac 2013-08-27 18:29:31 -03:00
pcpa
ecf753f94f Correct build and check on NetBSD amd64.
* configure.ac: Extend FreeBSD test to also handle NetBSD.

	* lib/jit_x86-cpu.c: Correct wrongly defined offset type of
	ldxi_ui. Problem detected when building on NetBSD.

	* lib/lightning.c: Adjust code to handle NetBSD mremap,
	where arguments do not match Linux mremap.
2013-08-26 16:31:42 -03:00
pcpa
7f677a6d4f Correct build and make check on gcc111 - AIX 7.1.
lib/jit_ppc.c: Correct C sequence point problem miscalculating
	the actual function address in a function descriptor. Problem
	happens with gcc 4.8.1 at least.
2013-08-26 15:53:40 -03:00
pcpa
32b3d7a7a4 Correct build on FreeBSD/amd64 2013-08-26 12:40:20 -03:00
pcpa
aa1e0be49b GNU lightning 2.0.0 release 2013-08-23 15:16:18 -03:00
pcpa
b5763c42aa Correct license to properly advertise LGPLv3 and not GPLv3. 2013-08-11 18:08:52 -03:00
pcpa
19e227e035 Correct off by one bug on s390x subi.
* lib/jit_s390x-cpu.c: Correct code checking if immediate
	fits instruction, but using the negated value.
2013-08-11 18:07:44 -03:00
pcpa
c078a972b4 Cosmetic removal of white spaces in end of lines. 2013-08-10 11:38:43 -03:00
pcpa
f6ee396ccb New s390x port built on the hercules emulator and fedora 16 image.
* include/lightning/jit_s390x.h, lib/jit_s390x-cpu.c,
	lib/jit_s390x-fpu.c, lib/jit_s390x.c: New files
	implementing the new s390x port.

	* configure.ac, include/lightning.h,
	include/lightning/Makefile.am,
	include/lightning/jit_private.h,
	lib/Makefile.am, lib/jit_disasm.c, lib/lightning.c:
	Minor adaptation for the new s390x backend.

	* check/float.tst: Update for the s390x result of
	truncating +Inf to integer.

	* check/qalu_mul.tst: Add extra test cases to better test
	high word of signed multiplication as the result is
	adjust from unsigned multiplication on s390x.
2013-07-28 14:13:39 -03:00
pcpa
a3891adb4b Do not assume cast of nan or inf double to float always work.
* check/lightning.c: Do not assume casting a double NaN or
	Inf to float will produce the expected float NaN or Inf.
	This is not true at least under s390x.
2013-07-28 14:05:38 -03:00
pcpa
ab7d15ddd2 Properly check tests output.
* check/check.arm.sh, check/check.sh, check/check.swf.sh,
	check/check.x87.sh: Properly check test programs output,
	not just rely on the test program self testing the results
	and not crashing.
2013-07-28 14:01:22 -03:00