1 2020-23-01 Paulo Andrade <pcpa@gnu.org>
3 * lib/lightning.c: Add a proper fix to the condition of considering
4 a register dead at entry of a block when it modifies the register
5 !after! a branch to a target where it is live.
6 The correction is just to split blocks on branches. It uses an
7 extra label per branch, but makes following the code simpler and
10 2020-22-01 Paulo Andrade <pcpa@gnu.org>
12 * lib/lightning.c: Correct a special condition of a register
13 only assigned in a block, and incorrectly marked as dead before
14 a jump where the register is live.
16 2019-10-04 Paulo Andrade <pcpa@gnu.org>
18 * check/lightning.c, include/lightning/jit_private.h,
19 include/lightning/jit_x86.h, lib/jit_x86-cpu.c, lib/jit_x86-sz.c,
20 lib/jit_x86.c: Correct issues with MinGW64 that defines _WIN32
21 and needs long long for jit_word_t.
23 2019-09-16 Paulo Andrade <pcpa@gnu.org>
25 * lib/lightning.c: Do not add registers that are never modified
26 to the set of registers to scan for live range, what might
27 consume a lot of cpu time, doing nothing.
29 2019-09-16 Marc Nieper-WiÃkirchen <marc@nieper-wisskirchen.de>
31 * include/lightning/jit_x86.h, lib/jit_x86.c: Correct x86_64
32 backend, made %r12 a callee-save register as dictated by the
35 2019-09-16 Paulo Andrade <pcpa@gnu.org>
37 * Makefile.am: Do not force CFLAGS for the get_jit_size target.
38 * check/lightning.c: Drop __ppc__ check.
39 * include/lightning.h.in: Drop __ppc__ check. Add new
40 jit_flag_vararg flag, for special case in powerpc 32 bit using
41 the SYSV abi, and need to pass an extra argument during code
43 * include/lightning/jit_ppc.c: Drop __ppc_ check. Remove the
44 ABI_ELFv2 macro, as it now directly checks for the _CALL_ELF
45 value when/if appropriate.
46 * include/lightning/jit_private.h: Drop __ppc_ check. Check for
47 _CALL_AIXDESC to define extra data to handle function
49 * lib/jit_ppc-cpu.c: Update to check for _CALL_SYSV; assume
50 !_CALL_SYSV == (_CALL_AIX || _CALL_LINUX). Significant code
51 rework for the SYSV abi.
52 * lib/jit_ppc-sz.c: Update for the SYSV abi.
53 * lib/jit_ppc.c: Update for the SYSV abi. Add matching va_list
54 type. Drop __ppc__ check.
55 * lib/jit_size.c: Drop __ppc_ check.
56 * lib/lightning.c: Drop __ppc__ check. Add proper check for
57 __powerpc__ and _CALL_AIXDESC to manage function descriptors.
58 * lib/size.c: Update to drop __pppc_ check and SYSV abi.
60 2019-08-30 Paulo Andrade <pcpa@gnu.org>
62 * lib/jit_mips-cpu.c: Use JALR to get the same effect as JR, as
63 in mips32r6 JR generates an illegal instruction. Thanks to
64 Bruno Haible for providing a patch and the information, reported at
65 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925129
68 2019-08-29 Marc Nieper-WiÃkirchen <marc@nieper-wisskirchen.de>
70 * include/lightning/jit_private.h: Move definition of offsetof
71 from the public header file here.
73 * configure.ac, include/Makefile.am, include/lightning.h,
74 include/lightning.h.in: Generate lightning.h from lightning.in.h
75 and remove the dependence on config.h from the public header file.
77 2019-06-04 Paulo Andrade <pcpa@gnu.org>
79 * include/lightning/jit_riscv.h, lib/jit_riscv-cpu.c,
80 lib/jit_riscv-fpu.c, lib/jit_riscv-sz.c, lib/jit_riscv.c:
81 Implement riscv port. Only 64 bit Linux supported. Built on
84 * check/all.tst, check/float.tst, configure.ac, include/lightning.h,
85 include/lightning/Makefile.am, include/lightning/jit_private.h,
86 lib/Makefile.am, lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
87 Minor updates for the new riscv port.
89 2019-06-04 Paulo Andrade <pcpa@gnu.org>
91 * lib/jit_alpha.c lib/jit_ia64.c lib/jit_mips.c lib/jit_sparc.c:
92 Correct assertion of _jitc->regarg after emiting an instruction.
93 jit_carry may be set, but not an argument to the current instruction.
95 2019-06-01 Paulo Andrade <pcpa@gnu.org>
97 * lib/lightning.c: Correct assertion on jit_unget_reg when the
98 argument is jit_carry, and jit_carry was not used in the
101 2019-06-01 Paulo Andrade <pcpa@gnu.org>
103 * include/lightning/jit_private.h: Remove no longer need
104 setmask field of jit_block_t and blockmask from jit_compiler_t.
106 * lib/lightning.c: Rework of register live and unknown state
107 information during jit generation. It no longer recurses nor
108 do dangerous bit unset of registers in unknown state. The
109 only pitfall known, that must be taken care now is that jmpr
110 (or jmpi to not a jit node) is treated as a function call, as
111 otherwise it would need to consider all registers live, and
112 spill/reload during all jit generation.
114 2018-12-28 Paulo Andrade <pcpa@gnu.org>
116 * lib/jit_disasm.c: Release bfd handle. Thanks for patch to
117 Marc Nieper-Wißkirchen.
119 2018-08-30 Paulo Andrade <pcpa@gnu.org>
121 * lib/jit_disasm.c: Add hints to select hppa disassembler.
123 * lib/jit_hppa-cpu.c: Correct address of vastart when all
124 argument registers were used as non vararg arguments.
126 * lib/jit_hppa-fpu.c: Disable load/store of rv,ix,rb where
127 rv is the value, ix is an register or integer offset and rb
128 is a base register. These should be better tested, as they do
129 not work on all environments (fail on qemu-hppa).
131 2018-04-20 Paulo Andrade <pcpa@gnu.org>
133 * include/lightning/jit_private.h: Add new register classes to
134 flag float registers and double only registers, required for sparc64
135 where only low 32 bit fpr registers can be used for single precision
137 Add new 128 bit jit_regset_t type for sparc64 register set.
139 * include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
140 lib/jit_sparc-sz.c, lib/jit_sparc.c: Update for 64 bits sparc.
142 * lib/lightning.c: Update for new jit_regset_t required for sparc64.
144 2018-02-26 Paulo Andrade <pcpa@gnu.org>
146 * check/lightning.c, include/lightning.h: Add the new jit_va_push
147 interface. That should be called when passing a va_list to a C
148 function. This is required because on Alpha a va_list is passed
149 by value, and lightning does not know about data types, so, cannot
150 understand it is pushing a va_list as argument.
152 * lib/jit_names.c, lib/lightning.c: Minor changes for the new
155 * check/cva_list.c: Update only test case using jit_va_push, to
156 pass a va_list to a C function.
158 doc/body.texi: Better documentation of the varargs interface.
160 * jit_alpha.c, jit_alpha-cpu.c: Update to properly push a
161 C va_list and correctly calculate varargs offset.
163 * lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_alpha-sz.c,
164 lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
165 lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_mips-sz.c, lib/jit_mips.c,
166 lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_s390-sz.c, lib/jit_s390.c,
167 lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-sz.c, lib/jit_x86.c:
168 Update for the new jit_va_push interface.
170 2018-02-22 Paulo Andrade <pcpa@gnu.org>
172 * lib/jit_alpha-cpu.c: Always set t12 to the address of the
173 current function, to properly work on all systems. Previously
174 the shortcut did only work on Tru64. For Linux and glibc the
177 2018-02-22 Paulo Andrade <pcpa@gnu.org>
179 * lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
180 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c:
181 Correct wrong logic in usage of jit_live in jit_retr. The
182 problem is that if a temporary is required during epilog,
183 the return register might be allocated, so, jit_live must always
186 2018-01-31 Paulo Andrade <pcpa@gnu.org>
188 * lib/lightning.c: Avoid deep recursions when computing live
191 2018-01-31 Paulo Andrade <pcpa@gnu.org>
193 * lib/jit_mips-cpu.c: Correct frame size and varargs
194 initialization for the n32 abi.
195 * lib/jit_mips.c, lib/jit_mips-fpu.c: Correct 32 bit abis
198 2017-09-13 Paulo Andrade <pcpa@gnu.org>
200 * configure.ac: Add check for binutils 2.29 prototype to the
201 disassembler function.
202 * lib/jit_disasm.c: Adapt for binutils 2.29 change.
204 2017-06-09 Paulo Andrade <pcpa@gnu.org>
206 * include/lightning/jit_private.h, lib/lightning.c: Add a
207 second pass from start when computing register live ranges.
208 This should be used temporarily, and is required for certain
209 loop constructs, with several consecutive blocks not referencing
212 2016-05-05 Paulo Andrade <pcpa@gnu.org>
214 * lib/lightning.c: Correct wrong movr simplification,
215 remove no longer needed code to set return registers live
216 and update live register set when reaching a label boundary,
217 but do not descend if the block has been already visited.
218 The later need some tuning for complex code generation, where
219 it will still have issues.
221 2015-11-30 Paulo Andrade <pcpa@gnu.org>
223 * doc/body.texi: Change documentation to no longer say
224 it is a variant of the Fibonacci sequence, and document
225 a proper implementation.
226 Thanks to Jon Arintok for pointing out that the Fibonacci
227 sequence generation was incorrect. It was documented, but
230 * check/fib.tst, check/fib.ok, check/bp.tst, check/bp.ok,
231 doc/ifib.c, doc/rbif.c: Implement a proper Fibonacci
232 sequence implementation.
234 2015-07-03 Paulo Andrade <pcpa@gnu.org>
236 * lib/jit_mips-cpu.c: Correct definition of htonr_ul.
237 Correct prolog/epilog/va* routines to work on o64 abi.
239 * lib/jit_mips-fpu.c: Correct load of double literal
240 argument when not using a data buffer.
241 Remove alignment correction in vaarg_d if using the
244 * lib/jit_mips.c: Correct code to allow creating variadic
245 jit functions when using the new mips abi.
247 * lib/jit_rewind.c: Minor adjust for rewind when using
248 the new mips abi, if there are varargs arguments in
251 2015-06-06 Paulo Andrade <pcpa@gnu.org>
253 * lib/jit_ia64-cpu.c: Search backward for the last output
254 register used, otherwise would stop too early if a float
255 argument used the slot.
256 Correct offset of first va_list argument, and use proper
259 * lib/jit_ia64-fpu.c: Add new functions to move a gpr
260 to a fpr register, to counterpart the ones that move a
261 fpr to a gpr. These are required to properly implement
262 jit_getarg*_{f,d} on complex prototypes, or variadic
265 * lib/jit_ia64-sz.c: Update for support to jit variadic
268 * lib/jit_ia64.c: Implement proper abi for variadic
271 2015-06-04 Paulo Andrade <pcpa@gnu.org>
273 * lib/jit_rewind.c: New file implementing generic functions
274 to "rewind", or rewrite IR code sequences.
276 * include/lightning.h: Add several new codes, that previously
277 were a function call, that would synthesize the operation.
278 Now, there is a code for the operation, and a new flag to
279 know an operation is synthesized.
281 * include/lightning/jit_private.h: Add several new macros to
282 help construct synthesized IR code sequences.
284 * lib/Makefile.am: Update for lib/jit_rewind.c.
286 * lib/jit_disasm.c: Update for a small rework on jit_node_t,
287 so that --enable-devel-disassembler does not need a change
288 in the layout of jit_node_t.
290 * lib/jit_names.c: Update for the new codes.
292 * lib/jit_print.c: Update to print more readable output, and
293 flag synthesized IR code sequences.
295 * lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
296 lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_x86-sz.c,
297 lib/jit_x86.c: Update for new synthesized IR code sequences.
299 * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu., lib/jit_ppc-sz.c,
300 lib/jit_ppc.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
301 lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_s390-fpu.c,
302 lib/jit_s390-sz.c, lib/jit_s390.c: Update for new synthesized
303 IR code sequences and correct bugs in the initial varargs
304 implementation support.
306 * lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_hppa-sz.c,
307 lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
308 lib/jit_sparc-sz.c, lib/jit_sparc.c: Add generic, untested
309 support for the new synthesized IR code sequences. Known
310 most likely broken right now, and should be corrected once
311 access to these hosts is available.
313 * lib/lightning.c: Update for new IR codes, and add support
314 for not yet existing instructions that change third argument.
316 * size.c: Change to use different tables for LE and BE PowerPC.
317 Correct a wrong endif for x32.
319 2015-05-25 Paulo Andrade <pcpa@gnu.org>
321 * check/cva_list.c: New file implementing a test to ensure
322 the value returned by jit_va_start is a valid C va_list.
324 * check/va_list.ok: New simple helper file, as now the
325 va_list.tst test is enabled.
327 * check/va_list.tst: Rewritten for an extensive variadic
330 * check/Makefile.am: Update for the new tests.
332 * lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
333 lib/jit_arm.c: Correct broken software float in a previous
334 commit. Note that the hard float abi implementation is known
335 broken at this time, for special cases involving variadic
336 functions, and should be corrected next.
338 lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c: Correct
339 the jit_va_list_t semantics to match C va_list.
341 2015-05-24 Paulo Andrade <pcpa@gnu.org>
343 * lib/Makefile.am: Bump library major. This is a preparation
344 for a rework that was due for quite some time, but that is
345 now required to properly implement variadic jit functions.
346 The rework is mainly required to know at prolog parsing, if
347 a function is variadic or not. This will benefit a few
348 backends, and is mandatory for the hard float arm abi.
349 The rework was already planned for quite some time, to
350 be able to use a variable stack framesize, and for leaf
351 functions optimization where applicable.
352 The change will be source compatible, but will change
353 some internals, and jit_code_t values, as some new will
355 The only behavior change is that, jit_arg_register_p may
356 change return value on hard float arm abi, if called before
357 or after jit_ellipsis. Common sense anyway, would say to
358 make that call after jit_ellipsis, but documentation
359 should be updated for it.
361 2015-05-24 Paulo Andrade <pcpa@gnu.org>
363 * lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: Correct base
364 aarch64 varargs code.
366 2015-05-24 Paulo Andrade <pcpa@gnu.org>
368 * check/lightning.c: Clearly run check if clang is the system
371 2015-05-20 Paulo Andrade <pcpa@gnu.org>
373 * lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c, lib/jit_sparc.c:
374 Add base support to jit vararg functions to the sparc backend.
376 2015-05-20 Paulo Andrade <pcpa@gnu.org>
378 * lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c, lib/jit_alpha.c:
379 Add base support to jit vararg functions to the alpha backend.
381 2015-05-19 Paulo Andrade <pcpa@gnu.org>
383 * lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c, lib/jit_hppa.c:
384 Add base support to jit vararg functions to the hppa backend.
386 2015-05-10 Paulo Andrade <pcpa@gnu.org>
388 * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c:
389 Add base support to jit vararg functions to the ia64 backend.
391 2015-05-10 Paulo Andrade <pcpa@gnu.org>
393 * lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
394 and movi_f_w implementation to work when not using a
395 data buffer. This causes the check varargs.tst to
396 work when passing "-d" to the lightning test tool.
398 2015-05-10 Paulo Andrade <pcpa@gnu.org>
400 * lib/jit_ia64.c: Implement inline assembly cache flush,
401 required on multiprocessor systems.
403 2015-05-06 Paulo Andrade <pcpa@gnu.org>
405 * lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c:
406 Add base support to jit vararg functions to the mips backend.
407 Currently only supported on the o32 abi, until access to a
408 n32 system is arranged.
410 2015-05-05 Paulo Andrade <pcpa@gnu.org>
412 * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c:
413 Add base support to jit vararg functions to the PowerPC backend.
415 2015-05-02 Paulo Andrade <pcpa@gnu.org>
417 * lib/jit_s390-cpu.c, lib/jit_s390-fpu.c, lib/jit_s390.c:
418 Add base support to jit vararg functions to the s390 backend.
420 2015-05-01 Paulo Andrade <pcpa@gnu.org>
422 * lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
423 lib/jit_arm.c: Add base support to jit vararg
424 functions to the arm backend.
426 2015-04-30 Paulo Andrade <pcpa@gnu.org>
428 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
429 lib/jit_aarch64.c: Add base support to jit vararg
430 functions to the aarch64 backend.
432 2015-04-27 Paulo Andrade <pcpa@gnu.org>
434 * include/lightning.h, include/lightning/jit_private.h,
435 lib/jit_names.c, lib/lightning.c: Add initial support
436 for the new jit_va_start, jit_va_arg, jit_va_arg_d, and
437 jit_va_end interfaces. The jit_va_start call is supposed
438 to return a va_list compatible pointer, but not yet
439 decided if it will be "declared" stdarg compatible,
440 as for now only x86 support has been added (and should
441 be compatible), but issues may arise on other backends.
443 * check/lightning.c: Add wrappers to call the new jit_va_*
446 * lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
449 * lib/jit_x86-sz.c: Add fields, but not yet fully updated,
450 as this is an intermediate commit.
452 * lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
453 lib/jit_alpha-sz.c, lib/jit_alpha.c,
454 lib/jit_arm-sz.c, lib/jit_arm.c,
455 lib/jit_hppa-sz.c, lib/jit_hppa.c,
456 lib/jit_ia64-sz.c, lib/jit_ia64.c,
457 lib/jit_mips-sz.c, lib/jit_mips.c,
458 lib/jit_ppc-sz.c, lib/jit_ppc.c,
459 lib/jit_s390-sz.c, lib/jit_s390.c,
460 lib/jit_sparc-sz.c, lib/jit_sparc.c: Prepare for the
461 new jit_va_* interfaces. Not yet implemented, and will
462 cause an assertion if used.
464 * check/va_list.tst: Simple early test case, that works
465 on x86_64, x32, ix86, cygwin, and cygwin64.
467 2015-02-17 Paulo Andrade <pcpa@gnu.org>
469 * include/lightning.h, include/lightning/jit_private.h,
470 lib/jit_aarch64-cpu.c, lib/jit_aarch64.c,
471 lib/jit_alpha-cpu.c, lib/jit_alpha.c,
472 lib/jit_arm-cpu.c, lib/jit_arm.c,
473 lib/jit_hppa-cpu.c, lib/jit_hppa.c,
474 lib/jit_ia64-cpu.c, lib/jit_ia64.c,
475 lib/jit_mips-cpu.c, lib/jit_mips.c,
476 lib/jit_ppc-cpu.c, lib/jit_ppc.c,
477 lib/jit_s390-cpu.c, lib/jit_s390.c,
478 lib/jit_sparc-cpu.c, lib/jit_sparc.c,
479 lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
480 jit_allocar(offs, size) interface, that receives
481 two integer registers arguments, allocates space
482 dynamically in the stack, returns the offset in
483 the first argument, and uses the second argument
484 for the size in bytes of the memory to be allocated.
486 * check/allocar.ok, check/allocar.tst: New files
487 implementing test cases for the new jit_allocar
490 * check/Makefile.am, check/lightning.c: Update for
491 the new test case and interface.
493 * doc/body.texi: Add documentation of the new
496 2015-02-17 Paulo Andrade <pcpa@gnu.org>
498 * include/lightning/jit_x86.h, lib/jit_x86-cpu.c,
499 lib/jit_x86-x87.c: No longer make st(7) available.
500 Need to keep one x87 slots empty to avoid exceptions.
501 This has the side effect of no longer needing the
502 hackish emms instruction before a function call.
504 2015-02-16 Paulo Andrade <pcpa@gnu.org>
506 * lib/lightning.c: Remove the jit_regno_patch bitfield
507 register fields before actual emit, as it is only really
508 used before emit, otherwise, on special conditions it
509 may consider live registers as dead during code emit.
511 2015-02-15 Paulo Andrade <pcpa@gnu.org>
513 * lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
514 Correct encoding of ldxr* stxr* in the x32 abi. If the
515 displacement register is negative, it would generate
516 a 64 bit instruction with a 32 bit unsigned displacement.
518 * check/ranger.tst, check/ranger.ok: New files, implementing
519 a test case for negative loads and stores. This is range.tst
520 converted to use registers instead of immediate offsets.
522 check/Makefile.am: Update for the new test case.
524 2015-02-07 Paulo Andrade <pcpa@gnu.org>
526 * lib/jit_size.c: Preventively use at least 144 bytes
527 if JIT_INSTR_MAX is less than it. The logic is not
528 guaranteed to be 100% precise, it is mostly heuristics
529 to allocate a buffer with as close as possible size,
530 but a wrong value may cause code generation to write
531 past the end of the buffer.
533 2015-02-03 Paulo Andrade <pcpa@gnu.org>
535 * lib/lightning.c: Correct the reason the bug in
536 simplify_stxi was not triggered before, it was due to
537 incorrectly resetting the value->code field, what was
538 causing it to never properly optimize:
541 when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
542 There was another possible issue, that has been also
543 addressed in this commit, that would be the case of
544 Rbn == Rtn, where no redundancy removal is possible.
546 2015-02-03 Paulo Andrade <pcpa@gnu.org>
548 * lib/lightning.c: Correct wrong check in simplify_stxi.
549 The test was incorrectly comparing the target register
550 and the displacement offset. This was a time bomb bug,
551 that would trigger in code like:
554 if Rb0 == Rb1 && Rt0 == Rt1 && Im0 == Rt1, that is,
555 the wrong check was Im0 == Rt1, instead of the supposed
556 Im0 == Imm1 (that was what the code mean't to do). It
557 was removing the second stxi assuming it was redundantly
558 generated; as that is not uncommon pattern on
559 translators generating jit.
561 2015-02-02 Paulo Andrade <pcpa@gnu.org>
563 * configure.ac, include/lightning/jit_private.h,
564 lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
565 lib/jit_disasm.c, lib/jit_hppa.c, lib/jit_ia64.c,
566 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
567 lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c: Add a new
568 --enable-devel-disassembler option, that should be used
569 during development, or lightning debug. This option
570 intermixes previous jit_print and jit_disassemble
571 output, making it easier to visualize what lightning
572 call was used, and what code was generated.
574 2015-01-31 Paulo Andrade <pcpa@gnu.org>
576 * lib/jit_arm-cpu.c, lib/jit_arm.c: Only limit to 24 bit
577 displacement non conditional jump in the same jit_state_t.
579 2015-01-19 Paulo Andrade <pcpa@gnu.org>
581 * doc/body.texi: Reorder documentation, making jit_frame
582 and jit_tramp the lightning response to the need of
583 trampolines, continuations and tail call optimizations.
584 A pseudo code example of a factorial function was added.
585 Also added a section for description of the available
588 * doc/fact.c: New file, implementing a simple example of
589 a translation of a trivial, recursive, tail call optimization
590 into lightning calls. This is the conversion to functional C
591 code of the example in doc/body.texi.
593 * doc/Makefile.am: Update for the next test case.
595 2015-01-17 Paulo Andrade <pcpa@gnu.org>
597 * include/lightning.h, lib/jit_aarch64.c,
598 lib/jit_alpha.c, lib/jit_arm-vfp.c, lib/jit_arm.c,
599 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
600 lib/jit_ppc.c, lib/jit_s390.c, lib/jit_sparc.c,
601 lib/jit_x86.c: Add the new jit_arg_register_p predicate.
602 The predicate is expected to be used to know if an
603 argument is in a register, what would need special
604 handling if code that can overwrite non callee save
605 registers is executed.
607 * check/carg.c: New test case to check consistency and
608 expected usage of jit_arg_register_p.
610 * check/Makefile.am: Update for new test case.
612 2015-01-17 Paulo Andrade <pcpa@gnu.org>
614 * include/lightning/jit_aarch64.h,
615 include/lightning/jit_alpha.h,
616 include/lightning/jit_arm.h,
617 include/lightning/jit_hppa.h,
618 include/lightning/jit_mips.h,
619 include/lightning/jit_ppc.h,
620 include/lightning/jit_s390.h,
621 include/lightning/jit_sparc.h,
622 include/lightning/jit_x86.h,
623 lib/jit_aarch64.c, lib/jit_alpha.c,
624 lib/jit_arm.c, lib/jit_hppa.c,
625 lib/jit_ia64.c, lib/jit_mips.c,
626 lib/jit_ppc.c, lib/jit_s390.c,
627 lib/jit_sparc.c, lib/jit_x86.c: Remove jit_arg_reg_p and
628 jit_arg_f_reg_p from a public header, and define it only
629 on port specific files where an integer offset is used
630 to qualify an argument identifier. Exported code expects
631 an opaque pointer (but of jit_node_t* type) to "qualify"
632 an argument identifier.
633 This patch, and the code review/simplification done during
634 it also corrected some bugs:
635 o Inconsistent jit_arg_d value of double argument after 3
636 integer arguments in arm for jit_functions; tested, C
637 functions were being properly called.
638 o Inconsistent use of getarg_{f,d} and putarg*_{f,d} on
639 s390 (32-bit) that happened to not have a proper test
640 case, as it would only happen for jit functions, and
641 tested, called C functions had proper arguments.
642 o Corrected a "last minute" correction that did not go
643 to the committed version, and would not compile on hppa,
644 due to bad _jit_putargi_d prototype definition.
646 2015-01-17 Paulo Andrade <pcpa@gnu.org>
648 * doc/body.texi: Correct wrong/outdated information for
649 hton*, pusharg* and ret*, and add missing documentation
650 for rsb*, qmul*, qdvi* and putarg*.
652 2015-01-15 Paulo Andrade <pcpa@gnu.org>
654 * configure.ac, lib/jit_disasm.c: Rewrite workaround
655 to apparent problem to initialize powerpc disassembler.
657 2015-01-15 Paulo Andrade <pcpa@gnu.org>
659 * include/lightning.h, lib/jit_aarch64.c,
660 lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
661 lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
662 lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c:
663 Implement jit_putarg*. It works as a mix of jit_getarg*
664 and jit_pusharg*, in the way that the first argument is
665 a register or immediate, and the second is a pointer
666 returned by jit_arg*. The use of the interface is to change
667 values of arguments to the current jit function.
669 * check/put.ok, check/put.tst: New test cases exercising
670 the new jit_putarg* interface.
672 * check/Makefile.am, check/lightning.c: Update for the
673 new test case and interface.
675 2015-01-08 Paulo Andrade <pcpa@gnu.org>
677 * include/lightning/jit_s390.h, lib/jit_s390-cpu.c,
678 lib/jit_s390-fpu.c, lib/jit_s390-sz.c, lib/jit_s390.c:
679 Renamed s390x* files to s390*.
681 * check/float.tst, check/lightning.c, configure.ac,
682 include/lightning.h, include/lightning/Makefile.am,
683 lib/Makefile.am, lib/jit_s390.c, lib/jit_size.c,
684 lib/lightning.c: Update for renamed files.
686 2015-01-08 Paulo Andrade <pcpa@gnu.org>
688 * include/lightning.h, include/lightning/jit_private.h,
689 include/lightning/jit_s390x.h, lib/jit_disasm.c,
690 lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
691 lib/jit_s390x.c, lib/jit_size.c, lib/lightning.c:
692 Add support for generating jit for s390 32 bit. This change
693 also removed %f15 from the list of temporaries fpr registers;
694 it was not being used, but if were, it would corrupt the
695 stack frame because the spill address would overwrite grp
698 2014-12-26 Paulo Andrade <pcpa@gnu.org>
700 * lib/jit_ppc-cpu.c, lib/jit_ppc.c: Correct some endianess issues
701 on the powerpc le backend.
703 2014-12-26 Paulo Andrade <pcpa@gnu.org>
705 * lib/jit_ppc-cpu.c: Add mcrxr instruction emulation,
706 as this instruction has been phased out, and should be
707 implemented as a kernel trap.
709 2014-12-26 Paulo Andrade <pcpa@gnu.org>
711 * lib/jit_arm.c: Better check for need to flush constants
712 before the pool being no longer reachable.
714 2014-12-25 Paulo Andrade <pcpa@gnu.org>
716 * include/lightning.h: Split jit_htonr in the new 3 interfaces
717 jit_htonr_us, jit_htonr_ui and jit_htonr_ul, the later only
718 available on 64 bit. The plain/untyped jit_htonr macro call
719 maps to the wordsize one.
720 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
721 lib/jit_alpha-cpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c,
722 lib/jit_arm-cpu.c, lib/jit_arm-sz.c, lib/jit_arm.c,
723 lib/jit_hppa-cpu.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
724 lib/jit_ia64-cpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
725 lib/jit_mips-cpu.c, lib/jit_mips-sz.c, lib/jit_mips.c,
726 lib/jit_ppc-cpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
727 lib/jit_s390x-cpu.c, lib/jit_s390x-sz.c, lib/jit_s390x.c,
728 lib/jit_sparc-cpu.c, lib/jit_sparc-sz.c, lib/jit_sparc.c,
729 lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c:
730 Update backends for the new jit_htonr*.
731 * check/lightning.c, lib/jit_names.c, lib/lightning.c:
732 Update for the new jit_htonr* interfaces.
733 * check/Makefile.am: Update for new test cases.
734 * check/hton.ok, check/hton.tst: New test cases.
736 2014-12-24 Paulo Andrade <pcpa@gnu.org>
738 * include/lightning/jit_private.h, include/lightning/jit_x86.h,
739 lib/jit_disasm.c, lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
740 lib/jit_x86-sz.c, lib/jit_x86-x87.c, lib/jit_x86.c,
741 size.c: Implement support for the x32 abi. Built and
742 tested on Gentoo default/linux/amd64/13.0/x32 profile.
744 2014-12-24 Paulo Andrade <pcpa@gnu.org>
746 * lib/jit_names.c: Add missing rsbi_f and rsbi_d strings.
748 2014-12-21 Paulo Andrade <pcpa@gnu.org>
750 * lib/jit_arm.c: Call __clear_cache for every page.
751 This should only be required for older boards or
752 toolchain setup, but has been reported to be required
753 for lightning at some point.
755 2014-12-21 Paulo Andrade <pcpa@gnu.org>
757 * lib/jit_arm.c: Correct check to guard overflow of index
758 of constants from program counter.
760 2014-11-24 Paulo Andrade <pcpa@gnu.org>
762 * lib/lightning.c: Remove an optimization to calee save
763 registers that may incorrectly remove a jit_movr under
766 2014-11-20 Paulo Andrade <pcpa@gnu.org>
768 * include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c,
769 lib/jit_ppc.c: Add initial powerpc le support.
771 2014-11-20 Paulo Andrade <pcpa@gnu.org>
773 * lib/jit_disasm.c: Change thumb or arm disassemble based on
774 jit code before disassembly.
776 * lib/jit_arm-cpu.c: Correct reversed arguments to LDRD and
777 STRD instructions, and correct checking for support of those.
779 * lib/jit_arm-swf.c: Correct wrong use of LDRD and STRD and
780 only use those if the register is even.
782 * check/check.arm.swf.sh, check/check.arm4.swf.sh: New files
783 to test LDRD and STRD, as well as the alternate code path
784 when those are not available, in the .arm4. test case.
786 * check/Makefile.am: Update for the new test cases.
788 2014-11-08 Paulo Andrade <pcpa@gnu.org>
790 * include/lightning/jit_private.h, lib/jit_aarch64.c,
791 lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
792 lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
793 lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c:
794 Implement a private jit_flush call, that flushes
795 the cache, if applicable, aligning down to the
796 previous and up to the next page boundary.
798 2014-11-08 Paulo Andrade <pcpa@gnu.org>
800 * check/ctramp.c: New file. It just repeats the test
801 of tramp.tst, but using two jit_state_t, what should
802 test possible issues with two contexts, and also validate
803 jit_tramp works on backends with function descriptions.
805 * check/Makefile.am: Update for new test case.
807 2014-11-03 Paulo Andrade <pcpa@gnu.org>
809 * include/lightning/jit_mips.h: Do not make the t9 register
810 JIT_R11 (or JIT_R7 for n32 or n64 abi) available. Previously
811 it cause problems if one expects it to not be changed in a
812 function call. For example, calling a jit function, where it
813 really does not need to be changed.
815 2014-10-26 Paulo Andrade <pcpa@gnu.org>
817 * lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
818 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
819 lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Add an
820 assertion to all code generation "drivers" to ensure
821 _jitc->regarg is empty or in an expected state, after
822 translation of a lightning instruction to native code.
823 This change was a brute force test to find out other cases
824 of a temporary not being release (like was happening with
825 _bmsi and _bmci on x86), but no other case was found,
826 after running make check, with assertions enabled, on all
829 2014-10-26 Paulo Andrade <pcpa@gnu.org>
831 * lib/jit_x86-cpu.c: Correct a register allocation leak in
834 2014-10-25 Paulo Andrade <pcpa@gnu.org>
836 * lib/jit_disasm.c: Do not cause an fatal error if init_jit
837 fails in the jit_init_debug call.
839 2014-10-24 Paulo Andrade <pcpa@gnu.org>
841 * lib/jit_ia64.c, lib/jit_ppc.c: Correct handling of function
842 descriptor when first prolog is a jit_tramp prolog. The
843 test case was using the same jit_context_t, so was not
844 triggering this condition.
846 * lib/jit_ppc-cpu.c: Properly handle jump displacements that
847 do not fit on 24 powerpc. This required changing from previous
848 "mtlr reg, blr" to "mtctr reg, bctr" to properly handle
849 the logic to "hide" function descriptors, but that would
850 also be required as the proper jit_jmpr when/if implementing
851 optimizations to leaf functions (was working with blr because
852 it is saved/reloaded in prolog/epilog).
854 2014-10-21 Paulo Andrade <pcpa@gnu.org>
856 * include/lightning.h, lib/lightning.c: Add three predicates
857 to query information about labels. jit_forward_p(label)
858 will return non zero if the label is "forward", that is
859 need a call to jit_link(label), jit_indirect_p(label)
860 that returns non zero if the label was created with the
861 jit_indirect() call, and jit_target_p(label) that will
862 return non zero if there is at least one jump patched
863 to land at that label.
865 2014-10-18 Paulo Andrade <pcpa@gnu.org>
867 * check/range.ok, check/range.tst: New test case designed
868 to catch incorrect code generation, usually due to incorrect
869 test of immediate size. The test checks a large amount of
870 encodings in "power of two" boundaries. This test exorcises
871 a significant amount of code paths that was previously not
874 * check/Makefile.am: Add range test to make check target.
876 * lib/jit_aarch64-cpu.c: Correct wrong address calculation
877 for stxi_c, stxi_s, stxi_i and stxi_l when the offset is
880 * lib/jit_mips-fpu.c: Correct wrong size test to check if
881 an immediate can be encoded in a float or double store.
883 * lib/jit_s390x-cpu.c: Correct inverted encoding to stxi_s
884 when the offset cannot be encoded, and fallbacks to an
885 alternate encoding in 2 instructions.
887 2014-10-17 Paulo Andrade <pcpa@gnu.org>
889 * check/alu_rsb.ok, check/alu_rsb.tst: New files implementing
892 * check/Makefile.am, check/lightning.c, include/lightning.h,
893 lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c, lib/jit_aarch64-sz.c,
894 lib/jit_aarch64.c, lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c,
895 lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_arm-cpu.c,
896 lib/jit_arm-swf.c, lib/jit_arm-sz.c, lib/jit_arm-vfp.c,
897 lib/jit_arm.c, lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
898 lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-cpu.c,
899 lib/jit_ia64-fpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
900 lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips-sz.c,
901 lib/jit_mips.c, lib/jit_names.c, lib/jit_ppc-cpu.c,
902 lib/jit_ppc-fpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
903 lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
904 lib/jit_s390x.c, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
905 lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-cpu.c,
906 lib/jit_x86-sse.c, lib/jit_x86-sz.c, lib/jit_x86-x87.c,
907 lib/jit_x86.c, lib/lightning.c: Implement jit_rsb*. This
908 was a missing lightning 1.x interface, that on most
909 backends is synthesized, but on a few backends (hppa and ia64),
910 it can generate better code as on those there is, or the
911 only instruction with an immediate is in "rsb" format
914 2014-10-17 Paulo Andrade <pcpa@gnu.org>
916 * lib/jit_names.c: New file with single definition of string
917 representation of lightning IR codes.
919 * size.c: Modified to append the code name in a C comment
920 after the maximum instruction size.
922 * lib/jit_print.c: Minor change to not duplicate jit_names.c
925 * lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_arm-sz.c,
926 lib/jit_hppa-sz.c, lib/jit_ia64-sz.c, lib/jit_mips-sz.c,
927 lib/jit_ppc-sz.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
928 lib/jit_x86-sz.c: Rewritten to add string representation of
929 IR codes in a C comment.
931 2014-10-14 Paulo Andrade <pcpa@gnu.org>
933 * lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
934 lib/jit_hppa-cpu.c, lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c,
935 lib/jit_sparc-cpu.c: Implement or correct the internal
936 nop(count) call that receives an argument that tells the
937 modulo bytes to align the code for the next instruction.
939 * include/lightning.h, lib/lightning.c, lib/jit_aarch64.c,
940 lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c,
941 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
942 lib/jit_x86.c: Implement the new jit_align() call that receive
943 an argument, that tells the modulo, in bytes, to align the
944 next instruction. In most backends the only value that makes
945 a difference is a value that matches sizeof(void*), as all
946 other values usually are already automatically aligned in
947 labels, but not guaranteed to be aligned at word size bytes.
949 * check/align.ok, check/align.tst: New files, implementing
950 a simple test for the new jit_align() interface.
952 * check/Makefile.am, check/lightning.c, lib/jit_aarch64-sz.c,
953 lib/jit_alpha-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
954 lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
955 lib/jit_print.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
956 lib/jit_x86-sz.c: Update for the new jit_code_align code and
957 the jit_align() interface.
959 2014-10-13 Paulo Andrade <pcpa@gnu.org>
961 * include/lightning.h, lib/jit_size.c, size.c: Use a
962 symbolic value for the last IR code.
964 2014-10-12 Paulo Andrade <pcpa@gnu.org>
966 * include/lightning.h, include/lightning/jit_private.h,
967 lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
968 lib/jit_hppa-cpu.c, lib/jit_ia64-cpu.c, lib/jit_mips-cpu.c,
969 lib/jit_ppc-cpu.c, lib/jit_s390x-cpu.c, lib/jit_sparc-cpu.c,
970 lib/jit_x86-cpu.c, lib/lightning.c: Implement the new
971 jit_frame and jit_tramp interfaces, that allow writing
972 trampoline like calls, where a single dispatcher jit buffer
973 is written, and later other jit buffers are created, with
974 the same stack frame layout as the dispatcher. This is the
975 logic that GNU Smalltalk used in lightning 1.x, and is required
976 to make a sane port for lighting 2.x.
978 * jit_ia64-cpu.c: Implement support for jit_frame and jit_tramp,
979 and also correct wrong encoding for B4 instructions, that
980 implement jmpr, as well as correct reverse logic in _jmpr,
981 that was moving the branch register to the jump register,
983 Also, if a stack frame is to be assumed, always assume it may
984 call a function with up to 8 arguments, regardless of the
987 * lib/jit_arm.c: Add a new must_align_p() interface to ensure
988 function prologs are always aligned. This condition was
989 previously always true, somewhat by accident, but with
990 jit_tramp it is not guaranteed.
992 * jit_ia64-cpu.c: lib/jit_ppc.c: Add minor special handling
993 required to implement jit_tramp, where a function descriptor
994 should not be added before a prolog, as jit_tramp means omit
997 * check/lightning.c: Update test driver for the new interfaces.
999 * check/Makefile.am, check/tramp.tst, check/tramp.ok: Add
1000 a simple test and example of the jit_frame and jit_tramp
1001 usage implementing a simple Fibonacci function using a
1002 simulation of an interpreter stack and how it would handle
1003 state in language specific variables.
1005 * doc/body.texi: Add documentation for jit_frame and
1008 2014-09-29 Paulo Andrade <pcpa@gnu.org>
1010 * lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
1011 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
1012 lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
1013 lib/jit_x86.c, lib/lightning.c: Allow jit_jmpi on a
1014 target that is not a node. This may lead to hard to
1015 debug code generation, but is a required feature for
1016 certain generators, like the ones that used lightning
1017 1.2x. Note that previously, but not really well
1018 documented, it was instructed to use:
1019 jit_movi(rn, addr); jit_jmpr(rn);
1021 jit_patch_abs(jit_jmpi(), addr);
1024 2014-09-24 Paulo Andrade <pcpa@gnu.org>
1026 * lib/jit_x86-sz.c: Generate information about instruction
1027 lengths for more precise calculation of buffer size on
1028 Windows x64. This change is specially important because
1029 the maximum instruction length is larger than other
1030 systems, what could cause an out of bounds write on
1031 special conditions without this update.
1033 2014-09-24 Paulo Andrade <pcpa@gnu.org>
1035 * check/lightning.c: Add workaround to conflicting global
1036 optind variable in cygwin binutils that have an internal
1037 getopt* implementation.
1039 * lib/jit_x86-cpu.c: Add a simple define ffsl ffs if building
1040 for 32 bit and there is no ffsl function.
1042 2014-09-24 Paulo Andrade <pcpa@gnu.org>
1044 * check/lightning.c: Add a hopefully temporary kludge to not use
1045 sprintf and sscanf returned by dlsym. This is required to pass
1048 * include/lightning/jit_private.h: Use symbolic name for first
1049 integer register argument, as this is different in sysv and
1052 * include/lightning/jit_x86.h: Add conditionals and definitions
1053 for Windows x64 (under __CYGWIN__ preprocessor conditional).
1055 * lib/jit_x86-cpu.c: Correct one instruction encoding bug, that
1056 was working by accident. Only use rax to rdx for some byte
1057 operations to work on compatibility mode (that is, to generate
1058 the proper encoding, instead of actually generating encoding
1059 for high byte registers, e.g. %bh).
1060 Add proper prolog and epilog for windows x64.
1062 * lib/jit_x86-sse.c: Correct a swapped rex prefix for float
1065 * lib/jit_x86.c: Adjust to support Windows x64 abi.
1067 * check/check.x87.nodata.sh: New file, previously used but that
1070 2014-09-07 Paulo Andrade <pcpa@gnu.org>
1072 * lib/lightning.c: Mark all registers advertised as live, as
1073 per jit_callee_save_p as live whenever reaching a jump that
1074 cannot be tracked. This is a rethink of the previous commit,
1075 and is a better approach, otherwise there would not be much
1076 sense on relying on jit_callee_save_p if it could not be
1079 * check/jmpr.tst, check/jmpr.ok: New files implementing a very
1080 simple test case, that would actually cause an assertion on
1081 code before the change to only mark as live when reaching a
1082 jump that could not tracked, the actually advertised as callee
1085 check/Makefile.am: Update for new jmpr test case.
1087 2014-09-01 Paulo Andrade <pcpa@gnu.org>
1089 * lib/lightning.c: Do not mark all registers in unknown state
1090 as live on jit_jmpr, or jit_jmpi to an absolute address. Instead,
1091 treat it as a function call, and only consider JIT_Vn registers
1094 2014-08-29 Paulo Andrade <pcpa@gnu.org>
1096 * doc/body.texi: Add a proper info menu entry for
1099 * doc/version.texi: Regenerate.
1101 2014-08-16 Paulo Andrade <pcpa@gnu.org>
1103 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
1104 lib/jit_arm-cpu.c, lib/jit_arm-vfp.c,
1105 lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
1106 lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c,
1107 lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
1108 lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c,
1109 lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c,
1110 lib/jit_s390x.c, lib/jit_sparc-cpu.c,
1111 lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
1112 lib/jit_x86-x87.c: Review generation of all branch
1113 instructions and always adds the jit_class_nospill
1114 bitfield for temporary registers that cannot be spilled
1115 because the reload would be after a conditional jump; the
1116 patch only adds an extra assertion. These conditions do
1117 not happen on documented lightning usage, but can happen
1118 if one uses the not exported jit_get_reg and jit_unget_reg
1119 calls and cause enough register starvation.
1121 2014-08-16 Paulo Andrade <pcpa@gnu.org>
1123 * lib/jit_alpha.c: Correct wrong bitmask of most argument
1124 float register arguments, that were being set as callee
1125 save instead of argument registers class.
1127 2014-08-16 Paulo Andrade <pcpa@gnu.org>
1129 * lib/jit_arm-sz.c: Regenerate table of known maximum
1130 instruction sizes for the software float fallback,
1131 that implements "virtual" float registers in the stack
1132 and operations as calls to libgcc.
1134 * size.c: Correct typo in the generated jit_arm-sz.c file.
1136 2014-08-10 Paulo Andrade <pcpa@gnu.org>
1138 * include/lightning/jit_alpha.h, lib/jit_alpha-cpu.c,
1139 lib/jit_alpha-fpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c:
1140 New files implementing a lightning Alpha port. Thanks
1141 to Trent Nelson and snakebit.net staff for providing access
1144 * check/float.tst, check/lightning.c, configure.ac,
1145 include/lightning.h, include/lightning/Makefile.am,
1146 include/lightning/jit_private.h, lib/Makefile.am,
1147 lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
1148 Minor changes to adapt for the new Alpha port.
1150 2014-08-10 Paulo Andrade <pcpa@gnu.org>
1152 * lib/lightning.c: Always mark JIT_RET and JIT_FRET as
1153 live in a function epilog. This is required because
1154 on some ports a complex sequence, allocating one or more
1155 registers, may be required to jump from a ret* to the
1156 epilog, and the lightning api does not have annotations
1157 to know if a function returns a value, or the type of
1160 2014-08-10 Paulo Andrade <pcpa@gnu.org>
1162 * lib/lightning.c: Change the correct live bitmask of
1163 return registers after a function call in jit_update.
1165 2014-08-10 Paulo Andrade <pcpa@gnu.org>
1167 * lib/lightning.c: Change assertions to have an int
1168 result and correct a bad bit mask assertion.
1170 2014-08-10 Paulo Andrade <pcpa@gnu.org>
1172 * lib/jit_aarch64.c: Correct bad setup for assertion
1173 of consistency before a patch.
1175 2014-08-10 Paulo Andrade <pcpa@gnu.org>
1177 * lib/jit_mips-cpu.c: Correct typo in the jit_bmsr
1178 implementation that was using the wrong test result
1181 2014-07-28 Paulo Andrade <pcpa@gnu.org>
1183 * lib/jit_memory.c: Do not call free on NULL pointers.
1185 * include/lightning/jit_private.h, lib/jit_note.c,
1186 lib/lightning.c: Add a wrapper to memcpy and memmove
1187 to not actually call those functions with a zero size
1188 argument, and likely also a null src or dst.
1190 2014-07-27 Paulo Andrade <pcpa@gnu.org>
1192 * include/lightning/jit_private.h, lib/jit_disasm.c,
1193 lib/lightning.c: Remove the global jit_progname variable.
1194 It was being only used in jit_init_debug, that is called
1195 from init_jit, so, just pass an argument.
1197 2014-07-27 Paulo Andrade <pcpa@gnu.org>
1199 * doc/body.texi: Add note that jit_set_memory_functions
1200 should be called before init_jit, because init_jit
1201 itself may call the memory wrappers.
1203 2014-04-22 Paulo Andrade <pcpa@gnu.org>
1205 * lib/jit_arm.c: Do not get confused with default settings
1206 if /proc is not mounted on Linux specific code path.
1208 2014-04-09 Paulo Andrade <pcpa@gnu.org>
1210 * include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
1211 include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
1212 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
1213 include/lightning/jit_private.h, include/lightning/jit_s390x.h,
1214 include/lightning/jit_sparc.h, include/lightning/jit_x86.h:
1215 Do not add jit_regset_t, JIT_RA0, and JIT_FA0 to the installed
1216 header file. These types and definitions are supposed to be
1217 only used internally.
1219 2014-04-05 Paulo Andrade <pcpa@gnu.org>
1221 * lib/jit_arm-cpu.c: Only adjust stack pointer in prolog if
1222 need stack space, that is, do not emit a nop instruction
1223 subtracting zero from the stack pointer.
1225 2014-04-04 Paulo Andrade <pcpa@gnu.org>
1227 * lib/jit_disasm.c: Correct a crash in the doc/printf example
1228 on arm due to releasing the data_info information in
1229 jit_clear_state. This is a special case for arm only, and
1230 actually, only armv5 or older uses the data_info buffer,
1231 or when forcing arm instruction set mode besides thumb
1234 2014-12-03 Paulo Andrade <pcpa@gnu.org>
1236 * doc/body.texi: Write detailed description and examples for
1237 jit_get_memory_functions, jit_set_memory_functions,
1238 jit_get_code, jit_set_code, jit_get_data and jit_set_data.
1240 2014-12-03 Paulo Andrade <pcpa@gnu.org>
1242 * include/lightning.h, include/lightning/jit_private.h,
1243 lib/lightning.c: Implement the new jit_set_data() interface,
1244 and the new jit_get_data() helper. Like jit_set_code(),
1245 jit_realize() should be called before jit_set_data().
1246 The most common usage should be jit_set_data(JIT_DISABLE_DATA
1247 | JIT_DISABLE_NOTE), to force synthesize any float/double
1248 constant in the stack and not generate any debug information.
1250 * lib/jit_note.c: Minor change to debug note generation as
1251 now it uses an alternate temporary data buffer during constants
1252 and debug generation to accommodate the possibility of the user
1253 setting an alternate data buffer.
1255 * lib/jit_hppa-fpu.c, lib/jit_s390x.c, lib/jit_s390x-cpu.c,
1256 lib/jit_s390x-fpu.c, lib/jit_sparc.c, lib/jit_sparc-fpu.c,
1257 lib/jit_x86-sse.c, lib/jit_x86-x87.c: Implement jit_set_data.
1259 * lib/jit_hppa-sz.c, lib/jit_sparc-sz.c, lib/jit_x86-sz.c,
1260 lib/jit_s390x-sz.c: Update for several instructions that now
1261 have a different maximum length due to jit_set_data.
1263 * lib/jit_mips-fpu.c: Implement jit_set_data, but missing
1264 validation on n32 and n64 abis (and/or big endian).
1266 * lib/jit_mips-sz.c: Update for changes in o32.
1268 * lib/jit_ppc-fpu.c: Implement jit_set_data, but missing
1269 validation on Darwin PPC.
1271 * lib/jit_ppc-sz.c: Update for changes in powerpc 32 and
1274 * lib/jit_ia64-fpu.c: Implement untested jit_set_data.
1276 * TODO: Add note to list ports that were not tested for the
1277 new jit_set_data() feature, due to no longer having access
1280 * check/nodata.c: New file implementing a simple test exercising
1281 several different conditions created by jit_set_data().
1283 * check/check.nodata.sh: New file implementing a wrapper
1284 over the existing *.tst files, that runs all tests without
1285 using a data buffer for constants; only meaningful (and
1286 enabled) on architectures that used to store float/double
1287 constants on a read only data buffer.
1289 * configure.ac, check/Makefile.am: Update for the new test
1292 * check/lightning.c: Implement the new "-d" option that
1293 sets an internal flag to call jit_set_data() disable
1294 constants and debug, that is, using only a pure code
1297 2014-11-03 Paulo Andrade <pcpa@gnu.org>
1299 * include/lightning.h, include/lightning/jit_private.h,
1300 lib/lightning.c: Implement the new jit_set_code() interface,
1301 that allows instructing lightning to use an alternate code
1302 buffer. The new jit_realize() function should be called
1303 before jit_set_code(), and usually call jit_get_code()
1304 to query the amount of bytes expected to be required for
1307 * lib/jit_size.c: Minor update to have less chances of
1308 miscalculating the code buffer by starting the counter
1309 with the size of the longest instruction instead of zero,
1310 as code emit fails if at any moment less than the longest
1311 instruction bytes are available.
1313 * check/setcode.c: New file implementing some basic tests
1314 of the new jit_set_code() interface.
1316 * check/Makefile.am: Update for newer test case.
1318 2014-06-03 Paulo Andrade <pcpa@gnu.org>
1320 * include/lightning.h, lib/lightning.c: Add the new
1321 jit_indirect() call, that returns a special label node,
1322 and tells lightning that the label may be the target of
1325 * doc/body.texi: Document the new jit_indirect() call, and
1326 add examples of different ways to create labels and branches.
1328 2014-23-02 Paulo Andrade <pcpa@gnu.org>
1330 * lib/jit_x86.c: Rewrite previous patch to inline save/restore
1331 because clobbering %ebx in x86 is treated as an error
1332 (jit_x86.c:239:5: error: PIC register clobbered by 'ebx' in 'asm').
1334 2014-19-02 Paulo Andrade <pcpa@gnu.org>
1336 * lib/jit_x86.c: Rewrite incorrect inline assembly that could
1337 truncate a variable in a callee save register. Now it simply
1338 tells gcc that the register is clobbered, instead of using a
1339 *32 bit* swap with a temporary variable. The problem only
1340 happens when compiling with optimization.
1342 2014-19-02 Paulo Andrade <pcpa@gnu.org>
1344 * include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
1345 include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
1346 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
1347 include/lightning/jit_s390x.h, include/lightning/jit_sparc.h,
1348 include/lightning/jit_x86.h: Change jit_regset_t to an
1349 unsigned type, to allow safe right shift.
1351 * lib/lightning.c: Rewrite jit_regset_scan1 to allow easier
1352 compiler optimization.
1354 2013-12-03 Paulo Andrade <pcpa@gnu.org>
1356 * lib/jit_x86-x87.c: Correct wrong optimization when
1357 loading the log(2) constant.
1359 2013-12-03 Paulo Andrade <pcpa@gnu.org>
1361 * lib/jit_x86-cpu.c: Use the emms instruction before
1362 calling any function. This is particularly important
1363 when using c99 complex functions as it can easily
1364 overflow the x87 stack due to the way lightning uses
1365 the x87 stack as a flat register file.
1367 2013-12-02 Paulo Andrade <pcpa@gnu.org>
1369 * lib/jit_x86-x87.c: Correct wrong code generation due
1370 to comparing the base and not the value register with
1373 2013-12-02 Paulo Andrade <pcpa@gnu.org>
1375 * lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
1376 stack offset for float/double x87 to/from sse move.
1378 2013-11-27 Paulo Andrade <pcpa@gnu.org>
1380 * configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
1381 changes that should at least allow building lightning
1384 2013-10-08 Paulo Andrade <pcpa@gnu.org>
1386 * lib/jit_ppc-cpu.c: Correct wrong shortcut for ldxi_l with
1387 a zero offset, that was calling ldr_i instead of ldr_l.
1389 2013-10-08 Paulo Andrade <pcpa@gnu.org>
1391 * include/lightning/jit_arm.h, lib/jit_arm-cpu.c: Do not use
1392 by default load/store instructions that map to ldrt/strt.
1393 There is already the long displacement version for positive
1394 offsets, and when using a (shorter) negative offset it does
1395 not map to ldrt/strt. At least on qemu strt may cause
1396 reproducible, but unexpected SIGILL.
1398 2013-10-08 Paulo Andrade <pcpa@gnu.org>
1400 * lib/jit_arm-vfp.c: Correct wrong load/store offset
1401 calculation when the displacement is constant but too
1402 large to use an instruction with an immediate offset.
1404 2013-10-07 Paulo Andrade <pcpa@gnu.org>
1406 * check/self.c: Extend tests to validate jit_callee_save_p
1407 does not cause an assertion on valid arguments, and test
1408 extra registers defined on some backends.
1410 * configure.ac: Do not ignore environment CFLAGS when
1411 checking if need to test runtime configurable options,
1412 like use x87 when sse2 is available, arm instruction set
1413 instead of thumb, etc.
1415 * include/lightning/jit_arm.h: Correct wrong jit_f macro
1418 * include/lightning/jit_ia64.h, include/lightning/jit_ppc.h:
1419 Correct wrong jit_r macro definition.
1421 * lib/jit_x86-x87.c, lib/jit_x86.c: Actually use the
1422 reserved stack space for integer to/from float conversion.
1423 The stack space was also changed to ensure it is 8 bytes
1424 aligned. Also, for Solaris x86 in 32 bit mode, an alternate
1425 truncr_d was implemented because for some reason it is
1426 failing with SIGILL if using the "fisttpl" instructions,
1427 that must be available on p6 or newer, but for the sake of
1428 making all tests pass, implement a 486 or newer sequence
1429 if "sun" is defined.
1431 2013-10-03 Paulo Andrade <pcpa@gnu.org>
1433 * include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
1434 lib/jit_mips-sz.c, lib/jit_mips.c, size: Build and
1435 pass all test cases on Irix big endian mips using
1438 2013-10-02 Paulo Andrade <pcpa@gnu.org>
1440 * include/lightning/jit_mips.h: Add proper mips abi detection.
1442 2013-09-30 Paulo Andrade <pcpa@gnu.org>
1444 * lib/jit_print.c: Do not crash if calling jit_print from
1445 gdb before actually emitting code.
1447 * lib/lightning.c: Correct misplaced check for already
1448 visited blocks on conditional branches, what was preventing
1449 proper merge live bit masks of forward blocks.
1451 2013-09-30 Paulo Andrade <pcpa@gnu.org>
1453 * lib/jit_x86-cpu.c: Correct not properly tested case of using
1454 %r12 as index register, what was causing an invalid assertion.
1455 %r12 is mapped to the "extra" JIT_R3 register, and test cases
1456 only test "standard" lightning registers.
1458 2013-09-28 Paulo Andrade <pcpa@gnu.org>
1460 * lib/jit_ia64.c: Minor change to force collecting the maximum
1461 instruction length in the --enable-devel-get-jit-size build
1462 mode. The actual generated file did not change because the
1463 sampling was large enough that it had already collected proper
1464 information in the previously slightly buggy code (not forcing
1465 a sync of the instructions that could be combined).
1467 2013-09-27 Paulo Andrade <pcpa@gnu.org>
1469 * lib/jit_arm.c: Correct build when disassembler is
1472 2013-09-25 Paulo Andrade <pcpa@gnu.org>
1474 * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
1475 off by one range checks (that were only accepting values
1476 one less than the maximum allowed) and an invalid test
1477 condition check that was forcing it to always use
1478 indirect jumps even when reachable with an immediate
1481 2013-09-24 Paulo Andrade <pcpa@gnu.org>
1483 * lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
1484 lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
1485 lib/jit_s390x-sz.c, lib/jit_size.c, lib/jit_sparc-sz.c,
1486 lib/jit_x86-sz.c: New files implementing static tables
1487 with longest known instructions length generated to match
1488 a lightning instruction. These tables should make it easier
1489 to make it very unlikely to ever miscalculate, or by too
1490 much, the size of a code buffer.
1492 * lib/jit_size.c: New file that aids to either collect
1493 jit code size information, or use the information depending
1496 * size.c: New helper file that parses input for, and create
1497 an initial jit_$arch-sz.c file, that needs some minor edit
1498 for arches with multiple configurations.
1500 * configure.ac, Makefile.am: Add the new, devel mode only
1501 --enable-devel-get-jit-size configure option, that sets
1502 compile time flags to collect jit code size information,
1503 that will be used as input for the "noinst size program".
1505 * lib/jit_aarch64.c, lib/jit_arm.c, lib/jit_disasm.c,
1506 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_memory.c,
1507 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c,
1508 lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c: Minor
1509 changes for the --enable-devel-get-jit-size build mode,
1510 as well as the "production build mode" with jit code
1513 2013-09-14 Paulo Andrade <pcpa@gnu.org>
1515 * include/lightning.h, lib/lightning.c: Add the new
1516 jit_pointer_p interface, that returns a boolean value
1517 telling if the pointer argument is inside the jit
1518 code buffer. This is useful to avoid the need to add
1519 extra labels and calls to jit_address to figure bounds
1520 of code buffer, and still keep internal data private.
1522 2013-09-13 Paulo Andrade <pcpa@gnu.org>
1524 * include/lightning.h, include/lightning/jit_private.h,
1525 lib/jit_note.c: Change the code argument of jit_get_note
1526 to a jit_pointer_t and make jit_get_note a public interface.
1527 It was intended so since start, as a way to map an offset
1528 in the code to a function name, file name and line number
1531 2013-09-11 Paulo Andrade <pcpa@gnu.org>
1533 * doc/body.texi: Correct reversed arguments in example of
1534 usage in a (possibly) multi threaded, multiple jit_state_t
1537 * include/lightning/jit_arm.h, include/lightning/jit_private.h,
1538 lib/jit_arm-cpu.c, lib/jit_arm.c: Make a previously, non
1539 documented, global state private to the related jit_state_t
1542 2013-09-10 Paulo Andrade <pcpa@gnu.org>
1544 * check/self.c, check/self.ok: New files implementing simple
1545 consistency check assertions. At first validating some macros
1546 that use values from different sources agree.
1548 * check/Makefile.am: Update for the new test case.
1550 * include/lightning.h, lib/lightning.c: Add the new
1551 jit_callee_save_p() call, that is intended to be used when
1552 writing complex code using lightning, so that one does not
1553 need to verify what backend is being used, or have access to
1554 private data, to query if a register is callee save or not;
1555 on several backends the scratch registers are actually callee
1558 * include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
1559 include/lightning/jit_hppa.h, include/lightning/jit_mips.h,
1560 include/lightning/jit_ppc.h, include/lightning/jit_sparc.h,
1561 include/lightning/jit_x86.h: Add an explicit definition for
1562 JIT_R3-JIT_Rn, JIT_V3-JIT_Vn and JIT_F6-JIT_Fn when applicable.
1563 This allows one to write code based on "#if defined(JIT_XN)"
1564 and therefore, not need to check what is the current backend
1565 or have access to private data structures. This is particularly
1566 useful when writing virtual machines with several specialized,
1569 * lib/jit_ia64.c: Properly flag the callee save general
1570 purpose registers as such, so that jit_callee_save_p() works
1573 2013-09-10 Paulo Andrade <pcpa@gnu.org>
1575 * check/lightning.c, configure.ac: Conditionally use the
1576 code written to workaround a bug in the Hercules emulator,
1577 as isnan and isinf are not available at least on HP-UX ia64.
1579 2013-09-10 Paulo Andrade <pcpa@gnu.org>
1581 * lib/jit_s390x-cpu.c: Spill/reload correct callee save
1584 2013-09-10 Paulo Andrade <pcpa@gnu.org>
1586 * lib/jit_hppa-cpu.c: Correct code to call a function stored
1587 in a register or a patched function address.
1589 2013-09-10 Paulo Andrade <pcpa@gnu.org>
1591 * lib/jit_ia64-cpu.c: Correct incorrect logic when restoring
1592 the value of the "r2" callee save register.
1594 2013-08-29 Paulo Andrade <pcpa@gnu.org>
1596 * lib/jit_arm-cpu.c, lib/jit_arm.c: Correct wrong test and update
1597 of the thumb offset information, when checking if needing to
1598 patch a jump from arm to thumb mode. The problem would happen when
1599 remapping the code buffer, and the new address being lower than
1602 2013-08-26 Paulo Andrade <pcpa@gnu.org>
1604 * configure.ac: Extend FreeBSD test to also handle NetBSD.
1606 * lib/jit_x86-cpu.c: Correct wrongly defined offset type of
1607 ldxi_ui. Problem detected when building on NetBSD.
1609 * lib/lightning.c: Adjust code to handle NetBSD mremap,
1610 where arguments do not match Linux mremap.
1612 2013-08-26 Paulo Andrade <pcpa@gnu.org>
1614 * lib/jit_ppc.c: Correct C sequence point problem miscalculating
1615 the actual function address in a function descriptor. Problem
1616 happens with gcc 4.8.1 at least.
1618 2013-08-11 Paulo Andrade <pcpa@gnu.org>
1620 * lib/jit_s390x-cpu.c: Correct code checking if immediate
1621 fits instruction, but using the negated value.
1623 2013-07-28 Paulo Andrade <pcpa@gnu.org>
1625 * include/lightning/jit_s390x.h, lib/jit_s390x-cpu.c,
1626 lib/jit_s390x-fpu.c, lib/jit_s390x.c: New files
1627 implementing the new s390x port.
1629 * configure.ac, include/lightning.h,
1630 include/lightning/Makefile.am,
1631 include/lightning/jit_private.h,
1632 lib/Makefile.am, lib/jit_disasm.c, lib/lightning.c:
1633 Minor adaptation for the new s390x backend.
1635 * check/float.tst: Update for the s390x result of
1636 truncating +Inf to integer.
1638 * check/qalu_mul.tst: Add extra test cases to better test
1639 high word of signed multiplication as the result is
1640 adjust from unsigned multiplication on s390x.
1642 2013-07-28 Paulo Andrade <pcpa@gnu.org>
1644 * check/lightning.c: Do not assume casting a double NaN or
1645 Inf to float will produce the expected float NaN or Inf.
1646 This is not true at least under s390x.
1648 2013-07-28 Paulo Andrade <pcpa@gnu.org>
1650 * check/check.arm.sh, check/check.sh, check/check.swf.sh,
1651 check/check.x87.sh: Properly check test programs output,
1652 not just rely on the test program self testing the results
1655 2013-07-28 Paulo Andrade <pcpa@gnu.org>
1657 * lib/jit_aarch64.c: Remove unused macros left from cut&paste
1660 2013-07-16 Paulo Andrade <pcpa@gnu.org>
1662 * include/lightning/jit_aarch64.h, lib/jit_aarch64-cpu.c,
1663 lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: New files
1664 implementing the new aarch64 port, as a new architecture,
1665 not as an expansion of the existing armv[4-7] port.
1667 * check/lightning.c: Add aarch64 support and a small
1668 change to recognize character constants as immediate
1671 * check/float.tst: Add aarch64 preprocessor conditionals
1672 to select proper expected value when converting [+-]Inf
1675 * include/lightning/jit_arm.h, lib/jit_arm.c: Minor changes
1676 to better match the new aarch64 files.
1678 * configure.ac, include/lightning.h,
1679 include/lightning/Makefile.am, include/lightning/jit_private.h,
1680 lib/Makefile.am, lib/lightning.c: Minor adjustments
1681 for the aarch64 port.
1683 2013-07-08 Paulo Andrade <pcpa@gnu.org>
1685 * NEWS, THANKS, configure.ac, doc/version.texi: Update for
1686 the 1.99a second alpha release.
1688 2013-06-25 Paulo Andrade <pcpa@gnu.org>
1690 * lib/jit_mips.c: Correct cut&paste error that caused wrong
1691 stack offset calculation for double arguments in stack in
1693 Correct typo in the __LITTLE_ENDIAN macro name, that came
1694 from cut&paste error in the original typo in lib/jit_ppc.c.
1696 * lib/jit_ia64.c, lib/jit_ppc.c: Correct typo in the
1697 __LITTLE_ENDIAN macro name.
1699 2013-06-22 Paulo Andrade <pcpa@gnu.org>
1701 * check/lightning.c, configure.ac, include/lightning.h,
1702 lib/lightning.c: Add tests and quirks to build/detect
1703 and/or work on Irix.
1705 * include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
1706 lib/jit_mips-fpu.c, lib/jit_mips.c: Adapt code to run
1707 in big endian mips, using the n32 abi.
1709 2013-06-18 Paulo Andrade <pcpa@gnu.org>
1711 * include/lightning.h: Minor extra preprocessor testing
1712 to "detect" byte order on x86 solaris, that now builds
1713 and pass all test cases.
1715 2013-06-18 Paulo Andrade <pcpa@gnu.org>
1717 * lib/jit_sparc-cpu.c: Correct compiler warning of value
1718 used before assignment. The usage is bogus as the api
1719 requires always patching jumps, but the random value used
1720 could cause an assertion due to invalid displacement.
1722 * lib/jit_sparc.c: Always load and store double arguments
1723 in stack as 2 float loads or stores, for safety, as unaligned
1724 access is not allowed in Sparc Solaris.
1726 2013-06-14 Paulo Andrade <pcpa@gnu.org>
1728 * configure.ac: Force -mlp64 to CFLAGS on HP-UX ia64 port.
1729 It is the only supported mode, and expects gcc as C compiler.
1731 * include/lightning.h, lib/jit_ia64-cpu.c, lib/jit_ia64.c:
1732 Correct ia64 port to work on HP-UX that runs it in big endian
1735 2013-06-10 Paulo Andrade <pcpa@gnu.org>
1737 * lib/jit_hppa.c: Sanitize the cache synchronization inline
1738 assembly code that was doing twice the work and redundantly
1739 flushing the end address every loop iteration.
1741 2013-06-09 Paulo Andrade <pcpa@gnu.org>
1743 * configure.ac, check/Makefile.am, doc/Makefile.am: Do not
1744 explicitly link to -ldl, but instead autodetect the library
1745 with dlopen, dlsym, etc.
1747 * check/lightning.c: Add workaround to apparently buggy
1748 getopt in HP-UX that sets optind to the wrong index, and
1749 use RTLD_NEXT on HP-UX instead of RTLD_DEFAULT to dlsym
1752 * include/lightning.h: Rework definitions of wordsize and
1753 byte order to detect proper values on HP-UX.
1755 * lib/lightning.c: Minor correction to use MAP_ANONYMOUS
1756 instead of MAP_ANON on HP-UX.
1758 * lib/jit_hppa.c: Float arguments must be passed on integer
1759 registers on HP-UX, not only for varargs functions.
1760 Add code to properly clear instruction cache. This was
1761 not required on Debian hppa port, but may have been working
1764 * lib/jit_hppa-cpu.c: Follow pattern of HP-UX binaries and
1765 use bve,n instead of bv,n to return from functions.
1767 * lib/jit_hppa-fpu.c: For some reason "fst? frX,rX,(rY)" did
1768 not work on the tested computer (HP-UX B.11.23 U 9000/785 HP-UX)
1769 so the code was changed, at first for __hpux only to add the
1770 base and offset register and use the instruction with an
1771 immediate (zero) offset.
1773 2013-06-07 Paulo Andrade <pcpa@gnu.org>
1775 * check/lightning.c, lib/jit_disasm.c, lib/jit_ppc-cpu.c,
1776 lib/jit_ppc-fpu.c, lib/jit_ppc.c, include/lightning.h,
1777 include/lightning/jit_ppc.h, include/lightning/jit_private.h:
1778 Adapt code to work on 32 bit AIX ppc using gcc. Most changes
1779 are basically to adapt the elf64 logic to 32 bit, as it does
1780 not use the same convention of 32 bit Darwin ppc.
1782 * check/stack.tst: Add a fake memcpy function to the test
1783 case if running under AIX, as it is not available to dlsym.
1785 * configure.ac: Check for getopt.h header, not available in
1788 2013-06-01 Paulo Andrade <pcpa@gnu.org>
1790 * include/lightning/jit_hppa.h, lib/jit_hppa-cpu.c,
1791 lib/jit_hppa-fpu.c, lib/jit_hppa.c: New files implementing
1792 the hppa port. Built on Debian Linux PA-RISC 2.0, 32 bit.
1794 * check/float.tst: Add preprocessor for hppa expected
1795 values when converting NaN and +-Inf to an integer.
1797 * check/ldst.inc: Ensure double load/store tests use an
1798 8 byte aligned address by default.
1800 * lib/lightning.c: Correct a bug found during tests in
1801 the new port, where qmul* and qdiv* were not properly
1802 setting one of the result registers as modified in the
1803 function, what would be a problem if the only "write"
1804 usage were the qmul* or qdiv*.
1806 * check/varargs.tst, check/varargs.ok: Add one extra
1807 interleaved integer/double test to validate proper code
1808 generation in the extra case.
1810 * check/lightning.c, configure.ac, include/lightning.h,
1811 include/lightning/Makefile.am,
1812 include/lightning/jit_private.h, lib/Makefile.am,
1813 lib/jit_disasm.c: Update for the hppa port.
1815 2013-04-27 Paulo Andrade <pcpa@gnu.org>
1817 * check/varargs.tst: Correct misplaced .align directive
1818 that was causing the double buffer to not be aligned at
1820 * lib/jit_ia64-cpu.c:
1821 Properly implement abi for excess arguments passed on
1823 Simplify load/store with immediate displacement argument
1825 Simplify some calls to "subi" changing to "addi" with
1826 a negative argument.
1827 Remove some #if 0'ed code, that could be useful in
1828 special conditions, but the most useful one would be
1829 to "optimize" "static" jit functions, but for the sake
1830 of simplicity, jit functions are implemented in a way
1831 that can be passed back to C code as C function pointers.
1832 Add an attribute to prototypes of several unused functions.
1833 These functions are defined for the sake of implementing all
1834 Itanium documented instructions, but a significant amount of
1835 them is not used by lightning.
1836 * lib/jit_ia64-fpu.c: Simplify load/store with zero immediate
1837 displacement and add unused attribute for functions not used
1838 by lightning, but required to provide macros implementing all
1839 Itanium documented instructions.
1840 * lib/jit_ia64.c: Update for the properly implemented abi
1841 for stack arguments.
1842 * lib/lightning.c: Mark an unused function as such.
1844 2013-04-27 Paulo Andrade <pcpa@gnu.org>
1847 Correct immediate range check of integer comparisons when
1848 inverting arguments.
1849 Correct gei_u that was not decrementing immediate when
1850 inverting arguments.
1851 Correct b?add* and b?sub* that were not properly updating
1852 the result register.
1854 2013-04-27 Paulo Andrade <pcpa@gnu.org>
1856 * lib/jit_ia64-cpu.c: Correct wrong mapping of 2 instructions
1857 in "M-, stop, M-, stop" translation, that was ignoring the
1858 last stop (implemented as a nop I- stop).
1860 * lib/jit_ia64-fpu.c: Properly implement fnorm.s and fnorm.d,
1861 as well as the proper integer to float or double conversion.
1863 2013-04-27 Paulo Andrade <pcpa@gnu.org>
1865 * lib/jit_ia64-cpu.c: Correct bogus implementation of ldr_T
1866 for signed integers, that was using ld1.s, ld2.s and ld4.s.
1867 The ".s" stands for speculative load, not sign extend.
1869 * lib/jit_ia64-fpu.c: Correct bogus implementation of ldxr_T
1870 for float and double. The third (actually, second) argument
1871 is indeed added to the base register, but the base register
1872 is modified. The actual M7 implementation was already correct,
1873 just the ldxr_f and ldxr_d implementation that was kept in
1874 a prototype state, misinterpreting what M7 does.
1876 2013-04-27 Paulo Andrade <pcpa@gnu.org>
1878 * lib/jit_ia64-cpu.c: Correct X2 pattern matching by preventing
1879 it to attempt to require a stop between the L and the X
1880 instruction; that is, check the registers and predicates
1881 before emitting the L instruction, not after.
1883 * lib/jit_ia64-fpu.c: Slightly simplify and correct
1884 divr_f and divrd_d implementation.
1886 * check/lightning.c: Add __ia64__ preprocessor define
1889 * check/alu.inc, check/clobber.tst, check/float.tst: Define
1890 several macros conditionally to __ia64__. This is required
1891 because __ia64__ jit generation can use way too many memory,
1892 due to not implementing instruction reordering to avoid
1893 as much as possible "stops", what causes way too many nops
1894 to be generated, as well as the fact that division and
1895 remainder requires function calls, and float division
1896 requires significant code to implement.
1898 2013-04-27 Paulo Andrade <pcpa@gnu.org>
1900 * include/lightning.h: Add new backend specific movr_w_d,
1901 movr_d_w and movi_d_w codes as helpers to ia64 varargs
1902 functions arguments.
1904 * lib/jit_ia64-cpu.c:
1905 Correct wrong encoding of A5 small integers.
1906 Correct define of "mux" instruction modifiers.
1907 Correct ordering of arguments and predicates of cmp_xy
1908 implementation with immediate arguments; like most other
1909 codes with an immediate, the immediate is the second, not
1912 * lib/jit_ia64-fpu.c: Actual implementation of the code
1913 to move to/from gpr to/from fpr, to implement varargs abi.
1915 * lib/jit_ia64.c: Make fpr argument registers not allocatable
1916 as temporaries, no need for the extra checks when there are
1919 * lib/jit_print.c, lib/lightning.c: Minor updates for the
1920 new movr_w_d, movr_d_w and movi_d_w codes.
1922 2013-04-26 Paulo Andrade <pcpa@gnu.org>
1924 * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct code to
1925 also insert a stop to break an instruction group if a
1926 register is written more than once in the same group.
1927 This may happen if a register is argument and result of
1928 some lightning call (not a real instruction). The most
1929 common case should be code in the pattern:
1933 where "rn" would end up holding "largenum".
1934 But the problem possibly could happen in other circumstances.
1936 2013-04-26 Paulo Andrade <pcpa@gnu.org>
1938 * include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
1939 lib/jit_ia64-fpu.c, lib/jit_ia64.c:
1940 Relocate JIT_Rn registers to the local registers, as, like
1941 float registers, div/rem and sqrt are implemented as function
1942 calls, and may overwrite non saved scratch registers.
1943 Change patch_at to receive a jit_code_t instead of a
1944 jit_node_t, so that it is easier to "inline" patches when
1945 some instruction requires complex code to implement, e.g.
1947 Correct arguments to FMA and FMA like instructions that,
1948 due to a cut&paste error were passing the wrong argument
1949 to the related F- implementation function.
1950 Rewrite ltgt to return the proper result if one (or both)
1951 of the arguments is unordered.
1953 2013-04-26 Paulo Andrade <pcpa@gnu.org>
1955 * include/lightning/jit_ia64.h, include/lightning/jit_private.h,
1956 lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c,
1957 lib/lightning.c: Rework code to detect need of a "stop" to
1958 also handle predicates, as if a predicate is written, it
1959 cannot be read in the same instruction group.
1960 Use a single jit_regset_t variable for all registers when
1961 checking need for a stop (increment value by 128 for
1963 Correct wrong "subi" implementation, as the code executed
1964 is r0=im-r1, not r0=r1-im.
1965 Use standard lightning 6 fpr registers, and rework to
1966 use callee save float registers, that may be spill/reloaded
1967 in prolog/epilog. This is required because some jit
1968 instructions implementations need to call functions; currently
1969 integer div/mod and float sqrt, what may change the value of
1970 scratch float registers.
1971 Rework point of "sync" of branches that need to return a
1972 patch'able address, because the need for a "stop" before a
1973 predicate read causes all branches to be the instruction
1974 in slot 0, as there is no template to "stop" and branch
1975 in the same instruction "bundle".
1977 2013-04-25 Paulo Andrade <pcpa@gnu.org>
1979 * include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
1980 lib/jit_ia64-fpu.c, lib/jit_ia64.c: New files implementing
1981 the basic infrastructure of an Itanium port. The code
1982 compiles and can generate jit for basic hello world like
1985 * check/lightning.c, configure.ac, include/lightning.h,
1986 include/lightning/Makefile.am, include/lightning/jit_private.h,
1987 lib/Makefile.am, lib/lightning.c: Update for the Itanium
1990 * lib/jit_mips-cpu.c, lib/jit_mips.c: Correct typo and
1991 make the jit_carry register local to the jit_state_t.
1992 This matches code reviewed in the Itanium port, that
1993 should use the same base logic to handle carry/borrow.
1995 2013-04-10 Paulo Andrade <pcpa@gnu.org>
1997 * include/lightning/jit_private.h, lib/jit_arm.c,
1998 lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c,
1999 lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
2000 lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
2001 lib/lightning.c: Change all jit_regset macros to take
2002 a pointer argument, to avoid structure copies when
2003 adding a port to an architecture with more than 64
2006 2013-04-08 Paulo Andrade <pcpa@gnu.org>
2008 * lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache
2009 aligning to the next page boundary the end argument. It may
2010 actually truncate it.
2012 2013-03-29 Paulo Andrade <pcpa@gnu.org>
2014 * include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c,
2015 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c,
2016 lib/lightning.c: Do not start over jit generation if can grow
2017 the code buffer with mremap without moving the base pointer.
2019 2013-03-29 Paulo Andrade <pcpa@gnu.org>
2021 * lib/jit_memory.c: Implement a simple memory allocation wrapper
2022 to allow overriding calls to malloc/calloc/realloc/free, as well
2023 as ensuring all memory containing pointers is zero or points to
2026 * include/lightning.h, include/lightning/jit_private.h: Definitions
2027 for the memory allocation wrapper.
2029 * lib/Makefile.am: Update for new jit_memory.c file.
2031 * lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_note.c,
2032 lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c:
2033 Use the new memory allocation wrapper code.
2035 2013-03-22 Paulo Andrade <pcpa@gnu.org>
2037 * configure.ac, include/lightning/jit_private.h, lib/lightning.c:
2038 Remove dependency on gmp. Only a simple bitmap was required, and
2039 that was not enough reason to force linking to gmp and possible
2040 complications caused by it.
2042 2013-03-10 Paulo Andrade <pcpa@gnu.org>
2044 * include/lightning.h: Add check for __powerpc__ defined
2045 in Linux, while Darwin defines __ppc__.
2047 * include/lightning/jit_ppc.h: Adjust register definitions
2048 for Darwin 32 bit and Linux 64 bit ppc usage and/or ABI.
2050 * include/lightning/jit_private.h: Add proper check for
2051 Linux __powerpc__ and an data definition for an workaround
2052 to properly handle code that starts with a jump to a "main"
2055 * lib/jit_disasm.c: Add extra disassembler initialization
2058 * lib/jit_ppc-cpu.c: Add extra macros and functions, and
2059 correct/adapt previous ones to handle powerpc64.
2061 * lib/jit_ppc-fpu.c: Adapt for 64 bit wordsize. Basically
2062 add conversion from/to int32/int64 and proper handling of
2063 load/store offsets too large for 32 bit.
2065 * lib/jit_ppc.c: Add calls to 64 bit codes and adaptation
2066 for the PowerPC 64 bit Linux ABI.
2068 * lib/jit_arm.c, lib/jit_mips.c, lib/jit_sparc, lib/jit_x86.c,
2069 lib/lightning.c: Correct off by one error when restarting jit
2070 of a function due to finding too late that needs to spill/reload
2071 some register. Problem was found by accident on a very special
2072 condition during PowerPC 64 code adaptation.
2074 2013-03-08 Paulo Andrade <pcpa@gnu.org>
2076 * check/lightning.c: Add missing ppc preprocessor definition.
2078 2013-03-06 Paulo Andrade <pcpa@gnu.org>
2080 * check/float.tst: Comment out the int to negative infinity
2081 test in mips for the moment because not all Loongson agrees
2084 * lib/jit_disasm.c: Add a test instead of an assertion
2085 when loading symbols for disassembly due to a failure with
2086 a simple binutils build in Debian mipsel64.
2088 2013-03-06 Paulo Andrade <pcpa@gnu.org>
2090 * include/lightning/jit_private.h, lib/jit_arm-cpu.c,
2091 lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips-cpu.c,
2092 lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc-cpu.c,
2093 lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
2094 lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
2095 lib/lightning.c: Add an extra structure for data storage
2096 during jit generation, and release it after generating
2097 jit, to reduce a bit memory usage, and also to make it
2098 easier to understand what data is available during
2101 2013-03-06 Paulo Andrade <pcpa@gnu.org>
2103 * lib/lightning.c: Make data and code buffer readonly.
2105 2013-02-20 Paulo Andrade <pcpa@gnu.org>
2107 * doc/body.texi: Fool proof validate the examples of what
2108 an assembly-language programmer would write and correct the
2109 wrong sparc example.
2111 2013-02-19 Paulo Andrade <pcpa@gnu.org>
2113 * doc/body.texi: Add back the SPARC code generation example.
2115 2013-02-19 Paulo Andrade <pcpa@gnu.org>
2117 * check/lightning.c: Remove state flag to work with partial
2118 sparc port, by just disassembling if there was incomplete
2121 * jit_sparc-cpu.c: Correct wrong range check for immediate
2122 integer constants (off by one bit shift).
2123 Correct macro implementing equivalent "rd %y, rd" assembly.
2124 Implement qmul* and qdiv*.
2126 * jit_sparc.c: Update for qmul* and qdiv* and remove logic
2127 to handle incomplete code generation during sparc port.
2129 2013-02-18 Paulo Andrade <pcpa@gnu.org>
2131 * check/float.tst: Add sparc to list of known NaN and +-Inf
2132 to integer conversion.
2134 * check/lightning.c: Define __sparc__ to preprocessor in
2137 * include/lightning/jit_private.h: Correct wrong definition
2138 of emit_stxi_d, that has lived for a long time, but would
2139 cause problems whenever needing to spill/reload a float
2142 * include/lightning/jit_sparc.h: Can only use %g2,%g3,%g4
2143 for scratch variables, as other "global" registers are
2144 reserved for the system, e.g. libc.
2145 Reorder float register naming to make it easier to
2146 access odd float registers, so that generating code for
2147 pusharg and getarg is easier for the IR.
2149 * lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c: Update to match
2150 new code in jit_sparc-cpu.c. It must call jit_get_reg
2151 with jit_class_nospill if using the register to move
2152 an unconditional branch address to it, as the reload
2153 will not happen (actually could happen in the delay
2156 * lib/jit_sparc-cpu.c: Correct wrong macro definition for
2158 Properly implement div* and implement rem. Div* needs
2159 to use the y register, and rem* needs to be synthesized.
2160 Correct b?sub* macro definitions.
2162 * lib/jit_sparc-fpu.c: Correct reversed float to/from double
2164 Correct wrong jit_get_reg call asking for a gpr and then
2165 using the fpr with that number.
2166 Correct wrong branch displacement computation for
2167 conditional branches.
2169 * lib/jit_sparc.c: Correct getarg_d and pushargi_d implementation.
2170 Add rem* entries to the switch converting IR to machine code.
2172 * lib/lightning.c: Correct a problem detected when adding
2173 the jit_class_nospill flag to jit_get_reg, that was caused
2174 when having a branch to an "epilog" node, what would cause
2175 the code to think all registers in unknown state were live,
2176 while in truth, all registers in unknown state in the
2177 "just after return" point are actually dead.
2179 2013-02-17 Paulo Andrade <pcpa@gnu.org>
2181 * include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c,
2182 lib/jit_sparc-fpu.c, lib/jit_sparc.c: New files implementing
2183 the basic framework of the sparc port.
2185 * configure.ac, include/lightning.h, include/lightning/Makefile.am,
2186 include/lightning/jit_private.h, lib/jit_disasm.c: Update
2187 for the sparc port framework.
2189 * lib/jit_mips.c: Correct reversed retr/reti logic.
2191 * lib/jit_ppc.c: Correct misspelled __LITTLE_ENDIAN.
2193 * lib/lightning.c: Always do byte hashing in hash_data, because
2194 the logic to "compress" strings causes large pointers to not
2195 be guaranteed aligned at 4 byte boundaries.
2196 Update for the sparc port framework.
2198 2013-02-11 Paulo Andrade <pcpa@gnu.org>
2200 * lib/jit_arm.c: Correct jit_pushargi_f in the arm hardfp abi.
2201 Most of the logic uses even numbered register numbers, so that
2202 a float and a double can be used in the same register, but
2203 the abi requires packing the float arguments, so jit_pushargi_f
2204 needs to allocate a temporary register to modify only the
2205 proper register argument (or be very smart to push two
2206 immediate arguments if applicable).
2208 2013-02-11 Paulo Andrade <pcpa@gnu.org>
2210 * include/lightning.h, lib/lightning.c: Implement the new
2211 jit_clear_state and jit_destroy_state calls. jit_clear_state
2212 releases all memory not required during jit_execution; that
2213 is, leaves only the mmap'ed data and code buffers allocated.
2214 jit_destroy_state releases the mmap'ed buffers as well as
2215 the jit_state_t object itself, that holds pointers to the
2216 code and data buffers, as well as annotation pointers (for
2217 disassembly or backtrace) in the data buffer.
2219 * lib/jit_note.c: Correct invalid vector offset access.
2221 * check/ccall.c, check/lightning.c, doc/ifib.c, doc/incr.c,
2222 doc/printf.c, doc/rfib.c, doc/rpn.c: Use the new jit_clear_state
2223 and jit_destroy_state calls, to demonstrate the new code to
2224 release all jit memory.
2226 * doc/body.texi: Add basic documentation and usage description
2227 of jit_clear_state and jit_destroy_state.
2229 2013-02-11 Paulo Andrade <pcpa@gnu.org>
2231 * include/lightning/jit_private.h, lib/jit_note.c, lib/lightning.c:
2232 Store all annotation information in the mmap'ed area reserved for
2233 read only data. This adds code to not allocate memory for jit_note_t
2234 objects, and to relocate jit_line_t objects and its contents after
2235 calculating annotation information. The jit_line_t objects are
2236 relocated because it is not possible to always calculate before
2237 hand data layout because note information may be extended or
2238 redundant entries removed, as well as allowed to be added in
2239 non sequential order.
2240 A bug was also corrected in _jit_set_note, that was causing it
2241 to allocate new jit_line_t objects when not needed. It was still
2242 working correctly, but allocating way more memory than required.
2244 2013-02-05 Paulo Andrade <pcpa@gnu.org>
2246 *include/lightning.h, lib/lightning.c: Add the new jit_live code
2247 to explicitly mark a register as live. It is required to avoid
2248 assuming functions always return a value in the gpr and fpr return
2249 register, and to avoid the need of some very specialized codes
2250 that vary too much from backend to backend, to instruct the
2251 optimization code the return register is live.
2253 * lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
2254 lib/jit_x86.c: Update for the new jit_live code.
2256 * check/ret.ok, check/ret.tst: New files implementing a simple
2257 test case that would previously fail at least in ix86/x86_64.
2259 * check/Makefile.am: Update for new "ret" test case.
2261 2013-02-05 Paulo Andrade <pcpa@gnu.org>
2263 * lib/jit_ppc-cpu.c, lib/jit_ppc.c: Validate and correct
2264 problems in the qmul and qdiv ppc implementation.
2266 2013-02-04 Paulo Andrade <pcpa@gnu.org>
2268 * include/lightning.h, include/lightning/jit_private.h,
2269 lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_mips-cpu.c,
2270 lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c,
2271 lib/jit_x86-cpu.c, lib/jit_x86.c, lib/lightning.c:
2272 Implement the new qmul and qdiv instructions that return signed
2273 and unsigned lo/hi multiplication result and div/rem division result.
2274 These should be useful for jit translation of code that needs to
2275 know if a multiplication overflows (no branch opcode added) or if
2276 a division is exact (easy check if remainder is zero).
2278 * check/lightning.c, lib/jit_print.c, check/Makefile.am,
2279 check/all.tst: Update for the new qmul and qdiv instructions.
2281 * check/qalu.inc, check/qalu_div.ok, check/qalu_div.tst,
2282 check/qalu_mul.ok, check/qalu_mul.tst: New files implementing
2283 simple test cases for qmul and qdiv.
2285 2013-01-30 Paulo Andrade <pcpa@gnu.org>
2287 * doc/body.texi: Correct "jmpi" description that incorrectly
2288 told it was possible to pass any address as jump target. The
2289 only way to do that is "movi+jmpr".
2291 2013-01-30 Paulo Andrade <pcpa@gnu.org>
2293 * lib/jit_x86-cpu.c: Correct undefined behavior code.
2294 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56143
2296 2013-01-29 Paulo Andrade <pcpa@gnu.org>
2298 * configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER
2299 to have HAVE_CONFIG_H defined with latest aclocal.
2301 * include/lightning/jit_private.h, lib/lightning.c: Add new
2302 abstraction to use an heuristic to calculate amount of space
2303 required for jit generation, and code to reallocate buffer if
2304 did miscalculate it.
2306 * lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c:
2307 Update to use new code to estimate and resize of required buffer
2310 * lib/jit_x86-cpu.c: Minor cosmetic change to avoid adding a
2311 non required rex prefix when calling a function pointer stored
2314 2013-01-24 Paulo Andrade <pcpa@gnu.org>
2316 * check/Makefile.am: "make debug" target should pass only
2317 the main test tool program as argument for running gdb
2319 * configure.ac: Add the --enable-assertions options.
2321 * doc/Makefile.am, doc/body.texi, doc/lightning.texi:
2322 Major rewrite of the documentation to match the current
2325 * doc/version.texi: Automatic date update.
2327 * doc/ifib.c, doc/incr.c, doc/printf.c, doc/rfib.c, doc/rpn.c:
2328 Implementation of the documentation examples, that are also
2329 compiled during a normal build.
2331 * doc/p-lightning.texi, doc/porting.texi, doc/toc.texi,
2332 doc/u-lightning.texi, doc/using.texi: These files were
2333 renamed in the documentation rewrite, as the documentation
2334 was significantly trimmed due to full removal of the porting
2335 chapters. Better porting documentation should be added but
2336 for the moment it was just removed the documentation not
2337 matching the implementation.
2339 2013-01-18 Paulo Andrade <pcpa@gnu.org>
2341 * lib/jit_note.c: Correct bounds check and wrong code keeping
2342 a pointer that could be changed after a realloc call.
2344 2013-01-18 Paulo Andrade <pcpa@gnu.org>
2346 * check/3to2.tst, check/add.tst, check/allocai.tst, check/bp.tst,
2347 check/call.tst, check/ccall.c, check/clobber.tst, check/divi.tst,
2348 check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst,
2349 check/ldstxi-c.tst, check/ldstxi.tst, check/ldstxr-c.tst,
2350 check/ldstxr.tst, check/lightning.c, check/rpn.tst, check/stack.tst,
2351 check/varargs.tst, include/lightning.h,
2352 include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_disasm.c,
2353 lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc.c, lib/jit_print.c,
2354 lib/jit_x86.c, lib/lightning.c: Extend the "jit_note" abstraction
2355 with the new "jit_name" call, that receives a string argument, and
2356 should usually be called to mark boundaries of functions of code
2357 generating jit (that is, it is not expected that the language
2358 generating jit map its functions to jit functions).
2360 2013-01-17 Paulo Andrade <pcpa@gnu.org>
2362 * check/add.tst, check/allocai.tst, check/bp.tst, check/divi.tst,
2363 check/fib.tst, check/lightning.c, include/lightning/jit_arm.h,
2364 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
2365 include/lightning/jit_private.h, include/lightning/jit_x86.h:
2366 Make JIT_RET, JIT_FRET and JIT_SP private. These should not be
2367 used in any operations due to frequently having special
2368 constraints (usually JIT_FRET). JIT_FP must be made available
2369 because it must be used as the base register to access stack
2370 space allocated with jit_allocai.
2372 2013-01-14 Paulo Andrade <pcpa@gnu.org>
2374 * include/lightning.h, lib/lightning.c: Add an extra align
2375 argument to the jit_data call (that should be made private),
2376 so that it should not align strings at 8 bytes.
2377 Correct the jit_note call to include the null ending byte
2378 when adding label/note names to the "jit data section".
2380 2013-01-11 Paulo Andrade <pcpa@gnu.org>
2382 * lib/jit_note.c: New file implementing a simple string+integer
2383 annotation, that should be used to map filename and line number
2384 to offsets in the generated jit.
2386 * include/lightning.h, lib/lightning.c: Update for the new
2388 Add an extra mandatory argument to init_jit, that is used
2389 as argument to bfd_openr.
2390 Change from generic void* to char* the argument to jit_note
2391 and add an extra integer argument, to map to filename and
2394 * check/ccall.c, check/lightning.c, include/lightning/jit_private.h,
2395 lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_ppc.c,
2396 lib/jit_print.c, lib/jit_x86.c: lib/Makefile.am: Update for the
2397 new annotation code.
2399 * configure.ac, check/Makefile.am: Update to work with latest
2402 2013-01-09 Paulo Andrade <pcpa@gnu.org>
2404 * include/lightning.h, lib/jit_arm.c, jit_mips-fpu.c,
2405 lib/jit_mips.c, lib/jit_print.c, lib/jit_x86.c, lib/lightning.c:
2406 Remove the jit_code_getarg_{f,d} and jit_code_pusharg{i,r}_{f,d}
2407 calls, replacing them with the new, internal only, jit_movr_w_f,
2408 jit_mov{r,i}_f_w, jit_movr_ww_d, and jit_mov{i,r}_d_ww, that
2409 better describe the operation being done, and allow removing
2410 the hackish code to detect special conditions for arm when
2411 moving from/to vfp from/to a grp register pair.
2412 Rename jit_code_retval_{f,d} to jit_code_x86_retval_{f,d} as
2413 it is specific to 32 bit x86, and used to move abi return
2414 value in x87 register to a sse register.
2416 2013-01-05 Paulo Andrade <pcpa@gnu.org>
2418 * check/cccall.c, check/ccall.ok: New test case to validate
2419 interleaved calls from/to C code and jit.
2421 * check/Makefile.am: Update for the new ccall test case.
2423 * include/lightning.h, lib/lightning.c: Add the new jit_address
2424 call that returns the real/final address of a "note" in the
2425 generated jit. It requires a jit_node_t as returned by the
2426 jit_note call, and is only valid after calling jit_emit.
2427 Add an intermediate solution to properly handle arm
2428 soft and softfp modes that move a double to an integer register
2429 pair. Currently it just adds extra tests for the condition,
2430 but the proper solution should be to have extra lightning
2431 codes for these conditions, codes which should be only used
2432 by the backends that need it, and merged with the existing
2435 * include/lightning/jit_private.h: Add new jit_state_t flag
2436 to know it finished jit_emit, so that calls to jit_address
2439 * lib/jit_mips.c: Correct abi implementation so that the
2440 new ccall test case pass. Major problem was using
2441 _jit->function.self.arg{i,f} as boolean values, but that
2442 would cause lightning.c:patch_registers() to incorrectly
2443 assume only one register was used as argument when calling
2444 jit_regarg_p(); _jit->function.self.arg{i,f} must be the
2445 number of registers used as arguments (in all backends).
2447 * lib/jit_x86.c: Add workaround, by marking %rax as used,
2448 to a special condition, when running out of registers and the
2449 allocator trying to spill and reload %rax, but %rax was used
2450 as a pointer to a function, what would cause the reload to
2451 destroy the return value. This condition can be better
2452 generalized, but the current solution is good enough.
2454 * include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c, lib/jit_ppc.c:
2455 Rewrite logic to handle arguments, as the original code was
2456 written based on a SysV pdf about the generic powerpc ABI,
2457 what did "invent" a new abi for the previous test cases, but
2458 failed in the new ccall test in Darwin PPC. Now it properly
2459 handles 13 float registers for arguments, as well as proper
2460 computation of stack offsets when running out of registers
2463 2013-01-02 Paulo Andrade <pcpa@gnu.org>
2465 * check/float.tst: Correct test case to match ppc also
2466 converting positive infinity to 0x7fffffff.
2468 * lib/jit_arm-swf.c: Correct typos with double underscores.
2470 * lib/lightning.c: Correct remaining wrong reverse jump logic.
2472 2012-12-29 Paulo Andrade <pcpa@gnu.org>
2474 * lib/lightning.c: Correct both, wrong and confusing logic
2475 to compute the reverse of a jump. Now it properly matches
2476 C semantics for "eq" (==) and "ne" (!=) and correct computation
2477 of reverse of "uneq" as "gt".
2479 * check/branch.tst: Update "ne" float branch check that
2480 previously happened to be wrongly tested with a NaN argument.
2482 2012-12-29 Paulo Andrade <pcpa@gnu.org>
2484 * check/float.ok, check/float.tst: New test cases implementing
2485 extensive validation of float comparison and branch code
2486 generation as well as integer conversion, involving NaN and
2489 * lib/jit_arm-swf.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
2490 Correct bugs found by new float test case.
2492 * lib/jit_x86.c: Correct cut&paste error added in commit to
2493 convert jit_arg* return value to a jit_node_t*, that would
2494 cause it to not properly handle double arguments in ix86.
2496 * check/Makefile.am: Update for the new test case.
2498 2012-12-28 Paulo Andrade <pcpa@gnu.org>
2500 * check/lightning.c, include/lightning.h, lib/jit_arm.c,
2501 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c, lib/jit_x86.c,
2502 lib/lightning.c: Change return value of jit_arg{,_f,_d} to
2503 a jit_node_t* object, that should be used as argument to
2504 jit_getarg_{c,uc,s,us,i,ui,l,f,d}. This just requires changing
2505 from jit_int32_t to jit_pointer_t (or jit_node_t*) the "handle"
2506 for the getarg calls, with the benefit that it makes it easy
2507 to implement patching of the stack address of non register
2508 arguments, this way allowing to implement variable size stack
2509 frames if applicable; useful if there are too many registers and
2510 jit functions uses only a few callee save registers.
2512 2012-12-27 Paulo Andrade <pcpa@gnu.org>
2514 * lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
2515 regressions when patching jit_calli for a forward function.
2517 * lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
2518 in jit_getarg_u{c,s} implementation.
2520 2012-12-23 Paulo Andrade <pcpa@gnu.org>
2522 * check/call.ok, check/call.tst: New test cases to validate
2523 simple typed argument and return values in function calls.
2525 * check/lightning.c: Properly handle jit_movi of labels for
2526 backward and forward code labels.
2528 * check/Makefile.am: Update for new test case.
2530 2012-12-23 Paulo Andrade <pcpa@gnu.org>
2532 * check/carry.ok, check/carry.tst: New test case to validate
2533 carry condition handling.
2535 * check/Makefile.am: Update for new test case.
2537 2012-12-22 Paulo Andrade <pcpa@gnu.org>
2539 * lib/jit_ppc-cpu.c, lib/jit_ppc.c: Implement logic for
2540 jit_htonr for big endian, so that ppc (big endian) pass the
2541 new clobber.tst test case.
2543 2012-12-22 Paulo Andrade <pcpa@gnu.org>
2545 * lib/jit_arm.c: Correct use of wrong argument offset
2546 variable in armv7l or float/double argument for varargs
2547 function in armv7hl.
2548 Correct jit_getarg* logic in software float mode to
2549 match expected behavior in other backends, that is, if
2550 a function is not called, it is safe to use a few lightning
2551 calls before a next jit_getarg* call, as done in the test
2552 case check/stack.tst. The proper solution should be to
2553 extend the parser in lib/lightning.c to check if there is
2554 some float operation that will call some (libgcc?) function,
2555 but software float arm should be a very uncommon backend for
2556 lightning, so, just load the already in place arguments
2557 saved to stack, assuming the register argument was clobbered
2558 (what should not be the case most times...).
2560 2012-12-22 Paulo Andrade <pcpa@gnu.org>
2562 * check/clobber.ok, check/clobber.tst: New test case doing
2563 extensive validation tests to ensure registers not used in
2564 a operation are not clobbered.
2566 * check/Makefile.am: Update for new test case.
2568 2012-12-21 Paulo Andrade <pcpa@gnu.org>
2570 * lib/lightning.c: Partially rewrite/revert code to compute
2571 initial register live state at the start of a basic block.
2572 The original logic was corrupted when adding optimizations
2573 to do as few computations as possible in jit_update. The
2574 reglive field must be always a known set of live registers
2575 at the start of a basic block. The value that was incorrect
2576 was the regmask field, that must be the set of registers
2577 that are in unknown state, because they are not known live,
2578 neither set (or possibly not set) in the basic block, and
2579 *must* store the state at the start of the basic block.
2581 2012-12-20 Paulo Andrade <pcpa@gnu.org>
2583 * include/lightning/jit_ppc.h: Correct mismatch of JIT_F{1,5}
2584 with enum codes, that were correct, and returned by jit_f().
2586 * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: Properly
2587 implement and better describe values when generating stack
2590 2012-12-18 Paulo Andrade <pcpa@gnu.org>
2592 * check/stack.ok, check/stack.tst: New files to test data
2593 integrity on a deep chain of stack frames.
2595 * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
2596 lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
2597 lib/jit_x86.c, lib/jit_x86-cpu.c: Calculate _jit->function->stack
2598 in the emit stage, otherwise it will calculate it wrong if
2599 need to jit_allocai space to spill registers.
2601 * lib/lightning.c: Correct wrong offset when updating the
2602 "current" jit function pointer in the code that may need to
2603 allocate stack space to spill registers.
2605 * check/lightning.c: Correct off by one data space check.
2607 * check/Makefile.am: Update for new test case.
2609 2012-12-17 Paulo Andrade <pcpa@gnu.org>
2611 * check/fop_abs.ok, check/fop_abs.tst, check/fop_sqrt.ok,
2612 check/fop_sqrt.tst: New files implementing simple test cases
2613 for the extra float operations.
2615 * check/Makefile.am: Update for new test cases.
2617 * check/alu.inc: Add an extra macro to check for unordered
2618 equality on tests where it is expected to use NaN as an
2621 * check/lightning.c: Minor change for proper/common argument
2622 syntax handling ommiting arguments to options.
2624 2012-12-17 Paulo Andrade <pcpa@gnu.org>
2626 * check/Makefile.am: Automatically generate pattern list
2627 of tests with alternate jit generation options. This should
2628 prevent typos and needing to change multiple places after
2631 2012-12-14 Paulo Andrade <pcpa@gnu.org>
2633 * check/lightning.c: Remove the ".cpu name value" syntax,
2634 as it was not able to do proper changes before the jit
2635 internal data structure was initialized. Now it supports
2636 several getopt options to force using different jit
2637 generation options, effectively replacing the previous
2640 * check/run-test: Add simple extra logic to handle differently
2641 named test scripts, used to test things like x87 coprocessor
2642 in ix86, and arm instruction set or software float in armv7l.
2644 * configure.ac: Add some AC_RUN_IFELSE calls to figure at
2645 compile time if can test different code generation options,
2646 and update Makefile generation accordingly.
2648 * check/Makefile.am, lib/jit_arm.c, lib/jit_x86.c: Update to
2649 properly work with the test tool updating the jit_cpu global
2652 * check/check.arm.sh, check/check.swf.sh, check/check.x87.sh:
2653 New wrapper files passing -mthumb=0, mvfp=0 and -mx87=1 to
2654 the test tool, if applicable, so that it can validate alternate
2655 code generation options on test hosts that support them.
2657 2012-12-14 Paulo Andrade <pcpa@gnu.org>
2659 * lib/jit_x86-x87.c, lib/jit_x86.c: Correct test cases in ix86
2660 when using the x87 coprocessor instead of sse2+.
2662 2012-12-14 Paulo Andrade <pcpa@gnu.org>
2664 * include/lightning.h, include/lightning/jit_private.h,
2665 lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c,
2666 lib/lightning.c: Make jit_ellipsis implementation not
2667 backend specific. It is not intended to handle va_list
2668 like objects at runtime, as jit_arg* and jit_getarg*
2669 return constant values resolved at parse time, so, effectively
2670 it is not possible to create printf like jit functions, as
2671 there is no va_start, va_arg, va_end, etc, abstraction. This
2672 limitation should be kept for the sake of making new ports
2675 2012-12-14 Paulo Andrade <pcpa@gnu.org>
2677 * include/lightning.h, lib/lightning.c: Add two extra wrapper
2678 functions to avoid need for excess pointer to/from word casts.
2680 * check/lightning.c: Only need for pointer to/from word cast
2681 now is jit_movi, update accordingly.
2683 2012-12-13 Paulo Andrade <pcpa@gnu.org>
2685 * check/varargs.ok, check/varargs.tst: New test cases implementing
2686 simple varargs calls with a large amount of arguments to exercise
2687 excess arguments on stack.
2689 * include/lightning.h: Include config.h if HAVE_CONFIG_H is
2692 * lib/jit_arm.c: Allocate a fpr register, not a gpr one for
2693 temporary when pushing varargs arguments in the stack.
2695 * lib/jit_arm-swf.c: Correct code changing the wrong offset
2696 in jit_absr_d and jit_negr_d in software float.
2698 * lib/jit_mips.c: Correct calculation of offsets of arguments
2701 * lib/jit_ppc.c: Correct bogus logic for "next" offset of arguments
2702 on stack and adjust for fixed offset of stack arguments.
2704 2012-12-12 Paulo Andrade <pcpa@gnu.org>
2706 * include/lightning.h, lib/jit_arm.c, lib/jit_mips.c,
2707 lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Change jit_prepare
2708 to no longer receive an argument. If receiving an argument, it
2709 should be an ABI specifier, not a boolean if varargs or not,
2710 and add the new jit_ellipsis call, to specify where the
2711 ellipsis is in the C prototype of the function being called.
2712 Note that currently it is not supported to define varargs
2713 functions and it will be ignored if calling jit_ellipsis not
2714 in a prepare/finish* block, but this should be addressed.
2716 * check/allocai.tst, check/alu_add.tst, check/alu_and.tst,
2717 check/alu_com.tst, check/alu_div.tst, check/alu_lsh.tst,
2718 check/alu_mul.tst, check/alu_neg.tst, check/alu_or.tst,
2719 check/alu_rem.tst, check/alu_rsh.tst, check/alu_sub.tst,
2720 check/alu_xor.tst, check/alux_add.tst, check/alux_sub.tst,
2721 check/bp.tst, check/branch.tst, check/cvt.tst, check/divi.tst,
2722 check/fib.tst, check/ldsti.tst, check/ldstr-c.tst,
2723 check/ldstr.tst, check/ldstxi-c.tst, check/ldstxi.tst,
2724 check/ldstxr-c.tst, check/ldstxr.tst, check/rpn.tst,
2725 check/lightning.c: Update for the change to jit_prepare and
2726 addition of jit_ellipsis.
2728 2012-12-11 Paulo Andrade <pcpa@gnu.org>
2730 * lib/jit_ppc-cpu.c: Make movr a function that checks arguments
2731 so that other code can safely assume it is a noop if src and dst
2732 are the same register.
2733 Implement rem{r,i}{,_u} as a div{,u}/mul/sub.
2734 Correct ANDIS, ORIS and XORIS calls to cast the argument to
2735 unsigned before the shift to avoid an assertion if the argument
2736 had the topmost bit set.
2737 Implement lshi, rshi and rshi_u as functions to test for a
2738 zero argument, that would otherwise trigger an assertion when
2739 computing the shift value.
2740 Do a simple implementation of bm{s,c}{r,i} with a temporary,
2741 "andr" of arguments and jump based on comparison with zero.
2742 Correct typo in ldxi_c.
2744 * lib/jit_ppc-fpu.c: Correct wrong arguments to FDIV* and STF*.
2746 * lib/jit_ppc.c: Correct wrong check for 6 instead of 8 integer
2747 arguments in registers. If calling a varargs function and
2748 passing a float or double argument, also either store the
2749 value in the stack or in integer registers, as varargs functions
2750 do not fetch it from float registers.
2751 Add "case" for new functions and incorrectly missing ones.
2752 Call libgcc's __clear_cache, that should know what to do
2753 if the hardware needs flushing cache before execution.
2755 * lib/lightning.c: Do a simple/trivial logic in jit_regset_scan1,
2756 that should make it easier for the compiler to optimize it, and
2757 that also corrects the previously wrong code for big endian, and
2758 that was causing problems in ppc due to not saving all callee save
2759 registers as it was not "finding" them in the regset due to the
2760 little endian assumption bug.
2762 2012-12-11 Paulo Andrade <pcpa@gnu.org>
2764 * configure.ac: Only default to using the builtin disassembler
2765 if on GNU/Linux. This should be temporary, due to requiring
2767 Correctly check $target_cpu for powerpc.
2769 * include/lightning/jit_ppc.h: Correctly implement jit_v_num.
2771 * include/lightning/jit_private.h: Declare proper prototype
2772 for jit_init_debug and jit_finish_debug.
2774 * lib/jit_ppc-cpu.c: Remove code to save/restore callee save
2775 float registers, as it is not required since those float
2776 registers are not usable currently.
2777 Change prolog and epilog generation to, at least comparing
2778 code, match what gcc generates in "gcc -O0", but it is still
2779 failing in Darwin PPC, apparently due to the __clear_cache
2780 call not being enough, as frequently it will also fail to
2781 execute, and the code buffer is all zeroes.
2783 * lib/lightning.c: Do not fail in jit_regset_scan1 calls due
2784 to passing 64 as argument on computers with 64 registers.
2786 2012-12-10 Paulo Andrade <pcpa@gnu.org>
2788 * lib/jit_mips-cpu.c: Correct all current test cases.
2789 Call the "xori" not the "XORI" macro for jit_xori implementation,
2790 as the XORI macro handles only 16 bit unsigned values.
2791 Call the "movr" macro, not the "movi" macro in the special
2792 case of adding or subtracting zero.
2793 Use the proper temporary register in the jit_andr implementation.
2795 2012-12-09 Paulo Andrade <pcpa@gnu.org>
2797 * check/alu.inc, check/alu_add.ok, check/alu_add.tst,
2798 check/alu_and.ok, check/alu_and.tst, check/alu_com.ok,
2799 check/alu_com.tst, check/alu_div.ok, check/alu_div.tst,
2800 check/alu_lsh.ok, check/alu_lsh.tst, check/alu_mul.ok,
2801 check/alu_mul.tst, check/alu_neg.ok, check/alu_neg.tst,
2802 check/alu_or.ok, check/alu_or.tst, check/alu_rem.ok,
2803 check/alu_rem.tst, check/alu_rsh.ok, check/alu_rsh.tst,
2804 check/alu_sub.ok, check/alu_sub.tst, check/alu_xor.ok,
2805 check/alu_xor.tst, check/alux_add.ok, check/alux_add.tst,
2806 check/alux_sub.ok, check/alux_sub.tst, check/branch.ok,
2807 check/branch.tst: New test cases for arithmetic and branch
2810 * check/Makefile.am: Update for new test cases.
2812 * include/lightning/jit_private.h: Make the jit_reg_free_p
2813 macro shared by all backends. Previously was added for the
2814 arm backend, but is useful in the x86_64 backend when checking
2815 state of "special purpose register".
2816 Also add the new jit_class_named register class, that must be
2817 or'ed with the register value if calling jit_get_reg expecting
2818 an specific value, because the specific register value may be
2819 zero, that previously was treated as no register requested.
2821 * lib/jit_arm-cpu.c: Correct argument order for T2_MVN.
2823 * lib/jit_arm-swf.c: Call the proper function for double
2824 divide. The "software float" implementation just calls
2827 * lib/jit_arm.c: Return float/double values in the float
2828 register if using the hard float ABI.
2830 * lib/jit_x86-cpu.c: Change the can_sign_extend_int_p macro
2831 to not include -0x80000000L, because there is code that
2832 "abuses" it and thinks it can negate the immediate value
2833 after calling that macro.
2834 Correct implementation of jit_subi that had a wrong code
2835 patch logic doing subtraction with reversed arguments.
2836 Correct REX prefix calculation in the jit_muli implementation.
2837 Correct logic to get/unget %*ax and %*dx registers in divremr
2839 Correct divremi that was using the symbolic, unique %*ax
2840 value in on place (not using the _REGNO name suffix).
2841 Correct cut&paste error causing it to use "xor" instead of
2842 "or" in one code path of the jit_ori implementation.
2843 Correct several flaws when clobbering registers and/or when
2844 one of the arguments was %*cx in the rotshr wrapper function
2845 implementing most shift operations.
2847 * lib/lightning.c: No longer expect that the backend be smart
2848 enough to know what to do when asking for a named register
2849 if that register is already an argument or is live. It fails
2850 if it is an argument, or if register is live, fails if cannot
2852 No longer incorrectly assume that eqr_{f,d} and ltgr_{f,d} are
2853 safe to inverse value tests in jump thread optimization.
2855 2012-12-05 Paulo Andrade <pcpa@gnu.org>
2857 * check/Makefile.am, check/cvt.ok, check/cvt.tst: Add new
2858 "cvt" test case to test conversion from/to int/float types.
2860 * check/lightning.c: Only define truncr_{f,d}_l in 64 bit mode.
2862 * include/lightning.h: Correct typo that caused it to define
2863 jit_truncr_{f,d}_l in 32 bit mode.
2865 * lib/jit_arm-cpu.c: Avoid assertion failure in the signed/unsigned
2866 extend opcodes generation as it shares an interface for 3 argument
2869 * lib/jit_x86-cpu.c: Correct wrong argument passed to
2870 jit_unget_reg in the andi implementation and wrong byte
2871 unsigned extend code generation.
2873 * lib/jit_x86-sse.c: Correct conversion from "word" to float or
2874 double as is dependent on wordsize.
2876 2012-12-05 Paulo Andrade <pcpa@gnu.org>
2878 * check/ldstr-c.ok, check/ldstr-c.tst, check/ldstxi-c.ok,
2879 check/ldstxi-c.tst, check/ldstxr-c.ok, check/ldstxr-c.tst:
2880 New test case files testing load clobbering the base and/or
2883 * check/ldst.inc: New file with common definition for all the
2886 check/Makefile.am, check/ldsti.tst, check/ldstr.tst,
2887 check/ldstxi.tst, check/ldstxr.tst: Update for new common
2888 definitions file and new register clobber ldst tests.
2890 2012-12-05 Paulo Andrade <pcpa@gnu.org>
2892 * lib/jit_mips-fpu.c: Correct wrong register order in stxr_{f,d}
2893 in the mips backend.
2895 2012-12-05 Paulo Andrade <pcpa@gnu.org>
2897 * lib/jit_arm-vfp.c: Correct regression found in armv7l with
2900 2012-12-05 Paulo Andrade <pcpa@gnu.org>
2902 * check/ldstxi.tst, check/ldstxr.tst: Correct wrong argument
2903 order for 32 bit mode tests.
2905 * configure.ac: Correct check for ix86 target_cpu.
2907 2012-12-05 Paulo Andrade <pcpa@gnu.org>
2909 * check/ldstr.ok, check/ldstr.tst, check/ldsti.ok,
2910 check/ldsti.tst, check/ldstxr.ok, check/ldstxr.tst,
2911 check/ldstxi.ok, check/ldstxi.tst:
2912 New test case files exercising a very large amount of
2913 register combinations to verify load/store implementation.
2915 * check/Makefile.am: Update for new test cases.
2917 * lib/jit_x86-cpu.c: Correct wrong argument order when
2918 computing REX prefix for {ld,st}r_T codes;
2920 2012-12-04 Paulo Andrade <pcpa@gnu.org>
2922 * lib/jit_mips-fpu.c, lib/jit_mips.c: Implement missing mips
2923 jit_sqrtr_{f,d} codes.
2925 * check/all.tst, include/lightning.h, lib/jit_print.c: Change
2926 declaration order and call order in all.tst of {add,sub}c and
2927 {add,sub}x. *c must be called before to set the carry and *x
2928 second to use the carry and keep it set. The wrong call order
2929 was causing all.tst to fail in mips, where a register is
2930 allocated to keep a global carry state.
2932 2012-12-04 Paulo Andrade <pcpa@gnu.org>
2934 * include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
2935 lib/jit_mips-fpu.c, lib/jit_mips.c: Correct float/double
2936 argument handling and make the mips backend pass the initial
2939 * include/lightning.h, ib/jit_print.c, lib/lightning.c:
2940 Add extra enum values for argument handling functions that
2941 could not be abstracted to the current codes, that is, when
2942 float values need to move from/to gpr from/to fpr. It would
2943 be more tempting to add such primitives, but they would have
2944 wordsize limitations, and it is not expected to add codes
2945 with one gpr argument for 64 bit and two for 32 bit.
2947 * lib/jit_ppc.c: Check _jit->function before calling jit_epilog()
2948 to avoid a runtime exception.
2950 2012-12-04 Paulo Andrade <pcpa@gnu.org>
2952 * include/lightning/jit_mips.h, lib/jit_mips.c: Update to
2953 make the mips backend compile in a qemu image.
2955 * lib/jit_ppc.c: Minor adaptations to help in having the
2956 ppc backend compilable.
2958 2012-12-03 Paulo Andrade <pcpa@gnu.org>
2960 * configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
2961 lib/jit_arm-swf.c, lib/jit_arm.c, check/Makefile.am: Correct
2962 implementation of the arm backend port to build and pass the
2963 current test cases. Tested on armv7 with softfp abi.
2965 * lib/jit_disasm.c: Rename and change prototype of static
2966 disassemble function as in the arm backend it is required
2967 to access state information stored in the jit_state_t object.
2969 * check/3to2.tst, check/add.tst: Correct test case code assuming
2970 JIT_RO and JIT_RET are the same, and even if they are the same,
2971 the logic was incorrect because it must always call jit_retval*
2972 to fetch a function call return before any other instruction.
2973 The arm backend hash a special condition if jit_retval is not
2974 called, because "r0" is not JIT_R0, but is JIT_RET and *also*
2975 the first argument for a called function, so JIT_RET must be
2976 only used as an argument to jit_retval.
2978 2012-12-03 Paulo Andrade <pcpa@gnu.org>
2980 * check/all.tst, check/lightning.c: Only declare or use 64 bit
2981 interfaces on 64 bit builds.
2983 * check/fib.tst: Use simpler logic to not need preprocessor
2984 conditionals for 32 or 64 bit.
2986 * include/lightning.h: Only declare 64 bit macros on a 64 bit
2987 build. Code using lightning must know about wordsize and the
2988 jit generation limitations, also, this way it generates a
2989 compile time failure, not a runtime assertion.
2991 * include/lightning/jit_x86.h: Correct typo in macro name.
2993 * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
2994 lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
2995 lib/jit_x86.c, lib/jit_x86-cpu.c: Correct wrong code to get
2996 current jit function pointer.
2998 * lib/lightning.c: Move call to the simplify() optimization
2999 to after register liveness is known. Previous code did work
3000 by accident but now with proper test cases the problem was
3003 * lib/jit_disasm.c: Always cast bfd_vma to long long when
3004 passing it as printf argument.
3006 2012-12-03 Paulo Andrade <pcpa@gnu.org>
3008 * configure.ac, check/Makefile.am, check/check.sh,
3009 doc/Makefile.am, include/lightning/Makefile.am,
3010 lib/Makefile.am: Correct make distcheck.
3012 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3014 * lib/jit_ppc.c: Assign copyright ownership to FSF.
3016 * lib/jit_x86-cpu.c: Correct integer multiplication that was
3017 generating code with reversed register arguments.
3019 * check/rpn.ok, check/rpn.tst: New test case file.
3021 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3023 * lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
3024 Actually change copyright owner to FSF as avertised.
3026 * lib/jit_arm-cpu.c, lib/jit_arm-swf.c,
3027 lib/jit_arm-vfp.c, lib/jit_arm.c,
3028 lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c,
3029 lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: New
3030 files implementing initial code different jit backends.
3032 * include/lightning/jit_private.h: Add extra field to the
3033 private jit_patch_t type, required by the arm port.
3035 * lib/Makefile.am: Update for the new backend implementation
3038 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3040 * check/Makefile.am: Add proper "make clean" rule and missing
3041 check.sh to EXTRA_DIST.
3043 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3045 * .gitignore: Update pattern of ignored files.
3047 * check/Makefile.am: Add rule to build liblightning.la dependency
3048 in case of running "make check" before building the library.
3050 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3052 * lightning/Makefile.am, lightning/asm-common.h,
3053 lightning/core-common.h, lightning/fp-common.h,
3054 lightning/funcs-common.h, lightning/i386/Makefile.frag,
3055 lightning/i386/asm-32.h, lightning/i386/asm-64.h,
3056 lightning/i386/asm.h, lightning/i386/core-32.h,
3057 lightning/i386/core-64.h, lightning/i386/core.h,
3058 lightning/i386/fp-32.h, lightning/i386/fp-64.h,
3059 lightning/i386/fp.h, lightning/i386/funcs.h,
3060 lightning/ppc/asm.h, lightning/ppc/core.h,
3061 lightning/ppc/fp.h, lightning/ppc/funcs.h,
3062 lightning/sparc/asm.h, lightning/sparc/core.h,
3063 lightning/sparc/fp.h, lightning/sparc/funcs.h:
3064 Removed. The core logic is used in the new code, and new mips
3065 and arm ports will be added. At first, sparc will not be
3066 supported as it has not yet been ported to the new engine.
3068 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3070 * tests/Makefile.am, tests/3to2.c, tests/3to2.ok, tests/add.c,
3071 tests/add.ok, tests/allocai.c, tests/allocai.ok, tests/bp.c,
3072 tests/bp.ok, tests/divi.c, tests/divi.ok, tests/fib.c, tests/fib.ok,
3073 tests/fibdelay.c, tests/fibdelay.ok, tests/fibit.c, tests/fibit.ok,
3074 tests/funcfp.c, tests/funcfp.ok, tests/incr.c, tests/incr.ok,
3075 tests/ldst.c, tests/ldst.ok, tests/ldxi.c, tests/ldxi.ok,
3076 tests/modi.c, tests/modi.ok, tests/movi.c, tests/movi.ok,
3077 tests/printf.c, tests/printf.ok, tests/printf2.c, tests/printf2.ok,
3078 tests/ret.c, tests/ret.ok, tests/rpn.c, tests/rpn.ok, tests/rpnfp.c,
3079 tests/rpnfp.ok, tests/sete.c, tests/sete.ok, tests/testfp.c,
3080 tests/testfp.ok, tests-run-test: Removed previous test suite, in
3081 favor of a newer one in the check subdirectory.
3083 * check/3to2.ok, check/3to2.tst, check/add.ok, check/add.tst,
3084 check/allocai.ok, check/allocai.tst, check/bp.ok, check/bp.tst,
3085 check/divi.ok, check/divi.tst, check/fib.ok, check/fib.tst:
3086 New sample input for the new test program, loosely matching
3087 several of the previous test cases.
3089 * check/Makefile.am: New test suite makefile.
3091 * check/check.sh, check/run-test: New wrapper files for the
3094 * check/lightning.c: New file. The main driver of the new test
3095 suite, that compiles to a parser of a very simple assembly like
3096 language, generates jit and executes it.
3098 * check/all.tst: New file. A generic debug and sample test file
3099 with a directive to prevent it from being executed, and useful to
3100 read disassembly of all possible instructions, using a fixed set
3103 * include/Makefile.am, include/lightning.h,
3104 include/lightning/Makefile.am, include/lightning/jit_arm.h,
3105 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
3106 include/lightning/jit_private.h, include/lightning/jit_x86.h,
3107 lib/Makefile.am, lib/jit_disasm.c, lib/jit_print.c,
3108 lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c,
3109 lib/jit_x86.c, lib/lightning.c: New files. These files are
3110 written from scratch, only by <pcpa@gnu.org>, and have now
3111 copyright assignment to the FSF. This is the core of the new
3112 lightning rework. Previously it was integrated in code with
3113 a garbage collector and several custom types like vectors and
3114 hash tables, so this first code merge with lightning converts
3115 that code into a library extracting only the jit bits, and at
3116 first only for x86_64 GNU/Linux.
3118 * lightning.h, m4/lightning.m4: Removed. These are no longer
3119 required in the new lightning code.
3121 .gitignore, Makefile.am, configure.ac: Update for the new
3124 2012-12-02 Paulo Andrade <pcpa@gnu.org>
3125 * .cvsignore: Removed for extra cleanup.
3127 * build-aux: Rename directory to m4.
3129 * m4: Renamed to "default" name and for consistency with merge
3130 with code rework to be imported in lightning.
3132 * .gitignore, configure.ac, Makefile.am, doc/Makefile.am:
3133 Update for build-aux to m4 rename.
3135 2012-12-01 Paulo Andrade <pcpa@gnu.org>
3137 * opcode/Makefile.am, opcode/Makefile.in, opcode/ansidecl.h,
3138 opcode/bfd.h, opcode/dis-asm.h, opcode/dis-buf.c, opcode/disass.c,
3139 opcode/i386-dis.c, opcode/i386.h, opcode/ppc-dis.c, opcode/ppc-opc.c,
3140 opcode/ppc.h, opcode/sparc-dis.c, opcode/sparc-opc.c, opcode/sparc.h,
3141 opcode/sysdep.h: Removed. Do not bundle GNU binutils files.
3143 * aclocal.m4, configure, Makefile.in, config.h.in, doc/Makefile.in,
3144 lightning/Makefile.in, tests/Makefile.in: Removed. Do not maintain
3145 autogenerated files that also generate too much diff noise when
3148 * build-aux/help2man, build-aux/texinfo.tex, build-aux/texi2dvi:
3149 Removed. Buildenvironment must have an up to date version from
3152 * build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
3153 build-aux/install-sh build-aux/mdate-sh build-aux/missing: Removed.
3154 Do not maintain a copy of automake files in git. Release tarballs
3155 must use an up to date version.
3157 * lightningize.in, doc/lightningize.1: Removed. Do not encourage
3158 bundling lightning in other packages. It should use a system package
3159 or a proper thirdy part subdirectory.
3161 * INSTALL: Removed. Autoreconf removes it and creates a symlink
3162 when regenerating files, so, avoid conflicts in git and let
3163 automake create the symlink.
3165 * .gitignore: Add INSTALL and autogenerated files.
3167 * configure.ac, Makefile.am: Update for removal of opcode subdir,
3168 auto generated files and lightningize.
3170 * tests/Makefile.am, tests/3to2.c, tests/add.c, tests/bp.c,
3171 tests/fib.c, tests/fibdelay.c, tests/fibit.c, tests/funcfp.c,
3172 tests/incr.c, tests/printf.c, tests/rpn.c, tests/rpnfp.c,
3173 tests/sete.c, tests/testfp.c: Update for removal of opcode subdir.
3175 * doc/Makefile.am: Update for removal of lightningize.
3177 * configure.ac, lightning/ppc/funcs.h, lightning/sparc/funcs.h,
3178 lightning/i386/fp.h, lightning/i386/core.h, lightning/i386/asm.h,
3179 tests/3to2.c, tests/add.c, tests/bp.c, tests/fib.c, tests/fibdelay.c,
3180 tests/fibit.c, tests/funcfp.c, tests/incr.c, tests/printf.c,
3181 tests/rpn.c, tests/rpnfp.c, tests/sete.c, tests/testfp.c:
3182 Remove LIGHTNING_CROSS, it is half supported and incomplete.
3184 * tests/3to2.c, tests/funcfp.c, tests/rpnfp.c: Remove preprocessor
3185 check on JIT_FPR. If no hardware registers are available, the backend
3186 must provide an alternative for software float.
3188 * lightning/ppc/core.h, lightning/sparc/core.h, tests/Makefile.am:
3189 Remove JIT_NEED_PUSH_POP. It is absolutely not trivial to implement
3190 properly on some backends due to stack alignment constraints, and
3191 whenever it is required, using jit_allocai and using a properly
3192 aligned stack vector, or a heap buffer, is better.
3194 * tests/push-pop.c, tests/push-pop.ok: Removed due to
3195 JIT_NEED_PUSH_POP no longer available.
3197 2011-02-28 Paolo Bonzini <bonzini@gnu.org>
3199 * lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_,
3200 fix jit_mul{i,r}_{l,ul}.
3202 2010-08-20 Paolo Bonzini <bonzini@gnu.org>
3204 * lightning/i386/fp-64.h: Return patch address from jit_bXYr_{f,d}.
3205 Reported by Paulo César Pereira de Andrade.
3206 * lightning/ppc/fp.h: Likewise.
3207 * lightning/sparc/fp.h: Implement FP branches.
3209 2010-08-18 Paolo Bonzini <bonzini@gnu.org>
3211 * lightning/i386/fp-64.h: Fix jp in jit_bner_{f,d}.
3213 2010-08-18 Paolo Bonzini <bonzini@gnu.org>
3215 * lightning/i386/fp-32.h: Fix -D_ASM_SAFETY compilation.
3216 Reported by Paulo César Pereira de Andrade.
3218 2010-08-15 Paolo Bonzini <bonzini@gnu.org>
3220 * tests/ldst.c: Update.
3221 * tests/Makefile.am: Use -ffloat-store to compile it.
3223 2010-08-15 Paolo Bonzini <bonzini@gnu.org>
3225 * lightning/i386/core.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
3226 jit_ldxr_s): Move...
3227 * lightning/i386/core-32.h: ... here.
3228 * lightning/i386/core-64.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
3229 Use movsbq and movswq.
3231 2010-08-10 Paulo César Pereira de Andrade <pcpa@mandriva.com.br>
3233 * lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir.
3234 (jit_movbrm): Check index register as well.
3235 * lightning/i386/fp-64.h: Add jit_extr_f_d and jit_extr_d_f.
3236 * lightning/fp-common.h: Add jit_extr_f_d and jit_extr_d_f.
3238 2010-07-28 Paolo Bonzini <bonzini@gnu.org>
3240 * tests/Makefile.am: Add ldst test.
3241 * tests/Makefile.in: Regenerate.
3242 * tests/ldst.c: New.
3243 * tests/ldst.ok: New.
3245 2010-07-28 Paolo Bonzini <bonzini@gnu.org>
3247 * THANKS: Add Paulo Cesar Pereira de Andrade.
3248 * doc/porting.texi: Fix ordering of arguments in jit_stxi.
3249 * lightning/i386/core-32.h (jit_replace): Remove cmp argument.
3250 * lightning/i386/fp-64.h (jit_movi_f): Fix.
3252 2010-07-26 Paolo Bonzini <bonzini@gnu.org>
3254 * lightning/i386/core-32.h (jit_replace): Move here (removed
3257 2010-07-19 Paolo Bonzini <bonzini@gnu.org>
3259 * build-aux/lightning.m4: Always set and replace lightning_frag.
3260 * Makefile.in: Regenerate.
3261 * aclocal.m4: Regenerate.
3262 * config.h.in: Regenerate.
3263 * configure: Regenerate.
3264 * doc/Makefile.in: Regenerate.
3265 * doc/lightningize.1: Regenerate.
3266 * doc/version.texi: Regenerate.
3267 * lightning/Makefile.in: Regenerate.
3268 * opcode/Makefile.in: Regenerate.
3269 * tests/Makefile.in: Regenerate.
3271 2009-03-01 Paolo Bonzini <bonzini@gnu.org>
3273 * lightning/i386/core-64.h: Use Mike's macros for x86-64 too.
3274 * lightning/i386/core.h: Remove jit_replace.
3276 2009-02-27 Mike Spivey <mike@comlab.ox.ac.uk>
3278 * lightning/i386/core.h: Rewrite shift-handling macros.
3279 * lightning/fp-common.h: Fix jit_extr_{f_d,d_f}.
3281 2009-02-17 Mike Spivey <mike@comlab.ox.ac.uk>
3283 * lightning/i386/core.h: Fix blunder in operand order.
3285 2009-02-17 Paolo Bonzini <bonzini@gnu.org>
3287 * lightning/i386/fp-32.h: Another fix to jit_fp_btest.
3289 2009-02-17 Paolo Bonzini <bonzini@gnu.org>
3291 * lightning/fp-common.h: Define double branches if missing.
3292 * lightning/i386/asm.h: Define JC and JNC mnemonics.
3293 * lightning/i386/fp-32.h: Fix jit_fp_btest. All reported
3296 2008-10-09 Paolo Bonzini <bonzini@gnu.org>
3298 * lightning/ppc/funcs.h (jit_flush_code): Subtract 1 from end.
3299 Reported by Eli Barzilay and Matthew Flatt.
3301 2008-08-23 Nix <nix@esperi.org.uk>
3303 * lightning/i386/Makefile.frag: fp-32.h and fp-64.h are target files.
3305 2008-07-02 Laurent Michel <ldm@engr.uconn.edu>
3307 * lightning/ppc/funcs.h (jit_flush_code): modified the computation
3308 of start/end. The pointer arithmetic was done without casting. It
3309 prevented compilation with recent gcc versions.
3310 * lightning/ppc/core.h (jit_pushr_i): The offset for the store was
3311 incorrect. Should have been 4 bytes below SP (not above).
3312 * lightning/ppc/core.h (jit_popr_i): The offset for the load was
3313 incorrect. Should have been 0 (not +8).
3315 2008-06-17 Paolo Bonzini <bonzini@gnu.org>
3317 * lightning/i386/asm-64.h: Forward IMULQir to IMULQirr,
3318 fix REXQ order for IMULQirr.
3320 2008-06-17 Paolo Bonzini <bonzini@gnu.org>
3322 * lightning/i386/core.h: Fix _rN vs. _rR.
3324 2008-06-16 Paolo Bonzini <bonzini@gnu.org>
3326 * lightning/i386/core.h: Use jit_save in jit_replace. Move JIT_R
3328 * lightning/i386/core-32.h: ... here; define jit_save so that
3329 the core.h has no effect on the 32-bit backend.
3330 * lightning/i386/core-64.h: Place JIT_R1/JIT_R2 in R10/R11,
3331 place outgoing arguments in the right spot from the beginning,
3332 define jit_save, fix jit_reg8/jit_reg16.
3334 2008-06-15 Paolo Bonzini <bonzini@gnu.org>
3336 * lightning/i386/core-64.h: Rewrite argument passing to
3337 support up to 6 arguments and generate less code.
3339 2008-06-14 Laurent Michel <ldm@thorgal.homelinux.org>
3341 * lightning/i386/core-64.h (jit_movi_l): When the operand is 0,
3342 the XOR should be on a quadword.
3343 * lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack
3345 (jit_ret): Always use LEAVE.
3347 2008-06-13 Laurent Michel <ldm@thorgal.homelinux.org>
3349 * lightning/i386/core-64.h: Add (void) casts for C++ compatibility.
3350 * lightning/i386/asm.h: Likewise.
3352 2008-06-12 Paolo Bonzini <bonzini@gnu.org>
3354 * lightning/i386/core.h: Move JIT_V definition...
3355 * lightning/i386/core-32.h: ... here.
3356 * lightning/i386/core-64.h: ... and here. Avoid dancing between
3357 RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13.
3359 2008-06-11 Paolo Bonzini <bonzini@gnu.org>
3361 * build-aux/lightning.m4: Adjust LIGHTNING_BACKENDS, don't
3362 use suffix support to distinguish i386/x86_64.
3363 * lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES
3364 to distribute *-32.h and *-64.h files now.
3365 * lightning/i386/asm-i386: Moved to...
3366 * lightning/i386/asm.h: Include the appropriate subtarget file.
3367 * lightning/i386/core-i386: Moved to...
3368 * lightning/i386/core.h: Include the appropriate subtarget file.
3369 * lightning/i386/fp.h: New, include the appropriate subtarget file.
3370 * lightning/i386/asm-32: Do not include asm-i386.h.
3371 * lightning/i386/asm-64.h: Likewise.
3372 * lightning/i386/core-32: Do not include core-i386.h.
3373 * lightning/i386/core-64.h: Likewise.
3374 * lightning/Makefile.am: Adjust for renamed files.
3376 * configure.ac: Define LIGHTNING_TARGET here.
3377 * opcode/disass.c: Change list of valid LIGHTNING_TARGET values.
3379 * lightningize.in: Robustify against missing subtarget files.
3381 2008-06-11 Paolo Bonzini <bonzini@gnu.org>
3383 * lightning/i386/core-32.h: Use MOVLir instead of jit_movi_l
3384 to implement jit_movi_p.
3386 2008-06-11 Paolo Bonzini <bonzini@gnu.org>
3388 * lightning/i386/core-32.h: Use separate __APPLE__ and SysV
3389 prolog/ret macros. Subtract 12 bytes in __APPLE__ case to
3390 keep stack aligned, and always use LEAVE in the epilog.
3392 2008-06-11 Paolo Bonzini <bonzini@gnu.org>
3394 * lightning/i386/core-i386.h: Fix C++ incompatibility.
3396 2008-06-10 Laurent Michel <ldm@engr.uconn.edu>
3398 * lightning/i386/core-i386.h: Fix jit_replace8 for
3399 case when one of the operands is _EAX.
3401 2008-05-19 Paolo Bonzini <bonzini@gnu.org>
3403 * tests/run-test: Avoid CRLF issues on mingw.
3405 2008-03-21 Paolo Bonzini <bonzini@gnu.org>
3407 * lightning/i386/core-64.h: Fix jit_{ld,st}{,x}i_{i,l}.
3408 Remove jit_ld{,x}i_ul.
3409 * lightning/core-common.h: Make jit_ld{,x}{i,r}_ul
3410 always a synonym of the _l variant.
3411 * doc/porting.texi: Document this.
3413 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3415 * lightning/i386/core-64.h: Fix uses of jit_qop_.
3417 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3419 * lightning/i386/core-64.h: Add boolean operations.
3421 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3423 * lightning/i386/asm-64.h: Add LEAQmr.
3425 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3427 * lightning/i386/core-64.h: Misc bugfixes.
3429 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3431 * lightning/i386/core-i386.c: Remove jit_ldr_i, jit_ldxr_i.
3432 * lightning/i386/core-32.h: Add jit_ldr_i, jit_ldxr_i.
3433 * lightning/i386/core-64.h: Add jit_ld{r,xr,i,xi}_{ui,l,ul};
3434 move jit_ldr_i, jit_ldxr_i, jit_str_l, jit_stxr_l with others.
3436 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3438 * lightning/asm-common.h: Add _s32P.
3440 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3442 * lightning/i386/core-64.h: Implement long mul/div/mod.
3444 2008-03-19 Paolo Bonzini <bonzini@gnu.org>
3446 * lightning/i386/asm-i386.h: Cast memory address to long for JCCim.
3448 2008-03-15 Paolo Bonzini <bonzini@gnu.org>
3450 * lightning/asm-common.h: Add underscores around __unused__
3453 2008-03-15 Paolo Bonzini <bonzini@gnu.org>
3455 * lightning/ppc/core.h: Avoid some "value computed is not used"
3457 * lightnings/tests/allocai.c: Silence other warnings.
3459 2008-03-14 Paolo Bonzini <bonzini@gnu.org>
3461 * lightningize.in: Fix some problems (not all).
3463 2008-03-14 Paolo Bonzini <bonzini@gnu.org>
3465 * lightning/i386/core-32.h: Avoid some "value computed is not used"
3466 warnings; reported by Sam Steingold.
3468 2008-03-08 Paolo Bonzini <bonzini@gnu.org>
3470 * lightning/i386/core-32.h: Fix stxr_c(_EAX, _EBX, _ESI).
3472 2008-02-13 Paolo Bonzini <bonzini@gnu.org>
3474 * lightning/i386/asm-32.h: Avoid redefinition of _r1, reported by
3476 * lightning/i386/asm-64.h: Likewise.
3478 2008-02-08 Paolo Bonzini <bonzini@gnu.org>
3480 * lightning/i386/asm-i386.h: Don't define _VOID, reported
3483 2008-02-03 Paolo Bonzini <bonzini@gnu.org>
3485 * build-aux/lightning.m4: Add --with-lightning-prefix option, suggested
3488 2008-01-14 Paolo Bonzini <bonzini@gnu.org>
3490 * lightning/i386/core-64.h: Use CALLsr, not CALLLsr.
3492 2008-01-13 Paolo Bonzini <bonzini@gnu.org>
3494 * lightning/i386/core-i386.h: Move jit_calli and jit_callr...
3495 * lightning/i386/core-32.h: ... here.
3496 * lightning/i386/core-64.h: Redefine them.
3498 2008-01-05 Paolo Bonzini <bonzini@gnu.org>
3500 * lightning/i386/fp-32.h: Fix sub(a,0,a).
3501 * lightning/tests/3to2.c: Add new testcases.
3502 * lightning/tests/3to2.ok: Add new testcases.
3504 2008-01-02 Paolo Bonzini <bonzini@gnu.org>
3506 * lightning/i386/fp-32.h: Fix sub(a,b,a) with a ~= JIT_FPR0.
3507 * lightning/tests/3to2.c: New.
3508 * lightning/tests/3to2.ok: New.
3510 2007-11-07 Paolo Bonzini <bonzini@gnu.org>
3512 * opcode/Makefile.am: Fix AM_CPPFLAGS.
3514 2007-08-12 Paolo Bonzini <bonzini@gnu.org>
3516 * lightning/i386/core-i386.h: Improve encoding of set* instructions.
3517 * lightning/i386/core-64.h: Fix jit_bra_l.
3518 * tests/sete.c: New.
3519 * tests/sete.ok: New.
3521 2007-06-29 Paolo Bonzini <bonzini@gnu.org>
3523 * tests/bp.c: Upgrade to GPL/LGPLv3.
3524 * lightning/i386/asm-32.h: Upgrade to GPL/LGPLv3.
3525 * lightning/i386/asm-64.h: Upgrade to GPL/LGPLv3.
3526 * lightning/i386/core-32.h: Upgrade to GPL/LGPLv3.
3527 * lightning/i386/core-64.h: Upgrade to GPL/LGPLv3.
3528 * lightning/i386/fp-64.h: Upgrade to GPL/LGPLv3.
3529 * lightning/sparc/asm.h: Upgrade to GPL/LGPLv3.
3530 * lightning/sparc/core.h: Upgrade to GPL/LGPLv3.
3531 * lightning/sparc/fp.h: Upgrade to GPL/LGPLv3.
3532 * lightning/sparc/funcs.h: Upgrade to GPL/LGPLv3.
3533 * lightning/i386/asm-i386.h: Upgrade to GPL/LGPLv3.
3534 * lightning/i386/core-i386.h: Upgrade to GPL/LGPLv3.
3535 * lightning/i386/fp-32.h: Upgrade to GPL/LGPLv3.
3536 * lightning/i386/funcs.h: Upgrade to GPL/LGPLv3.
3537 * lightning/ppc/asm.h: Upgrade to GPL/LGPLv3.
3538 * lightning/ppc/core.h: Upgrade to GPL/LGPLv3.
3539 * lightning/ppc/fp.h: Upgrade to GPL/LGPLv3.
3540 * lightning/ppc/funcs.h: Upgrade to GPL/LGPLv3.
3541 * lightning.h: Upgrade to GPL/LGPLv3.
3542 * tests/add.c: Upgrade to GPL/LGPLv3.
3543 * tests/fib.c: Upgrade to GPL/LGPLv3.
3544 * tests/testfp.c: Upgrade to GPL/LGPLv3.
3545 * tests/fibdelay.c: Upgrade to GPL/LGPLv3.
3546 * tests/fibit.c: Upgrade to GPL/LGPLv3.
3547 * tests/funcfp.c: Upgrade to GPL/LGPLv3.
3548 * tests/incr.c: Upgrade to GPL/LGPLv3.
3549 * tests/printf.c: Upgrade to GPL/LGPLv3.
3550 * tests/printf2.c: Upgrade to GPL/LGPLv3.
3551 * tests/rpn.c: Upgrade to GPL/LGPLv3.
3552 * tests/rpnfp.c: Upgrade to GPL/LGPLv3.
3553 * lightning/asm-common.h: Upgrade to GPL/LGPLv3.
3554 * lightning/core-common.h: Upgrade to GPL/LGPLv3.
3555 * lightning/fp-common.h: Upgrade to GPL/LGPLv3.
3556 * lightning/funcs-common.h: Upgrade to GPL/LGPLv3.
3557 * opcode/dis-buf.c: Upgrade to GPL/LGPLv3.
3558 * opcode/disass.c: Upgrade to GPL/LGPLv3.
3559 * opcode/i386-dis.c: Upgrade to GPL/LGPLv3.
3560 * opcode/sparc-dis.c: Upgrade to GPL/LGPLv3.
3561 * opcode/sparc-opc.c: Upgrade to GPL/LGPLv3.
3562 * lightningize.in: Upgrade to GPL/LGPLv3.
3563 * opcode/bfd.h: Upgrade to GPL/LGPLv3.
3564 * opcode/i386.h: Upgrade to GPL/LGPLv3.
3565 * opcode/sparc.h: Upgrade to GPL/LGPLv3.
3567 2007-01-26 Thomas Girard <thomas.g.girard@free.fr>
3569 * lightning/Makefile.am: Add clean-local target.
3571 2006-12-02 Paolo Bonzini <bonzini@gnu.org>
3573 * lightning/i386/asm-i386.h: Add CVTTS?2SIL.
3574 * lightning/i386/asm-64.h: Add CVTTS?2SIQ.
3575 * lightning/i386/fp-64.h: Use it.
3577 * lightning/Makefile.am: Place files in nodist_lightning_HEADERS.
3579 2006-11-23 Paolo Bonzini <bonzini@gnu.org>
3581 * lightning/core-common.h: Add casts in "*i_p" variants.
3582 * lightning/i386/asm-32.h: Add _r1.
3583 * lightning/i386/asm-64.h: Likewise, and add SSE instructions.
3584 * lightning/i386/asm-i386.h: Merge SSE instructions from Gwenole.
3585 Use short form for 16-bit AX instructions. Remove _r1
3586 * lightning/i386/core-64.h: Add FP ABI support in its infancy.
3587 * lightning/i386/core-i386.h: Move jit_arg_f and jit_arg_d...
3588 * lightning/i386/core-32.h: ... and jit_prepare_f and jit_prepare_d...
3589 * lightning/i386/fp-32.h: ... here.
3590 * lightning/i386/fp-64.h: Write the code.
3591 * lightning/sparc/fp.h: Fix jit_extr_{f_d,d_f} register order.
3593 2006-11-22 Paolo Bonzini <bonzini@gnu.org>
3595 * lightning/i386/asm-i386.h: Move x86-64 instructions...
3596 * lightning/i386/asm-64.h: ... here.
3597 * lightning/i386/fp-32.h: Fix bugfixes worked around in froofyJIT.
3599 * lightning/sparc/fp.h: Likewise.
3600 * lightning/ppc/fp.h: Likewise.
3601 * lightning/fp-common.h: Adjust for JIT_FPRET.
3602 * tests/funcfp.c: Adjust for JIT_FPRET.
3603 * tests/rpnfp.c: Adjust for JIT_FPRET.
3605 2006-11-20 Paolo Bonzini <bonzini@gnu.org>
3607 * lightning/i386/asm-i386.h: Add an underscore to macros without
3610 2006-11-20 Paolo Bonzini <bonzini@gnu.org>
3612 * lightning/i386/core-i386.h: Move jit_movip, jit_check8, jit_reg8,
3613 jit_reg16, jit_movbrm...
3614 * lightning/i386/core-32.h: ... here.
3615 * lightning/i386/core-64.h: Redefine them. Fix other bugs.
3617 * tests/printf.c: Do not do a varargs call.
3619 2006-11-20 Paolo Bonzini <bonzini@gnu.org>
3621 * lightning/i386/asm-i386.h: Check in rewrite from Basilisk II.
3622 * lightning/i386/asm-32.h: Adjust.
3623 * lightning/i386/asm-64.h: Adjust.
3624 * lightning/i386/fp-32.h: Adjust.
3626 * lightning/i386/core-32.h: Adjust. Add jit_{ld,ldx,st,stx}i*.
3627 * lightning/i386/core-64.h: Adjust. Add jit_{ld,ldx,st,stx}i*.
3628 * lightning/i386/core-i386.h: Adjust. Remove these patterns.
3630 2006-11-20 Paolo Bonzini <bonzini@gnu.org>
3632 * lightning/i386/asm-i386.h: Merge 64-bit cleanliness changes from
3635 * lightning/i386/asm-64.h: Likewise.
3637 2006-11-20 Paolo Bonzini <bonzini@gnu.org>
3638 Ludovic Courtes <ludo@chbouib.org>
3640 * lightning/i386/core-32.h: Disable jit_push and jit_pop if stack not
3642 * lightning/i386/core-64.h: Disable jit_push and jit_pop if stack not
3644 * lightning/sparc/core.h: Merge final implementation of jit_pushr and
3646 * lightning/ppc/core.h: Fix implementation of jit_pushr and jit_popr to
3647 work (more or less) across function calls.
3649 * tests/push-pop.c, tests/push-pop.ok: New test.
3650 * tests/Makefile.am: Run it.
3652 2006-11-20 Paolo Bonzini <bonzini@gnu.org>
3654 * lightning/asm-common.h: Make 64-bit safe.
3655 * lightning/i386/funcs.h: Make 64-bit safe.
3657 * lightning/i386/asm-64.h: More merge from mzscheme.
3658 * lightning/i386/asm-i386.h: More merge from mzscheme.
3659 * lightning/i386/core-32.h: More merge from mzscheme.
3660 * lightning/i386/core-64.h: More merge from mzscheme.
3661 * lightning/i386/core-i386.h: More merge from mzscheme.
3663 * tests/rpnfp.c, tests/testfp.c, tests/funcfp.c: Skip if no
3664 floating-point support.
3666 2006-11-04 Paolo Bonzini <bonzini@gnu.org>
3668 * tests/rpn.c: Remove pushr/popr.
3670 2006-11-04 Paolo Bonzini <bonzini@gnu.org>
3672 * lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.
3673 * lightning/ppc/funcs.h: Store frame size into _jitl. Store R1 before
3674 the STMW, so that the offset is unchanged when we patch the STMW.
3675 * lightning/i386/core.h: Define JIT_FP to be EBP.
3676 * lightning/i386/core-32.h: Implement jit_allocai, put LEAVE in the
3677 epilog if jit_allocai was used.
3678 * lightning/i386/core-64.h: Implement jit_allocai, put LEAVE in the
3679 epilog if jit_allocai was used.
3681 2006-11-04 Ludovic Courtes <ludo@chbouib.org>
3683 * lightning/sparc/core.h: Implement jit_allocai.
3684 * tests/allocai.c: New.
3685 * tests/Makefile.am: Point to new tests.
3687 2006-11-03 Paolo Bonzini <bonzini@gnu.org>
3689 * lightning/ppc/core.h: Fix jit_bms using BNE rather than BGT.
3690 "AND." does signed comparisons.
3692 2006-10-31 Paolo Bonzini <bonzini@gnu.org>
3694 * doc/porting.texi: Rename JIT_FP to JIT_AP.
3695 * lightning/core-common.h: Likewise.
3696 * lightning/i386/core-i386.h: Likewise.
3697 * lightning/fp-common.h: Provide default versions of jit_getarg_[fd].
3698 * lightning/i386/fp-32.h: Don't provide jit_getarg_[fd].
3699 * lightning/ppc/fp.h: Likewise.
3701 2006-10-31 Ludovic Courtes <ludo@chbouib.org>
3703 * doc/using.texi (The instruction set): Clarified the use of `JIT_RET' and
3704 documented `jit_retval'.
3705 * tests/ret.c (generate_function_proxy): After `jit_finish', use
3706 `jit_retval_i' to move FUNC's return value into the correct register.
3708 2006-10-31 Paolo Bonzini <bonzini@gnu.org>
3709 Ludovic Courtes <ludo@chbouib.org>
3711 * tests/divi.c, tests/divi.ok, tests/movi.c, tests/movi.ok: New.
3712 * tests/ldxi.c: Ensure large pointer is generated.
3713 * tests/Makefile.am: Point to new tests.
3714 * lightning.h: Include funcs-common.h before funcs.h.
3715 * lightning/sparc/core.h: Fix bugs in modi/divi.
3717 2006-10-30 Paolo Bonzini <bonzini@gnu.org>
3719 * lightning/Makefile.am: Use "ln -sf".
3720 * lightning/core-common.h: Define jit_negr_l if necessary.
3722 2006-10-30 Paolo Bonzini <bonzini@gnu.org>
3724 * lightning/i386/asm.h (MOVS*, MOVZ*): Use correct _r[124] macros.
3726 2006-10-29 Paolo Bonzini <bonzini@gnu.org>
3728 * configure.ac: Use lightning.m4 macros.
3729 * lightning.m4: Refactor to use common code in configure.ac. Move...
3730 * build-aux/lightning.m4: ... here.
3731 * lightningize.in: Support suffixes.
3732 * opcode/disass.in: Adapt to changes in configure.ac.
3734 * lightning/ppc/funcs.h: Use __APPLE__ instead of _CALL_DARWIN.
3735 * lightning/i386/core-32.h: Likewise.
3737 2006-10-26 Paolo Bonzini <bonzini@gnu.org>
3739 * configure.ac: Fix compilation test.
3740 * lightning/Makefile.am: Symlink LIGHTNING_TARGET_FILES in
3741 non-distribution mode.
3742 * lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES.
3744 2006-10-26 Paolo Bonzini <bonzini@gnu.org>
3746 * configure.ac: Subst cpu.
3747 * lightning/core-common.h: Make tests pass on i386.
3748 * lightning/i386/asm-32.h: Make tests pass on i386.
3749 * lightning/i386/asm-64.h: Make tests pass on i386.
3750 * lightning/i386/asm-i386.h: Make tests pass on i386.
3751 * lightning/i386/core-32.h: Make tests pass on i386.
3752 * lightning/i386/core-64.h: Make tests pass on i386.
3753 * lightning/i386/core-i386.h: Make tests pass on i386.
3754 * tests/Makefile.am: Include files from cpu directory.
3756 2006-10-26 Paolo Bonzini <bonzini@gnu.org>
3758 * lightning/i386/asm.h: Move to asm-i386.h
3759 * lightning/i386/asm-32.h: New, from Matthew Flatt.
3760 * lightning/i386/asm-64.h: New, from Matthew Flatt.
3761 * lightning/i386/core.h: Move to core-i386.h
3762 * lightning/i386/core-32.h: New, from Matthew Flatt.
3763 * lightning/i386/core-64.h: New, from Matthew Flatt.
3764 * lightning/i386/fp.h: Move to fp-32.h
3765 * lightning/i386/fp-64.h: New, dummy.
3766 * lightning/i386/Makefile.frag: New.
3767 * lightning/Makefile.am: Support per-target Makefile fragments.
3768 * configure.ac: Support per-target Makefile fragments and CPU suffixes.
3770 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
3772 * lightning/i386/i386.h (jit_flush_code): Fix syntax error. :-(
3774 2006-07-06 Paolo Bonzini <bonzini@gnu.org>
3775 Ludovic Courtes <ludovic.courtes@laas.fr>
3777 * doc/using.texi: Clarify "Using autoconf" section
3778 and rename it to "Bundling lightning"
3779 * lightning.m4: Work also if lightning is not bundled.
3781 2006-07-06 Paolo Bonzini <bonzini@gnu.org>
3782 Ludovic Courtes <ludovic.courtes@laas.fr>
3784 * lightning/ppc/core.h (_jit_mod): Replace with...
3785 (_jit_mod_big, _jit_mod_small): ... these.
3786 (jit_modi_i, jit_modi_ui): Rewrite.
3787 * tests/modi.c, tests/modi.ok: New tests.
3789 2006-05-18 Matthew Flatt <mflatt@cs.utah.edu>
3791 * lightning/i386/asm.h: Fix test for extending the mprotect area
3792 towards lower addresses.
3794 2006-05-16 Bruno Haible <bruno@clisp.org>
3796 * lightning/asm-common.h: Don't use __func__ nor __FUNCTION__ if
3797 not compiling with GNU C.
3799 2006-02-16 Paolo Bonzini <bonzini@gnu.org>
3801 * lightning/ppc/core.h: Fix jit_ldxi_* with big displacement.
3803 2006-01-23 Paolo Bonzini <bonzini@gnu.org>
3805 * configure.ac: Fix comments in config.h.in.
3807 2005-11-25 Paolo Bonzini <bonzini@gnu.org>
3809 * lightning/sparc/fp.h: Fix header comment.
3810 * lightning/ppc/fp.h: Fix header comment.
3812 2005-04-27 Paolo Bonzini <bonzini@gnu.org>
3814 * lightning/i386/asm.h (JCm, JCSm, JNCm, JNCSm): New.
3816 2004-11-26 Paolo Bonzini <bonzini@gnu.org>
3818 * lightning/ppc/funcs.h (_jit_epilog): Remove unused variable.
3820 2004-11-13 Paolo Bonzini <bonzini@gnu.org>
3822 * lightning/i386/funcs.h [__linux__]: Include sys/mman.h.
3824 2004-11-09 Paolo Bonzini <bonzini@gnu.org>
3826 * lightning/sparc/fp.h: Fix fp-to-integer conversions.
3827 * lightning/ppc/testfp.c: Test fp-to-integer conversions
3829 * lightning/ppc/testfp.ok: Adjust for the above.
3831 2004-11-08 Paolo Bonzini <bonzini@gnu.org>
3833 * lightning/ppc/testfp.c: Always flush code before
3836 2004-11-08 Paolo Bonzini <bonzini@gnu.org>
3838 * lightning/ppc/fp.h: Do not clobber f31.
3840 2004-11-08 Paolo Bonzini <bonzini@gnu.org>
3842 * lightning.h: New name of...
3843 * lightning-inst.h: ... this file.
3844 * lightning.h.in: Removed.
3846 * opcodes/disass.c: Include config.h.
3847 * tests/add.c: Include config.h.
3848 * tests/bp.c: Include config.h.
3849 * tests/fib.c: Include config.h.
3850 * tests/fibdelay.c: Include config.h.
3851 * tests/fibit.c: Include config.h.
3852 * tests/funcfp.c: Include config.h.
3853 * tests/incr.c: Include config.h.
3854 * tests/printf.c: Include config.h.
3855 * tests/printf2.c: Include config.h.
3856 * tests/rpn.c: Include config.h.
3857 * tests/rpnfp.c: Include config.h.
3858 * tests/testfp.c: Include config.h.
3860 2004-10-12 Paolo Bonzini <bonzini@gnu.org>
3862 * lightning/i386/fp.h: Fix bugs in conditional branches.
3864 2004-10-10 Paolo Bonzini <bonzini@gnu.org>
3866 * lightning/i386/funcs.h: Fix pasto in jit_flush_code.
3868 2004-10-08 Paolo Bonzini <bonzini@gnu.org>
3870 * lightning/ppc/fp.h: Optimized conditional branches.
3872 2004-09-20 Paolo Bonzini <bonzini@gnu.org>
3874 * lightning/ppc/asm.h: Fix more typos.
3876 2004-09-20 Paolo Bonzini <bonzini@gnu.org>
3878 * lightning/ppc/asm.h: Fix typos, replace `26' with JIT_AUX.
3880 2004-09-20 Paolo Bonzini <bonzini@gnu.org>
3882 * lightning/ppc/fp.h: Added conditional branches.
3884 2004-09-18 Laurent Michel <ldm@thorgal.homelinux.org>
3886 * lightning/ppc/fp.h (jit_unler_d, jit_unltr_d, jit_unger_d,
3887 jit_ungtr_d, jit_ltgt_d, jit_uneq_d): Implemented missing tests
3888 to fully support testfp.
3889 (jit_floorr_d_i, jit_ceilr_d_i, jit_roundr_d_i, jit_truncr_d_i):
3891 * lightning/ppc/asm.h: Added missing opcodes FCTIWZ and MTFSFI.
3892 * lightning/ppc/funcs.h (_jit_prolog): Fixed minor mistake in
3893 the initialization of _jitl.nextarg_geti, relying on the
3894 JIT_AUX macro as well to get the register offset.
3896 2004-09-07 Paolo Bonzini <bonzini@gnu.org>
3898 * lightning/ppc/funcs.h: Fix typo.
3900 2004-09-06 Paolo Bonzini <bonzini@gnu.org>
3902 * tests/funcfp.c: Use %g. Remove C99 variable declarations.
3903 * tests/testfp.c: Don't use __builtin_nan.
3905 * lightning/ppc/core.h: Add three V registers.
3906 * lightning/ppc/funcs.h: Adjust.
3908 * lightning/sparc/core.h: Some fixes related to FP argument passing.
3909 Move R0 to %g2, use %o7 for JIT_BIG2.
3910 * lightning/sparc/fp.h: Some fixes related to FP argument passing.
3912 2004-09-02 Paolo Bonzini <bonzini@gnu.org>
3914 * lightning/sparc/core.h: Add another V register,
3917 2004-07-15 Paolo Bonzini <bonzini@gnu.org>
3919 * lightning/i386/funcs.h: Implement jit_flush_code,
3920 in order to support Fedora's exec-shield.
3922 2004-07-14 Paolo Bonzini <bonzini@gnu.org>
3924 * lightning/core-common.h: Add more jit_extr_*_* macros.
3925 * lightning/doc/using.texi: Be clearer about the order
3926 of arguments in jit_extr_*_*.
3927 * lightning/doc/porting.texi: Add more jit_extr_*_* macros.
3928 * lightning/i386/fp.h: Fix typo in jit_extr_i_d.
3930 2004-07-14 Paolo Bonzini <bonzini@gnu.org>
3932 * lightning/ppc/funcs.h: Adjust offset of LR into
3933 stack frame if running under the Darwin ABI.
3935 2004-07-13 Paolo Bonzini <bonzini@gnu.org>
3937 * lightning/i386/fp.h: Rename jit_exti_d to jit_extr_i_d.
3939 2004-07-13 Paolo Bonzini <bonzini@gnu.org>
3941 * lightning/ppc/core.h: Fix thinko.
3943 * lightning/i386/core.h: Fix jit_lti_ui.
3944 * lightning/core-common.h: Add missing macros.
3946 * lightning/ppc/fp.h: Rename jit_neg_* to jit_negr_*.
3947 * lightning/i386/fp.h: Rename jit_neg_* to jit_negr_*.
3948 * lightning/sparc/fp.h: Rename jit_neg_* to jit_negr_*.
3949 * lightning/fp-common.h: Rename jit_neg_* to jit_negr_*.
3950 * doc/porting.texi: Add undocumented macros.
3952 2004-07-12 Paolo Bonzini <bonzini@gnu.org>
3954 * doc/porting.texi: Add missing macros.
3956 2004-07-12 Paolo Bonzini <bonzini@gnu.org>
3958 * lightning/ppc/funcs.h: Don't generate trampolines.
3959 Separate prolog and epilog generation.
3960 * lightning/ppc/core.h: Generate epilog explicitly.
3961 Don't reserve r31 anymore.
3962 * lightning/core-common.h: Remove call to jit_setup_code.
3964 2004-07-09 Paolo Bonzini <bonzini@gnu.org>
3966 * lightning/lightning.h.in: Avoid preprocessor warnings.
3967 * lightning/lightning-inst.h: Likewise.
3969 * lightning/i386/core.h: Define JIT_R, JIT_R_NUM, JIT_V,
3971 * lightning/ppc/core.h: Likewise.
3972 * lightning/sparc/core.h: Likewise.
3973 * lightning/i386/fp.h: Define JIT_FPR, JIT_FPR_NUM.
3974 * lightning/ppc/fp.h: Likewise.
3975 * lightning/sparc/fp.h: Likewise.
3976 * lightning/core-common.h: Define fixed register names.
3977 * lightning/fp-common.h: Likewise for FP regs.
3979 2004-07-09 Paolo Bonzini <bonzini@gnu.org>
3981 * lightning/ppc/funcs.h: Fix location where return address
3983 * lightning/i386/asm.h: Add a trailing _ to opcodes without
3985 * lightning/i386/core.h: Adjust for the above.
3987 2004-04-15 Paolo Bonzini <bonzini@gnu.org>
3989 * lightning/i386/fp.h: Change "and" to "_and"
3990 to satisfy C++ compilers.
3992 2004-04-14 Paolo Bonzini <bonzini@gnu.org>
3994 * lightning/sparc/fp.h: Use memcpy to implement jit_movi.
3995 * lightning/ppc/fp.h: Use memcpy to implement jit_movi.
3996 Move floating-point opcodes...
3997 * lightning/ppc/asm.h: ... here.
3999 2004-04-14 Paolo Bonzini <bonzini@gnu.org>
4001 * lightning/core-common.h: Add jit_finishr.
4002 * lightning/ppc/core.h: Add jit_callr and jit_finishr.
4003 * lightning/i386/core.h: Add jit_callr.
4004 * lightning/sparc/core.h: Add jit_callr. Fix typo.
4006 2004-04-14 Paolo Bonzini <bonzini@gnu.org>
4008 * lightning/i386/core.h: Fix pasto in jit_b*_ui.
4010 2004-03-30 Laurent Michel
4012 * lightning/ppc: Implement PowerPC floating point
4013 (ChangeLog entry missing).
4015 2004-03-12 Paolo Bonzini <bonzini@gnu.org>
4017 * lightning/fp-common.h: Load/store macros are not the
4018 same for floats and doubles anywhere, but jit_retval may be.
4019 * lightning/i386/asm.h: Fix = mistaken for == in ESCrri.
4020 * lightning/i386/core.h: Fix typo in jit_prepare_[fd].
4021 * lightning/i386/fp.h: Rewritten.
4022 * tests/testfp.c: Add tests for unordered comparisons.
4023 * tests/testfp.ok: Add results.
4025 2004-03-15 Paolo Bonzini <bonzini@gnu.org>
4027 Merge changes from Laurent Michel.
4029 * lightning/asm-common.h: Add _jit_I_noinc.
4030 * lightning/core-common.h: Support jit_init,
4031 jit_setup_code, jit_patch_at. Return patchable IP from
4033 * lightning/funcs-common.h: Provide defaults
4034 for jit_setup_code, jit_start_pfx, jit_end_pfx
4035 * lightning/i386/core.h: Add jit_patch_at, jit_patch_movi.
4036 * lightning/ppc/core.h: Likewise.
4037 * lightning/sparc/core.h: Likewise.
4038 * lightning/ppc/asm.h: Fix generation of branch destination
4039 displacements in _FB and _BB
4040 * lightning/ppc/core.h: Generate trampolines in the user
4042 * lightning/ppc/funcs.h: Add a few casts.
4043 * tests/bc.c: New testcase.
4045 * lightning/i386/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
4046 * lightning/ppc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
4047 * lightning/sparc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
4050 2004-03-09 Paolo Bonzini <bonzini@gnu.org>
4052 * lightning/sparc/fp.h: Rewrite. Move macros for
4053 FP code generation...
4054 * lightning/sparc/asm.h: ... here.
4055 * lightning/sparc/core.h: Rename jit_prepare to
4056 jit_prepare_i, jit_retval to jit_retval_i.
4057 * lightning/ppc/core.h: Rename jit_prepare to
4058 jit_prepare_i, jit_retval to jit_retval_i.
4059 * lightning/i386/core.h: Rename jit_prepare to
4060 jit_prepare_i, jit_retval to jit_retval_i.
4061 * lightning/core-common.h: Provide backwards
4062 compatible synonyms for the above.
4063 * lightning/fp-common.h: Rewrite.
4064 * lightning-inst.h: Include fp unconditionally.
4065 * lightning.h.in: Include fp unconditionally.
4066 * tests/Makefile.am: Enable fp tests.
4067 * tests/fib.c: Use jit_retval_i.
4068 * tests/fibit.c: Cast codeBuffer to char *.
4069 * tests/funcfp.c: Use new fp macros.
4070 * tests/printf.c: Use jit_retval_i.
4071 * tests/rpnfp.c: Use new fp macros.
4072 * tests/testfp.c: Use new fp macros.
4074 2004-03-02 Paolo Bonzini <bonzini@gnu.org>
4076 * lightning/i386/core.h: generate correct code when
4077 doing lt/le/ge/etc. on ESI and EDI. Use MOVZX/MOVSX
4079 * lightning/i386/asm.h: Add macros for MOVZX/MOVSX.
4080 Move macros for x87 here, and add many of them.
4081 * lightning/i386/fp.h: Use new macros for x87.
4083 2004-02-06 Paolo Bonzini <bonzini@gnu.org>
4085 * lightning/i386/core.h: avoid generating MOV reg, reg.
4086 * lightning/sparc/core.h: fix several bugs.
4087 * lightning/ppc/core.h: fix several bugs.
4088 * tests/rpn.c: rewritten.
4090 2004-01-08 Paolo Bonzini <bonzini@gnu.org>
4092 * tests/rpnfp.c: new example, suggested by Basile
4094 * tests/rpnfp.ok: new example.
4096 2003-12-12 Paolo Bonzini <bonzini@gnu.org>
4098 * tests/add.c: new test, suggested by Steve Dekorte.
4099 * tests/add.c: new test.
4101 2003-11-14 Paolo Bonzini <bonzini@gnu.org>
4102 John Redford <eirenik@hotmail.com>
4104 * lightning/asm-common.h: change the 'pc' field of _jit to
4105 be a union of various data types, because ISO C99 doesn't
4106 permit using ++ on a = cast. Change the incremented casts of
4107 _jit.pc to be _jit.x.uc_pc, _jit.x.us_pc, etc.
4108 * all files: change all non-cast instances of _jit.pc to be
4110 * lightning/i386/core.h: remove casts from jit_might.
4112 2003-05-25 Paolo Bonzini <bonzini@gnu.org>
4114 * lightning/i386/core.h: use JITSORRY in jit_replace
4115 * lightning/asm-common.h: define JITSORRY
4117 2003-05-14 Paolo Bonzini <bonzini@gnu.org>
4119 * lightning/i386/core.h: fix missing comma in several
4121 * lightning/core-common.h: fix long/unsigned long/pointer
4123 * lightning/ppc/funcs.h: correctly align stack pointer
4125 No changelogs for the assemblers (lightning directory) until 1.0
4127 2003-03-27 Paolo Bonzini <bonzini@gnu.org>
4129 * tests/printf2.c: new test
4131 2001-05-03 Paolo Bonzini <bonzini@gnu.org>
4133 * tests/printf.c: made the message platform independent
4135 2001-01-19 Paolo Bonzini <bonzini@gnu.org>
4137 * configure.in: support cross-assembling
4139 * disass/bfd.h, disass/dis-asm.h, disass/dis-buf.c,
4140 disass/i386-dis.c, disass/i386.h, disass/ppc-dis.c,
4141 disass/ppc.h, disass/ppc-opc.c, disass/sparc-dis.c,
4142 disass/sparc.h, disass/sparc-opc.c: new files, from GDB
4144 * disass/disass.c, disass/Makefile.am: new files
4146 * tests/fib.c, tests/fibit.c, tests/incr.c, tests/printf.c,
4147 tests/rpn.c, tests/testfp.c, tests/Makefile.am: support