* 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.
* 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.
* module/language/cps2/verify.scm: New diagnostic pass.
* module/Makefile.am: Add verify.scm.
* module/language/cps2/optimize.scm: Wire up verification pass.
Always run the pass at the end, and if a variable is set run it
between passes too.
* module/language/cps2/self-references.scm: New pass, ported from CPS.
* module/language/cps2/optimize.scm: Wire up the self references pass.
* module/Makefile.am: Add new file.
* module/language/cps2/simplify.scm (compute-singly-referenced-vars):
New helper.
(compute-eta-reductions): Turns out, eta conversion on a graph
doesn't work the same way that it works on nested terms -- since
uses and defs are computed using the flow graph and not nested
terms, we need to check additionally that the vars are singly-used.
* module/language/cps/slot-allocation.scm (allocate-slots): Even if an
expression does not define a live value, it might need a place to
put its value. In that case we should stop scanning for hints,
otherwise e.g. an (current-module) primcall whose value isn't used
could clobber a hinted variable.
* libguile/vm-engine.c (RETURN_ONE_VALUE, RETURN_VALUE_LIST): These
helpers, used in subr-call and the like, might not actually have
enough space to push the return values. Use ALLOC_FRAME instead of
RESET_FRAME, for that reason.
* 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.
* module/language/cps2/cse.scm: New file, ported from CPS.
* module/language/cps2/optimize.scm: Wire up CSE.
* module/Makefile.am: Add language/cps2/cse.scm.
* module/language/cps/compile-bytecode.scm (optimize): Disable
prune-top-level-scopes on old CPS. It seems to not work if CSE has
run beforehand.
* module/language/cps2/utils.scm (compute-function-body): $callk does
not add to a local function graph.
(compute-successors): Fix extraction of "handler" continuation for
$prompt.
* module/language/cps2/utils.scm (compute-successors): New helper.
(compute-reverse-post-order): Move here from contification.scm and
rename from "sort-nodes".
(invert-graph): New helper.
(compute-strongly-connected-components): Move here from
contification.scm and rename from "compute-sccs".
* module/language/cps2/contification.scm (sort-nodes, compute-sccs): Remove.
* module/language/cps2/elide-values.scm: New file.
* module/language/cps2/optimize.scm (optimize): Wire up elide-values.
* module/Makefile.am: Add new file.
* module/language/cps2/prune-top-level-scopes.scm
(prune-top-level-scopes): Given that cache-current-module! is an
instruction, it will always continue to a nullary $kargs, so $values
is actually the correct replacement and not a values primcall.
* module/language/cps2/specialize-primcalls.scm: New file.
* module/language/cps2/optimize.scm: Wire up specialize-primcalls.
* module/Makefile.am: Add new file.
* module/Makefile.am:
* module/language/cps2/types.scm: Port to CPS2. Relative to the CPS1
module, this one uses worklists, which should result in fewer
visits, though it does use a different strategy for deciding when to
saturate. We'll see!
* 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.