1. 30 Oct, 2018 1 commit
  2. 20 Apr, 2018 1 commit
    • Paulo Andrade's avatar
      Build and pass all tests on 32 and 64 bit sparc · 2cea9936
      Paulo Andrade authored
      	* 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
      	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.
  3. 26 Feb, 2018 1 commit
    • Paulo Andrade's avatar
      Build and pass all test cases on Alpha Linux · ed5589ce
      Paulo Andrade authored
      	* 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
      	* 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.
  4. 22 Feb, 2018 2 commits
    • Paulo Andrade's avatar
      Always set t12 to address of called function · b64b82ca
      Paulo Andrade authored
      	* 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.
    • Paulo Andrade's avatar
      Correct logic error with jit_live in jit_retr · 2cf092ef
      Paulo Andrade authored
      	* 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.
  5. 31 Jan, 2018 2 commits
  6. 13 Sep, 2017 1 commit
    • pcpa's avatar
      Adapt for binutils 2.29 · 7259f9dc
      pcpa authored
      	* configure.ac: Add check for binutils 2.29 prototype to the
      	disassembler function.
      	* lib/jit_disasm.c: Adapt for binutils 2.29 change.
  7. 09 May, 2017 1 commit
    • pcpa's avatar
      Add a second pass to compute live register ranges · d7614993
      pcpa authored
      	* 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.
  8. 05 May, 2016 2 commits
    • pcpa's avatar
      Correct wrong live information for some code patterns · aa939b8e
      pcpa authored
      	* 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.
    • pcpa's avatar
      Correct wrong movr simplification · b00c7508
      pcpa authored
  9. 30 Nov, 2015 1 commit
    • Paulo Andrade's avatar
      Implement a correct generation of Fibonacci numbers. · 76876dd7
      Paulo Andrade authored
      	* 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.
  10. 03 Jul, 2015 1 commit
    • pcpa's avatar
      mips: Pass tests for variadic jit functions on new abi · 17e78965
      pcpa authored
      	* 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
  11. 07 Jun, 2015 1 commit
    • Paulo Andrade's avatar
      ia64: Pass all tests for variadic jit functions · c6b8fb2a
      Paulo Andrade authored
      	* 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
      	* lib/jit_ia64.c: Implement proper abi for variadic
      	jit functions.
  12. 04 Jun, 2015 1 commit
    • pcpa's avatar
      Implement new synthesized IR codes sequences · d0a5bd8d
      pcpa authored
      	* 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.
  13. 25 May, 2015 1 commit
    • pcpa's avatar
      Intermediate, fully functional, rework for variadic functions · 0b6cc01e
      pcpa authored
      	* 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.
  14. 24 May, 2015 3 commits
    • pcpa's avatar
      Bump library major. · 237c9029
      pcpa authored
      	* 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.
    • pcpa's avatar
      aarch64: Correct va_list offsets and double load. · 316dfc6e
      pcpa authored
      	* lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: Correct base
      	aarch64 varargs code.
    • pcpa's avatar
      Correct make check for systems without gcc. · 97f69a9c
      pcpa authored
      	* check/lightning.c: Clearly run check if clang is the system
  15. 20 May, 2015 2 commits
  16. 19 May, 2015 1 commit
  17. 10 May, 2015 3 commits
  18. 06 May, 2015 1 commit
    • pcpa's avatar
      mips: Add initial jit_va_ calls to mips · a5ab4c77
      pcpa authored
      	* 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.
  19. 05 May, 2015 1 commit
    • pcpa's avatar
      ppc: Add initial jit_va_ calls to ppc · cc217f06
      pcpa authored
      	* 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.
  20. 03 May, 2015 1 commit
  21. 01 May, 2015 1 commit
    • pcpa's avatar
      arm: Add initial jit_va_ calls to arm · 8cb302f3
      pcpa authored
      	* 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.
  22. 30 Apr, 2015 1 commit
  23. 28 Apr, 2015 1 commit
    • pcpa's avatar
      Add initial support to implement vararg jit functions · d6396745
      pcpa authored
      	* 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_*
      	* 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.
  24. 17 Feb, 2015 2 commits
    • pcpa's avatar
      Implement jit_allocar for dynamic stack allocation · ad589fbb
      pcpa authored
      	* include/lightning.h, include/lightning/jit_private.h,
      	lib/jit_aarch64-cpu.c, lib/jit_aarch64.c,
      	lib/jit_alpha-cpu.c, lib/jit_alpha.c,
      	lib/jit_arm-cpu.c, lib/jit_arm.c,
      	lib/jit_hppa-cpu.c, lib/jit_hppa.c,
      	lib/jit_ia64-cpu.c, lib/jit_ia64.c,
      	lib/jit_mips-cpu.c, lib/jit_mips.c,
      	lib/jit_ppc-cpu.c, lib/jit_ppc.c,
      	lib/jit_s390-cpu.c, lib/jit_s390.c,
      	lib/jit_sparc-cpu.c, lib/jit_sparc.c,
      	lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
      	jit_allocar(offs, size) interface, that receives
      	two integer registers arguments, allocates space
      	dynamically in the stack, returns the offset in
      	the first argument, and uses the second argument
      	for the size in bytes of the memory to be allocated.
      	* check/allocar.ok, check/allocar.tst: New files
      	implementing test cases for the new jit_allocar
      	* check/Makefile.am, check/lightning.c: Update for
      	the new test case and interface.
      	* doc/body.texi: Add documentation of the new
    • pcpa's avatar
      X86: No longer make st7 available as a temporary · 9f72e661
      pcpa authored
      	* include/lightning/jit_x86.h, lib/jit_x86-cpu.c,
      	lib/jit_x86-x87.c: No longer make st(7) available.
      	Need to keep one x87 slots empty to avoid exceptions.
      	This has the side effect of no longer needing the
      	hackish emms instruction before a function call.
  25. 16 Feb, 2015 2 commits
    • pcpa's avatar
      Correct inconsistency with jit_regno_patch · 2597bf3c
      pcpa authored
      	* lib/lightning.c: Remove the jit_regno_patch bitfield
      	register fields before actual emit, as it is only really
      	used before emit, otherwise, on special	conditions it
      	may consider live registers as dead during code emit.
    • pcpa's avatar
      X86: Correct load and store in the x32 abi · 3a03feae
      pcpa authored
      	* lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
      	Correct encoding of ldxr* stxr* in the x32 abi. If the
      	displacement register is negative, it would generate
      	a 64 bit instruction with a 32 bit unsigned displacement.
      	* check/ranger.tst, check/ranger.ok: New files, implementing
      	a test case for negative loads and stores. This is range.tst
      	converted to use registers instead of immediate offsets.
      	check/Makefile.am: Update for the new test case.
  26. 07 Feb, 2015 1 commit
    • pcpa's avatar
      Avoid problems if JIT_INSTR_MAX is miscalculated · fb21cf9f
      pcpa authored
      	* lib/jit_size.c: Preventively use at least 144 bytes
      	if JIT_INSTR_MAX is less than it. The logic is not
      	guaranteed to be 100% precise, it is mostly heuristics
      	to allocate a buffer with as close as possible size,
      	but a wrong value may cause code generation to write
      	past the end of the buffer.
  27. 03 Feb, 2015 2 commits
    • Paulo Andrade's avatar
      Correct the reason the simplify_stxi bug was not noticed before · f6970c62
      Paulo Andrade authored
      	* lib/lightning.c: Correct the reason the bug in
      	simplify_stxi was not triggered before, it was due to
      	incorrectly resetting the value->code field, what was
      	causing it to never properly optimize:
      		stxi Im0 Rb0 Rt0
      		ldxi Rt1 Rb1 Im1
      	when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
      	There was another possible issue, that has been also
      	addressed in this commit, that would be the case of
      	Rbn == Rtn, where no redundancy removal is possible.
    • Paulo Andrade's avatar
      Correct wrong check in simplify_stxi. · 5724068b
      Paulo Andrade authored
      	* lib/lightning.c: Correct wrong check in simplify_stxi.
      	The test was incorrectly comparing the target register
      	and the displacement offset. This was a time bomb bug,
      	that would trigger in code like:
      		stxi Im0 Rb0 Rt0
      		stxi Im1 Rb1 Rt1
      	if Rb0 == Rb1 && Rt0 == Rt1 && Im0 == Rt1, that is,
      	the wrong check was Im0 == Rt1, instead of the supposed
      	Im0 == Imm1 (that was what the code mean't to do). It
      	was removing the second stxi assuming it was redundantly
      	generated; as that is not uncommon pattern on
      	translators generating jit.
  28. 02 Feb, 2015 1 commit
    • Paulo Andrade's avatar
      Add new --enable-devel-disassembler configure option · 67828073
      Paulo Andrade authored
      	* configure.ac, include/lightning/jit_private.h,
      	lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
      	lib/jit_disasm.c, lib/jit_hppa.c, lib/jit_ia64.c,
      	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
      	lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c: Add a new
      	--enable-devel-disassembler option, that should be used
      	during development, or lightning debug. This option
      	intermixes previous jit_print and jit_disassemble
      	output, making it easier to visualize what lightning
      	call was used, and what code was generated.
  29. 31 Jan, 2015 1 commit