1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 20:30:28 +02:00
Commit graph

7 commits

Author SHA1 Message Date
pcpa
d91b25d1be Implement the qmul and qdiv instructions.
2013-02-04 Paulo Andrade <pcpa@gnu.org>

	* include/lightning.h, include/lightning/jit_private.h,
	lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_mips-cpu.c,
	lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c,
	lib/jit_x86-cpu.c, lib/jit_x86.c, lib/lightning.c:
	Implement the new qmul and qdiv instructions that return signed
	and unsigned lo/hi multiplication result and div/rem division result.
	These should be useful for jit translation of code that needs to
	know if a multiplication overflows (no branch opcode added) or if
	a division is exact (easy check if remainder is zero).

	* check/lightning.c, lib/jit_print.c, check/Makefile.am,
	check/all.tst: Update for the new qmul and qdiv instructions.

	* check/qalu.inc, check/qalu_div.ok, check/qalu_div.tst,
	check/qalu_mul.ok, check/qalu_mul.tst: New files implementing
	simple test cases for qmul and qdiv.
2013-02-04 18:54:37 -02:00
pcpa
1287a2d448 Correct extra regressions found by the call.tst test case.
* lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
	regressions when patching jit_calli for a forward function.

	* lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
	in jit_getarg_u{c,s} implementation.
2012-12-28 10:28:50 -02:00
pcpa
a74318a1d7 Add new test case to check stack integrity on complex stack frames.
* 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-19 18:07:12 -02:00
pcpa
a3fbc5da96 Correct test cases in the mips backend.
* 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-10 21:14:50 -02:00
pcpa
760fab8d37 Correct mips backend implementation to pass initial tests.
* 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 12:39:10 -02:00
pcpa
712877a5a4 Correct implementation problems on ix86.
* 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 09:40:08 -02:00
pcpa
b7c8db4ba4 Add extra files implementing different jit backends.
2012-12-02 Paulo Andrade <pcpa@gnu.org>

	* 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 22:58:40 -02:00