git subrepo pull --force deps/lightrec
[pcsx_rearmed.git] / deps / lightning / ChangeLog
CommitLineData
c0c16242
PC
12022-10-05 Paulo Andrade <pcpa@gnu.org>
2
3 * check/lightning.c: Remove -Dmacro=value from usage and attempt
4 to parse it. It was buggy and not properly implemented. Now
5 it pass any extra options to the generated jit. To pass any
6 option starting with '-' need to also use '--'.
7 * check/collatz.e: New sample file showing an example of jit
8 generation.
9
102022-10-04 Paulo Andrade <pcpa@gnu.org>
11
12 * include/lightning/jit_private.h: Add new flag to jit_block_t.
13 * lib/lightning.c: Rewrite register liveness and state at block
14 entry code to avoid a very expensive and non scaling code path.
15 Now it attempts to do as few as possible recomputations when
16 merging state of adjacent blocks, still doing one extra nop pass
17 (in the sense that it will not find any changes) to make sure the
18 logic is correct.
19
202022-09-30 Paulo Andrade <pcpa@gnu.org>
21
22 * include/lightning/jit_private.h: Implement new data structures
23 specific to riscv.
24 * lib/jit_disasm.c: Extra disassemble code for riscv constant pool.
25 * lib/jit_riscv-cpu.c: Modify movi to use constant pool if 3 or
26 more instructions are required to construct constant and modify
27 movi_p to use a pc relative load from a constant pool.
28 lib/jit_riscv-sz.c: Update for new constant pool code. Most
29 instructions that need 64 bit constants are significantly reduced.
30 * lib/jit_riscv.c: Implement most of the constant pool code.
31 * lib/jit_size.c: Update for estimate of code generation size.
32 * lib/lightning.c: Update for riscv specific code, and also make
33 sure to mprotect the constant pool as executable.
34
ba3814c1
PC
352022-09-08 Paulo Andrade <pcpa@gnu.org>
36
37 * lib/jit_fallback.c: Implement fallback compare and swap with
38 pthreads.
39 * check/Makefile.am: Update for new cas{r,i} simple test.
40 * check/catomic.c, check/catomic.ok: New test case for
41 simple compare and swap atomic operation.
42 * check/lightning.c: Add entries to be able to use
43 the new compare and swap atomic operation. Still missing
44 a general test, only the basic C version.
45 * include/lightning.h.in: Include pthread.h, even if not
46 needing a fallback compare and swap.
47 * include/lightning/jit_private.h: Add support for a register pair
48 in second argument. Required by the new casr and casi operations.
49 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
50 lib/jit_ppc-cpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_x86-cpu.c,
51 lib/jit_x86-sz.c, lib/jit_x86.c: Implement inline code for compare
52 and swap.
53 * lib/jit_arm-cpu.c, lib/jit_arm-sz.c, lib/jit_arm.c: Implement
54 inline code for compare and swap if cpu is armv7, otherwise, use
55 a fallback with pthreads.
56 * lib/jit_alpha-cpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c,
57 lib/jit_hppa-cpu.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
58 lib/jit_ia64-cpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
59 lib/jit_mips-cpu.c, lib/jit_mips-sz.c, lib/jit_mips.c,
60 lib/jit_riscv-cpu.c, lib/jit_riscv-sz.c, lib/jit_riscv.c,
61 lib/jit_s390-cpu.c, lib/jit_s390-sz.c, lib/jit_s390.c,
62 lib/jit_sparc-cpu.c, lib/jit_sparc-sz.c, lib/jit_sparc.c: Implement
63 fallback compare and swap with pthreads. At least some of these
64 should be updated for inline code generation.
65 * lib/jit_names.c, lib/jit_print.c: lib/lightning.c: Update for the
66 new compare and swap operation.
67 * doc/body.texi: Add simple documentation of the compare and swap
68 new operation.
69
702022-08-12 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
71
72 Document jit_align.
73 * doc/body.texi: Add documentation for jit_align.
74
40a44dcb
PC
752022-05-14 Paulo Andrade <pcpa@gnu.org>
76
77 * include/lightning.h.in: Reorder jit_mov{n,z}r in instruction list.
78 * lib/jit_alpha.c, lib/jit_alpha-cpu.c, lib/jit_hppa.c,
79 lib/jit_hppa-cpu.c, lib/jit_ia64.c, lib/jit_ia64-cpu.c,
80 lib/jit_riscv.c, lib/jit_riscv-cpu.c, lib/jit_s390.c,
81 lib/jit_s390-cpu.c, lib/jit_sparc.c, lib/jit_sparc-cpu.c:
82 Implement fallback jit_mov{n,z}r. These are a somewhat cheap
83 implementation, but should be reviewed for the arches that already
84 have a proper conditional move.
85 * lib/jit_arm-sz.c, lib/jit_mips-sz.c: Add missing maximum size
86 estimative and reorder.
87 * lib/jit_aarch64-sz.c, lib/jit_x86-sz.c, lib/jit_ppc-sz.c:
88 Reorder entry to match definition order.
89 * lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_hppa-sz.c,
90 lib/jit_ia64-sz.c, lib/jit_riscv-sz.c, lib/jit_s390-sz.c,
91 lib/jit_sparc-sz.c: Add heuristic value, basically the sum of
92 the cost of a movr + beqr.
93 * lib/jit_names.c: Add entries for debug output of mov{n,z}r.
94 * lib/lightning.c: Use proper bitmask in jit_classify.
95
519a9ea1
PC
962021-04-03 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
97
98 * check/Makefile.am: Add test for the live instruction.
99 * check/live.ok: New file.
100 * check/live.tst: New file.
101 * doc/body.texi: Add documentation for the live instruction and
102 for jit_get_reg/jit_get_unreg. Fix menu entries.
103 * include/lightning.h.in (jit_get_reg, jit_unget_reg): Expose the
104 macros in the public header file.
105 * include/lightning/jit_private.h (jit_get_reg, jit_unget_reg):
106 Remove the macros from the private header file.
107
1082021-04-03 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
109
110 * Makefile.am, check/Makefile.am, doc/Makefile.am,
111 lib/Makefile.am: Include $(top_builddir)/include in include paths
112 for the autoconf-generated header file lightning.h.
113
1142021-04-03 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
115
116 * doc/.gitignore: Add version.texi to list of ignored files.
117 * doc/version.texi: Remove file from version control.
118
1192020-18-04 Paulo Andrade <pcpa@gnu.org>
120
121 * lib/jit_x86-cpu.c, lib/jit_x86.c: Implement %rip relative
122 calls and jumps on x86_64. Currently very conservative, assuming
123 a jit block can be larger than 2G, so, if a jump or call is in
124 the same jit generation, but target is unknown, use an indirect
125 branch (could have an option to assume a jit code block is
126 never larger than 2G). Also a deoptimization is that now does
127 not always generate ip relative jmpi; previously implicitly
128 assumed jmpi would never be larger than 2G. Overall still an
129 optimization.
130
4a71579b
PC
1312020-23-01 Paulo Andrade <pcpa@gnu.org>
132
133 * lib/lightning.c: Add a proper fix to the condition of considering
134 a register dead at entry of a block when it modifies the register
135 !after! a branch to a target where it is live.
136 The correction is just to split blocks on branches. It uses an
137 extra label per branch, but makes following the code simpler and
138 avoid costly searches.
139
1402020-22-01 Paulo Andrade <pcpa@gnu.org>
141
142 * lib/lightning.c: Correct a special condition of a register
143 only assigned in a block, and incorrectly marked as dead before
144 a jump where the register is live.
145
1462019-10-04 Paulo Andrade <pcpa@gnu.org>
147
148 * check/lightning.c, include/lightning/jit_private.h,
149 include/lightning/jit_x86.h, lib/jit_x86-cpu.c, lib/jit_x86-sz.c,
150 lib/jit_x86.c: Correct issues with MinGW64 that defines _WIN32
151 and needs long long for jit_word_t.
152
1532019-09-16 Paulo Andrade <pcpa@gnu.org>
154
155 * lib/lightning.c: Do not add registers that are never modified
156 to the set of registers to scan for live range, what might
157 consume a lot of cpu time, doing nothing.
158
519a9ea1 1592019-09-16 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
4a71579b
PC
160
161 * include/lightning/jit_x86.h, lib/jit_x86.c: Correct x86_64
162 backend, made %r12 a callee-save register as dictated by the
163 System V AMD64 ABI.
164
1652019-09-16 Paulo Andrade <pcpa@gnu.org>
166
167 * Makefile.am: Do not force CFLAGS for the get_jit_size target.
168 * check/lightning.c: Drop __ppc__ check.
169 * include/lightning.h.in: Drop __ppc__ check. Add new
170 jit_flag_vararg flag, for special case in powerpc 32 bit using
171 the SYSV abi, and need to pass an extra argument during code
172 generation.
173 * include/lightning/jit_ppc.c: Drop __ppc_ check. Remove the
174 ABI_ELFv2 macro, as it now directly checks for the _CALL_ELF
175 value when/if appropriate.
176 * include/lightning/jit_private.h: Drop __ppc_ check. Check for
177 _CALL_AIXDESC to define extra data to handle function
178 descriptors.
179 * lib/jit_ppc-cpu.c: Update to check for _CALL_SYSV; assume
180 !_CALL_SYSV == (_CALL_AIX || _CALL_LINUX). Significant code
181 rework for the SYSV abi.
182 * lib/jit_ppc-sz.c: Update for the SYSV abi.
183 * lib/jit_ppc.c: Update for the SYSV abi. Add matching va_list
184 type. Drop __ppc__ check.
185 * lib/jit_size.c: Drop __ppc_ check.
186 * lib/lightning.c: Drop __ppc__ check. Add proper check for
187 __powerpc__ and _CALL_AIXDESC to manage function descriptors.
188 * lib/size.c: Update to drop __pppc_ check and SYSV abi.
189
1902019-08-30 Paulo Andrade <pcpa@gnu.org>
191
192 * lib/jit_mips-cpu.c: Use JALR to get the same effect as JR, as
193 in mips32r6 JR generates an illegal instruction. Thanks to
194 Bruno Haible for providing a patch and the information, reported at
195 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925129
196 * THANKS: update.
197
519a9ea1 1982019-08-29 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
4a71579b
PC
199
200 * include/lightning/jit_private.h: Move definition of offsetof
201 from the public header file here.
202
203 * configure.ac, include/Makefile.am, include/lightning.h,
204 include/lightning.h.in: Generate lightning.h from lightning.in.h
205 and remove the dependence on config.h from the public header file.
206
2072019-06-04 Paulo Andrade <pcpa@gnu.org>
208
209 * include/lightning/jit_riscv.h, lib/jit_riscv-cpu.c,
210 lib/jit_riscv-fpu.c, lib/jit_riscv-sz.c, lib/jit_riscv.c:
211 Implement riscv port. Only 64 bit Linux supported. Built on
212 Fedora 28 image.
213
214 * check/all.tst, check/float.tst, configure.ac, include/lightning.h,
215 include/lightning/Makefile.am, include/lightning/jit_private.h,
216 lib/Makefile.am, lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
217 Minor updates for the new riscv port.
218
2192019-06-04 Paulo Andrade <pcpa@gnu.org>
220
221 * lib/jit_alpha.c lib/jit_ia64.c lib/jit_mips.c lib/jit_sparc.c:
222 Correct assertion of _jitc->regarg after emiting an instruction.
223 jit_carry may be set, but not an argument to the current instruction.
224
2252019-06-01 Paulo Andrade <pcpa@gnu.org>
226
227 * lib/lightning.c: Correct assertion on jit_unget_reg when the
228 argument is jit_carry, and jit_carry was not used in the
229 instruction.
230
2312019-06-01 Paulo Andrade <pcpa@gnu.org>
232
233 * include/lightning/jit_private.h: Remove no longer need
234 setmask field of jit_block_t and blockmask from jit_compiler_t.
235
236 * lib/lightning.c: Rework of register live and unknown state
237 information during jit generation. It no longer recurses nor
238 do dangerous bit unset of registers in unknown state. The
239 only pitfall known, that must be taken care now is that jmpr
240 (or jmpi to not a jit node) is treated as a function call, as
241 otherwise it would need to consider all registers live, and
242 spill/reload during all jit generation.
243
2442018-12-28 Paulo Andrade <pcpa@gnu.org>
245
246 * lib/jit_disasm.c: Release bfd handle. Thanks for patch to
247 Marc Nieper-Wißkirchen.
248
2492018-08-30 Paulo Andrade <pcpa@gnu.org>
250
251 * lib/jit_disasm.c: Add hints to select hppa disassembler.
252
253 * lib/jit_hppa-cpu.c: Correct address of vastart when all
254 argument registers were used as non vararg arguments.
255
256 * lib/jit_hppa-fpu.c: Disable load/store of rv,ix,rb where
257 rv is the value, ix is an register or integer offset and rb
258 is a base register. These should be better tested, as they do
259 not work on all environments (fail on qemu-hppa).
260
2612018-04-20 Paulo Andrade <pcpa@gnu.org>
262
263 * include/lightning/jit_private.h: Add new register classes to
264 flag float registers and double only registers, required for sparc64
265 where only low 32 bit fpr registers can be used for single precision
266 operations.
267 Add new 128 bit jit_regset_t type for sparc64 register set.
268
269 * include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
270 lib/jit_sparc-sz.c, lib/jit_sparc.c: Update for 64 bits sparc.
271
272 * lib/lightning.c: Update for new jit_regset_t required for sparc64.
273
2742018-02-26 Paulo Andrade <pcpa@gnu.org>
275
276 * check/lightning.c, include/lightning.h: Add the new jit_va_push
277 interface. That should be called when passing a va_list to a C
278 function. This is required because on Alpha a va_list is passed
279 by value, and lightning does not know about data types, so, cannot
280 understand it is pushing a va_list as argument.
281
282 * lib/jit_names.c, lib/lightning.c: Minor changes for the new
283 jit_code_va_push.
284
285 * check/cva_list.c: Update only test case using jit_va_push, to
286 pass a va_list to a C function.
287
288 doc/body.texi: Better documentation of the varargs interface.
289
290 * jit_alpha.c, jit_alpha-cpu.c: Update to properly push a
291 C va_list and correctly calculate varargs offset.
292
293 * lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_alpha-sz.c,
294 lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
295 lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_mips-sz.c, lib/jit_mips.c,
296 lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_s390-sz.c, lib/jit_s390.c,
297 lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-sz.c, lib/jit_x86.c:
298 Update for the new jit_va_push interface.
299
3002018-02-22 Paulo Andrade <pcpa@gnu.org>
301
302 * lib/jit_alpha-cpu.c: Always set t12 to the address of the
303 current function, to properly work on all systems. Previously
304 the shortcut did only work on Tru64. For Linux and glibc the
305 change is required.
306
3072018-02-22 Paulo Andrade <pcpa@gnu.org>
308
309 * lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
310 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c:
311 Correct wrong logic in usage of jit_live in jit_retr. The
312 problem is that if a temporary is required during epilog,
313 the return register might be allocated, so, jit_live must always
314 be used.
315
3162018-01-31 Paulo Andrade <pcpa@gnu.org>
317
318 * lib/lightning.c: Avoid deep recursions when computing live
319 register ranges.
320
3212018-01-31 Paulo Andrade <pcpa@gnu.org>
322
323 * lib/jit_mips-cpu.c: Correct frame size and varargs
324 initialization for the n32 abi.
325 * lib/jit_mips.c, lib/jit_mips-fpu.c: Correct 32 bit abis
326 in big-endian.
327
3282017-09-13 Paulo Andrade <pcpa@gnu.org>
329
330 * configure.ac: Add check for binutils 2.29 prototype to the
331 disassembler function.
332 * lib/jit_disasm.c: Adapt for binutils 2.29 change.
333
3342017-06-09 Paulo Andrade <pcpa@gnu.org>
335
336 * include/lightning/jit_private.h, lib/lightning.c: Add a
337 second pass from start when computing register live ranges.
338 This should be used temporarily, and is required for certain
339 loop constructs, with several consecutive blocks not referencing
340 a live register.
341
3422016-05-05 Paulo Andrade <pcpa@gnu.org>
343
344 * lib/lightning.c: Correct wrong movr simplification,
345 remove no longer needed code to set return registers live
346 and update live register set when reaching a label boundary,
347 but do not descend if the block has been already visited.
348 The later need some tuning for complex code generation, where
349 it will still have issues.
350
3512015-11-30 Paulo Andrade <pcpa@gnu.org>
352
353 * doc/body.texi: Change documentation to no longer say
354 it is a variant of the Fibonacci sequence, and document
355 a proper implementation.
356 Thanks to Jon Arintok for pointing out that the Fibonacci
357 sequence generation was incorrect. It was documented, but
358 still confusing.
359
360 * check/fib.tst, check/fib.ok, check/bp.tst, check/bp.ok,
361 doc/ifib.c, doc/rbif.c: Implement a proper Fibonacci
362 sequence implementation.
363
3642015-07-03 Paulo Andrade <pcpa@gnu.org>
365
366 * lib/jit_mips-cpu.c: Correct definition of htonr_ul.
367 Correct prolog/epilog/va* routines to work on o64 abi.
368
369 * lib/jit_mips-fpu.c: Correct load of double literal
370 argument when not using a data buffer.
371 Remove alignment correction in vaarg_d if using the
372 new mips abi.
373
374 * lib/jit_mips.c: Correct code to allow creating variadic
375 jit functions when using the new mips abi.
376
377 * lib/jit_rewind.c: Minor adjust for rewind when using
378 the new mips abi, if there are varargs arguments in
379 registers.
380
3812015-06-06 Paulo Andrade <pcpa@gnu.org>
382
383 * lib/jit_ia64-cpu.c: Search backward for the last output
384 register used, otherwise would stop too early if a float
385 argument used the slot.
386 Correct offset of first va_list argument, and use proper
387 va_list abi.
388
389 * lib/jit_ia64-fpu.c: Add new functions to move a gpr
390 to a fpr register, to counterpart the ones that move a
391 fpr to a gpr. These are required to properly implement
392 jit_getarg*_{f,d} on complex prototypes, or variadic
393 jit functions.
394
395 * lib/jit_ia64-sz.c: Update for support to jit variadic
396 functions.
397
398 * lib/jit_ia64.c: Implement proper abi for variadic
399 jit functions.
400
4012015-06-04 Paulo Andrade <pcpa@gnu.org>
402
403 * lib/jit_rewind.c: New file implementing generic functions
404 to "rewind", or rewrite IR code sequences.
405
406 * include/lightning.h: Add several new codes, that previously
407 were a function call, that would synthesize the operation.
408 Now, there is a code for the operation, and a new flag to
409 know an operation is synthesized.
410
411 * include/lightning/jit_private.h: Add several new macros to
412 help construct synthesized IR code sequences.
413
414 * lib/Makefile.am: Update for lib/jit_rewind.c.
415
416 * lib/jit_disasm.c: Update for a small rework on jit_node_t,
417 so that --enable-devel-disassembler does not need a change
418 in the layout of jit_node_t.
419
420 * lib/jit_names.c: Update for the new codes.
421
422 * lib/jit_print.c: Update to print more readable output, and
423 flag synthesized IR code sequences.
424
425 * lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
426 lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_x86-sz.c,
427 lib/jit_x86.c: Update for new synthesized IR code sequences.
428
429 * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu., lib/jit_ppc-sz.c,
430 lib/jit_ppc.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
431 lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_s390-fpu.c,
432 lib/jit_s390-sz.c, lib/jit_s390.c: Update for new synthesized
433 IR code sequences and correct bugs in the initial varargs
434 implementation support.
435
436 * lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_hppa-sz.c,
437 lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
438 lib/jit_sparc-sz.c, lib/jit_sparc.c: Add generic, untested
439 support for the new synthesized IR code sequences. Known
440 most likely broken right now, and should be corrected once
441 access to these hosts is available.
442
443 * lib/lightning.c: Update for new IR codes, and add support
444 for not yet existing instructions that change third argument.
445
446 * size.c: Change to use different tables for LE and BE PowerPC.
447 Correct a wrong endif for x32.
448
4492015-05-25 Paulo Andrade <pcpa@gnu.org>
450
451 * check/cva_list.c: New file implementing a test to ensure
452 the value returned by jit_va_start is a valid C va_list.
453
454 * check/va_list.ok: New simple helper file, as now the
455 va_list.tst test is enabled.
456
457 * check/va_list.tst: Rewritten for an extensive variadic
458 jit functions test.
459
460 * check/Makefile.am: Update for the new tests.
461
462 * lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
463 lib/jit_arm.c: Correct broken software float in a previous
464 commit. Note that the hard float abi implementation is known
465 broken at this time, for special cases involving variadic
466 functions, and should be corrected next.
467
468 lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c: Correct
469 the jit_va_list_t semantics to match C va_list.
470
4712015-05-24 Paulo Andrade <pcpa@gnu.org>
472
473 * lib/Makefile.am: Bump library major. This is a preparation
474 for a rework that was due for quite some time, but that is
475 now required to properly implement variadic jit functions.
476 The rework is mainly required to know at prolog parsing, if
477 a function is variadic or not. This will benefit a few
478 backends, and is mandatory for the hard float arm abi.
479 The rework was already planned for quite some time, to
480 be able to use a variable stack framesize, and for leaf
481 functions optimization where applicable.
482 The change will be source compatible, but will change
483 some internals, and jit_code_t values, as some new will
484 be added.
485 The only behavior change is that, jit_arg_register_p may
486 change return value on hard float arm abi, if called before
487 or after jit_ellipsis. Common sense anyway, would say to
488 make that call after jit_ellipsis, but documentation
489 should be updated for it.
490
4912015-05-24 Paulo Andrade <pcpa@gnu.org>
492
493 * lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: Correct base
494 aarch64 varargs code.
495
4962015-05-24 Paulo Andrade <pcpa@gnu.org>
497
498 * check/lightning.c: Clearly run check if clang is the system
499 compiler.
500
5012015-05-20 Paulo Andrade <pcpa@gnu.org>
502
503 * lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c, lib/jit_sparc.c:
504 Add base support to jit vararg functions to the sparc backend.
505
5062015-05-20 Paulo Andrade <pcpa@gnu.org>
507
508 * lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c, lib/jit_alpha.c:
509 Add base support to jit vararg functions to the alpha backend.
510
5112015-05-19 Paulo Andrade <pcpa@gnu.org>
512
513 * lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c, lib/jit_hppa.c:
514 Add base support to jit vararg functions to the hppa backend.
515
5162015-05-10 Paulo Andrade <pcpa@gnu.org>
517
518 * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c:
519 Add base support to jit vararg functions to the ia64 backend.
520
5212015-05-10 Paulo Andrade <pcpa@gnu.org>
522
523 * lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
524 and movi_f_w implementation to work when not using a
525 data buffer. This causes the check varargs.tst to
526 work when passing "-d" to the lightning test tool.
527
5282015-05-10 Paulo Andrade <pcpa@gnu.org>
529
530 * lib/jit_ia64.c: Implement inline assembly cache flush,
531 required on multiprocessor systems.
532
5332015-05-06 Paulo Andrade <pcpa@gnu.org>
534
535 * lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c:
536 Add base support to jit vararg functions to the mips backend.
537 Currently only supported on the o32 abi, until access to a
538 n32 system is arranged.
539
5402015-05-05 Paulo Andrade <pcpa@gnu.org>
541
542 * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c:
543 Add base support to jit vararg functions to the PowerPC backend.
544
5452015-05-02 Paulo Andrade <pcpa@gnu.org>
546
547 * lib/jit_s390-cpu.c, lib/jit_s390-fpu.c, lib/jit_s390.c:
548 Add base support to jit vararg functions to the s390 backend.
549
5502015-05-01 Paulo Andrade <pcpa@gnu.org>
551
552 * lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
553 lib/jit_arm.c: Add base support to jit vararg
554 functions to the arm backend.
555
5562015-04-30 Paulo Andrade <pcpa@gnu.org>
557
558 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
559 lib/jit_aarch64.c: Add base support to jit vararg
560 functions to the aarch64 backend.
561
5622015-04-27 Paulo Andrade <pcpa@gnu.org>
563
564 * include/lightning.h, include/lightning/jit_private.h,
565 lib/jit_names.c, lib/lightning.c: Add initial support
566 for the new jit_va_start, jit_va_arg, jit_va_arg_d, and
567 jit_va_end interfaces. The jit_va_start call is supposed
568 to return a va_list compatible pointer, but not yet
569 decided if it will be "declared" stdarg compatible,
570 as for now only x86 support has been added (and should
571 be compatible), but issues may arise on other backends.
572
573 * check/lightning.c: Add wrappers to call the new jit_va_*
574 interfaces.
575
576 * lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
577 jit_va_* for x86.
578
579 * lib/jit_x86-sz.c: Add fields, but not yet fully updated,
580 as this is an intermediate commit.
581
582 * lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
583 lib/jit_alpha-sz.c, lib/jit_alpha.c,
584 lib/jit_arm-sz.c, lib/jit_arm.c,
585 lib/jit_hppa-sz.c, lib/jit_hppa.c,
586 lib/jit_ia64-sz.c, lib/jit_ia64.c,
587 lib/jit_mips-sz.c, lib/jit_mips.c,
588 lib/jit_ppc-sz.c, lib/jit_ppc.c,
589 lib/jit_s390-sz.c, lib/jit_s390.c,
590 lib/jit_sparc-sz.c, lib/jit_sparc.c: Prepare for the
591 new jit_va_* interfaces. Not yet implemented, and will
592 cause an assertion if used.
593
594 * check/va_list.tst: Simple early test case, that works
595 on x86_64, x32, ix86, cygwin, and cygwin64.
596
5972015-02-17 Paulo Andrade <pcpa@gnu.org>
598
599 * include/lightning.h, include/lightning/jit_private.h,
600 lib/jit_aarch64-cpu.c, lib/jit_aarch64.c,
601 lib/jit_alpha-cpu.c, lib/jit_alpha.c,
602 lib/jit_arm-cpu.c, lib/jit_arm.c,
603 lib/jit_hppa-cpu.c, lib/jit_hppa.c,
604 lib/jit_ia64-cpu.c, lib/jit_ia64.c,
605 lib/jit_mips-cpu.c, lib/jit_mips.c,
606 lib/jit_ppc-cpu.c, lib/jit_ppc.c,
607 lib/jit_s390-cpu.c, lib/jit_s390.c,
608 lib/jit_sparc-cpu.c, lib/jit_sparc.c,
609 lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
610 jit_allocar(offs, size) interface, that receives
611 two integer registers arguments, allocates space
612 dynamically in the stack, returns the offset in
613 the first argument, and uses the second argument
614 for the size in bytes of the memory to be allocated.
615
616 * check/allocar.ok, check/allocar.tst: New files
617 implementing test cases for the new jit_allocar
618 interface.
619
620 * check/Makefile.am, check/lightning.c: Update for
621 the new test case and interface.
622
623 * doc/body.texi: Add documentation of the new
624 interface.
625
6262015-02-17 Paulo Andrade <pcpa@gnu.org>
627
628 * include/lightning/jit_x86.h, lib/jit_x86-cpu.c,
629 lib/jit_x86-x87.c: No longer make st(7) available.
630 Need to keep one x87 slots empty to avoid exceptions.
631 This has the side effect of no longer needing the
632 hackish emms instruction before a function call.
633
6342015-02-16 Paulo Andrade <pcpa@gnu.org>
635
636 * lib/lightning.c: Remove the jit_regno_patch bitfield
637 register fields before actual emit, as it is only really
638 used before emit, otherwise, on special conditions it
639 may consider live registers as dead during code emit.
640
6412015-02-15 Paulo Andrade <pcpa@gnu.org>
642
643 * lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
644 Correct encoding of ldxr* stxr* in the x32 abi. If the
645 displacement register is negative, it would generate
646 a 64 bit instruction with a 32 bit unsigned displacement.
647
648 * check/ranger.tst, check/ranger.ok: New files, implementing
649 a test case for negative loads and stores. This is range.tst
650 converted to use registers instead of immediate offsets.
651
652 check/Makefile.am: Update for the new test case.
653
6542015-02-07 Paulo Andrade <pcpa@gnu.org>
655
656 * lib/jit_size.c: Preventively use at least 144 bytes
657 if JIT_INSTR_MAX is less than it. The logic is not
658 guaranteed to be 100% precise, it is mostly heuristics
659 to allocate a buffer with as close as possible size,
660 but a wrong value may cause code generation to write
661 past the end of the buffer.
662
6632015-02-03 Paulo Andrade <pcpa@gnu.org>
664
665 * lib/lightning.c: Correct the reason the bug in
666 simplify_stxi was not triggered before, it was due to
667 incorrectly resetting the value->code field, what was
668 causing it to never properly optimize:
669 stxi Im0 Rb0 Rt0
670 ldxi Rt1 Rb1 Im1
671 when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
672 There was another possible issue, that has been also
673 addressed in this commit, that would be the case of
674 Rbn == Rtn, where no redundancy removal is possible.
675
6762015-02-03 Paulo Andrade <pcpa@gnu.org>
677
678 * lib/lightning.c: Correct wrong check in simplify_stxi.
679 The test was incorrectly comparing the target register
680 and the displacement offset. This was a time bomb bug,
681 that would trigger in code like:
682 stxi Im0 Rb0 Rt0
683 stxi Im1 Rb1 Rt1
684 if Rb0 == Rb1 && Rt0 == Rt1 && Im0 == Rt1, that is,
685 the wrong check was Im0 == Rt1, instead of the supposed
686 Im0 == Imm1 (that was what the code mean't to do). It
687 was removing the second stxi assuming it was redundantly
688 generated; as that is not uncommon pattern on
689 translators generating jit.
690
6912015-02-02 Paulo Andrade <pcpa@gnu.org>
692
693 * configure.ac, include/lightning/jit_private.h,
694 lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
695 lib/jit_disasm.c, lib/jit_hppa.c, lib/jit_ia64.c,
696 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
697 lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c: Add a new
698 --enable-devel-disassembler option, that should be used
699 during development, or lightning debug. This option
700 intermixes previous jit_print and jit_disassemble
701 output, making it easier to visualize what lightning
702 call was used, and what code was generated.
703
7042015-01-31 Paulo Andrade <pcpa@gnu.org>
705
706 * lib/jit_arm-cpu.c, lib/jit_arm.c: Only limit to 24 bit
707 displacement non conditional jump in the same jit_state_t.
708
7092015-01-19 Paulo Andrade <pcpa@gnu.org>
710
711 * doc/body.texi: Reorder documentation, making jit_frame
712 and jit_tramp the lightning response to the need of
713 trampolines, continuations and tail call optimizations.
714 A pseudo code example of a factorial function was added.
715 Also added a section for description of the available
716 predicates.
717
718 * doc/fact.c: New file, implementing a simple example of
719 a translation of a trivial, recursive, tail call optimization
720 into lightning calls. This is the conversion to functional C
721 code of the example in doc/body.texi.
722
723 * doc/Makefile.am: Update for the next test case.
724
7252015-01-17 Paulo Andrade <pcpa@gnu.org>
726
727 * include/lightning.h, lib/jit_aarch64.c,
728 lib/jit_alpha.c, lib/jit_arm-vfp.c, lib/jit_arm.c,
729 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
730 lib/jit_ppc.c, lib/jit_s390.c, lib/jit_sparc.c,
731 lib/jit_x86.c: Add the new jit_arg_register_p predicate.
732 The predicate is expected to be used to know if an
733 argument is in a register, what would need special
734 handling if code that can overwrite non callee save
735 registers is executed.
736
737 * check/carg.c: New test case to check consistency and
738 expected usage of jit_arg_register_p.
739
740 * check/Makefile.am: Update for new test case.
741
7422015-01-17 Paulo Andrade <pcpa@gnu.org>
743
744 * include/lightning/jit_aarch64.h,
745 include/lightning/jit_alpha.h,
746 include/lightning/jit_arm.h,
747 include/lightning/jit_hppa.h,
748 include/lightning/jit_mips.h,
749 include/lightning/jit_ppc.h,
750 include/lightning/jit_s390.h,
751 include/lightning/jit_sparc.h,
752 include/lightning/jit_x86.h,
753 lib/jit_aarch64.c, lib/jit_alpha.c,
754 lib/jit_arm.c, lib/jit_hppa.c,
755 lib/jit_ia64.c, lib/jit_mips.c,
756 lib/jit_ppc.c, lib/jit_s390.c,
757 lib/jit_sparc.c, lib/jit_x86.c: Remove jit_arg_reg_p and
758 jit_arg_f_reg_p from a public header, and define it only
759 on port specific files where an integer offset is used
760 to qualify an argument identifier. Exported code expects
761 an opaque pointer (but of jit_node_t* type) to "qualify"
762 an argument identifier.
763 This patch, and the code review/simplification done during
764 it also corrected some bugs:
765 o Inconsistent jit_arg_d value of double argument after 3
766 integer arguments in arm for jit_functions; tested, C
767 functions were being properly called.
768 o Inconsistent use of getarg_{f,d} and putarg*_{f,d} on
769 s390 (32-bit) that happened to not have a proper test
770 case, as it would only happen for jit functions, and
771 tested, called C functions had proper arguments.
772 o Corrected a "last minute" correction that did not go
773 to the committed version, and would not compile on hppa,
774 due to bad _jit_putargi_d prototype definition.
775
7762015-01-17 Paulo Andrade <pcpa@gnu.org>
777
778 * doc/body.texi: Correct wrong/outdated information for
779 hton*, pusharg* and ret*, and add missing documentation
780 for rsb*, qmul*, qdvi* and putarg*.
781
7822015-01-15 Paulo Andrade <pcpa@gnu.org>
783
784 * configure.ac, lib/jit_disasm.c: Rewrite workaround
785 to apparent problem to initialize powerpc disassembler.
786
7872015-01-15 Paulo Andrade <pcpa@gnu.org>
788
789 * include/lightning.h, lib/jit_aarch64.c,
790 lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
791 lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
792 lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c:
793 Implement jit_putarg*. It works as a mix of jit_getarg*
794 and jit_pusharg*, in the way that the first argument is
795 a register or immediate, and the second is a pointer
796 returned by jit_arg*. The use of the interface is to change
797 values of arguments to the current jit function.
798
799 * check/put.ok, check/put.tst: New test cases exercising
800 the new jit_putarg* interface.
801
802 * check/Makefile.am, check/lightning.c: Update for the
803 new test case and interface.
804
8052015-01-08 Paulo Andrade <pcpa@gnu.org>
806
807 * include/lightning/jit_s390.h, lib/jit_s390-cpu.c,
808 lib/jit_s390-fpu.c, lib/jit_s390-sz.c, lib/jit_s390.c:
809 Renamed s390x* files to s390*.
810
811 * check/float.tst, check/lightning.c, configure.ac,
812 include/lightning.h, include/lightning/Makefile.am,
813 lib/Makefile.am, lib/jit_s390.c, lib/jit_size.c,
814 lib/lightning.c: Update for renamed files.
815
8162015-01-08 Paulo Andrade <pcpa@gnu.org>
817
818 * include/lightning.h, include/lightning/jit_private.h,
819 include/lightning/jit_s390x.h, lib/jit_disasm.c,
820 lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
821 lib/jit_s390x.c, lib/jit_size.c, lib/lightning.c:
822 Add support for generating jit for s390 32 bit. This change
823 also removed %f15 from the list of temporaries fpr registers;
824 it was not being used, but if were, it would corrupt the
825 stack frame because the spill address would overwrite grp
826 offsets.
827
8282014-12-26 Paulo Andrade <pcpa@gnu.org>
829
830 * lib/jit_ppc-cpu.c, lib/jit_ppc.c: Correct some endianess issues
831 on the powerpc le backend.
832
8332014-12-26 Paulo Andrade <pcpa@gnu.org>
834
835 * lib/jit_ppc-cpu.c: Add mcrxr instruction emulation,
836 as this instruction has been phased out, and should be
837 implemented as a kernel trap.
838
8392014-12-26 Paulo Andrade <pcpa@gnu.org>
840
841 * lib/jit_arm.c: Better check for need to flush constants
842 before the pool being no longer reachable.
843
8442014-12-25 Paulo Andrade <pcpa@gnu.org>
845
846 * include/lightning.h: Split jit_htonr in the new 3 interfaces
847 jit_htonr_us, jit_htonr_ui and jit_htonr_ul, the later only
848 available on 64 bit. The plain/untyped jit_htonr macro call
849 maps to the wordsize one.
850 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
851 lib/jit_alpha-cpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c,
852 lib/jit_arm-cpu.c, lib/jit_arm-sz.c, lib/jit_arm.c,
853 lib/jit_hppa-cpu.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
854 lib/jit_ia64-cpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
855 lib/jit_mips-cpu.c, lib/jit_mips-sz.c, lib/jit_mips.c,
856 lib/jit_ppc-cpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
857 lib/jit_s390x-cpu.c, lib/jit_s390x-sz.c, lib/jit_s390x.c,
858 lib/jit_sparc-cpu.c, lib/jit_sparc-sz.c, lib/jit_sparc.c,
859 lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c:
860 Update backends for the new jit_htonr*.
861 * check/lightning.c, lib/jit_names.c, lib/lightning.c:
862 Update for the new jit_htonr* interfaces.
863 * check/Makefile.am: Update for new test cases.
864 * check/hton.ok, check/hton.tst: New test cases.
865
8662014-12-24 Paulo Andrade <pcpa@gnu.org>
867
868 * include/lightning/jit_private.h, include/lightning/jit_x86.h,
869 lib/jit_disasm.c, lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
870 lib/jit_x86-sz.c, lib/jit_x86-x87.c, lib/jit_x86.c,
871 size.c: Implement support for the x32 abi. Built and
872 tested on Gentoo default/linux/amd64/13.0/x32 profile.
873
8742014-12-24 Paulo Andrade <pcpa@gnu.org>
875
876 * lib/jit_names.c: Add missing rsbi_f and rsbi_d strings.
877
8782014-12-21 Paulo Andrade <pcpa@gnu.org>
879
880 * lib/jit_arm.c: Call __clear_cache for every page.
881 This should only be required for older boards or
882 toolchain setup, but has been reported to be required
883 for lightning at some point.
884
8852014-12-21 Paulo Andrade <pcpa@gnu.org>
886
887 * lib/jit_arm.c: Correct check to guard overflow of index
888 of constants from program counter.
889
8902014-11-24 Paulo Andrade <pcpa@gnu.org>
891
892 * lib/lightning.c: Remove an optimization to calee save
893 registers that may incorrectly remove a jit_movr under
894 special conditions.
895
8962014-11-20 Paulo Andrade <pcpa@gnu.org>
897
898 * include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c,
899 lib/jit_ppc.c: Add initial powerpc le support.
900
9012014-11-20 Paulo Andrade <pcpa@gnu.org>
902
903 * lib/jit_disasm.c: Change thumb or arm disassemble based on
904 jit code before disassembly.
905
906 * lib/jit_arm-cpu.c: Correct reversed arguments to LDRD and
907 STRD instructions, and correct checking for support of those.
908
909 * lib/jit_arm-swf.c: Correct wrong use of LDRD and STRD and
910 only use those if the register is even.
911
912 * check/check.arm.swf.sh, check/check.arm4.swf.sh: New files
913 to test LDRD and STRD, as well as the alternate code path
914 when those are not available, in the .arm4. test case.
915
916 * check/Makefile.am: Update for the new test cases.
917
9182014-11-08 Paulo Andrade <pcpa@gnu.org>
919
920 * include/lightning/jit_private.h, lib/jit_aarch64.c,
921 lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
922 lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
923 lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c:
924 Implement a private jit_flush call, that flushes
925 the cache, if applicable, aligning down to the
926 previous and up to the next page boundary.
927
9282014-11-08 Paulo Andrade <pcpa@gnu.org>
929
930 * check/ctramp.c: New file. It just repeats the test
931 of tramp.tst, but using two jit_state_t, what should
932 test possible issues with two contexts, and also validate
933 jit_tramp works on backends with function descriptions.
934
935 * check/Makefile.am: Update for new test case.
936
9372014-11-03 Paulo Andrade <pcpa@gnu.org>
938
939 * include/lightning/jit_mips.h: Do not make the t9 register
940 JIT_R11 (or JIT_R7 for n32 or n64 abi) available. Previously
941 it cause problems if one expects it to not be changed in a
942 function call. For example, calling a jit function, where it
943 really does not need to be changed.
944
9452014-10-26 Paulo Andrade <pcpa@gnu.org>
946
947 * lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
948 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
949 lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Add an
950 assertion to all code generation "drivers" to ensure
951 _jitc->regarg is empty or in an expected state, after
952 translation of a lightning instruction to native code.
953 This change was a brute force test to find out other cases
954 of a temporary not being release (like was happening with
955 _bmsi and _bmci on x86), but no other case was found,
956 after running make check, with assertions enabled, on all
957 backends.
958
9592014-10-26 Paulo Andrade <pcpa@gnu.org>
960
961 * lib/jit_x86-cpu.c: Correct a register allocation leak in
962 _bmsi and _bmci.
963
9642014-10-25 Paulo Andrade <pcpa@gnu.org>
965
966 * lib/jit_disasm.c: Do not cause an fatal error if init_jit
967 fails in the jit_init_debug call.
968
9692014-10-24 Paulo Andrade <pcpa@gnu.org>
970
971 * lib/jit_ia64.c, lib/jit_ppc.c: Correct handling of function
972 descriptor when first prolog is a jit_tramp prolog. The
973 test case was using the same jit_context_t, so was not
974 triggering this condition.
975
976 * lib/jit_ppc-cpu.c: Properly handle jump displacements that
977 do not fit on 24 powerpc. This required changing from previous
978 "mtlr reg, blr" to "mtctr reg, bctr" to properly handle
979 the logic to "hide" function descriptors, but that would
980 also be required as the proper jit_jmpr when/if implementing
981 optimizations to leaf functions (was working with blr because
982 it is saved/reloaded in prolog/epilog).
983
9842014-10-21 Paulo Andrade <pcpa@gnu.org>
985
986 * include/lightning.h, lib/lightning.c: Add three predicates
987 to query information about labels. jit_forward_p(label)
988 will return non zero if the label is "forward", that is
989 need a call to jit_link(label), jit_indirect_p(label)
990 that returns non zero if the label was created with the
991 jit_indirect() call, and jit_target_p(label) that will
992 return non zero if there is at least one jump patched
993 to land at that label.
994
9952014-10-18 Paulo Andrade <pcpa@gnu.org>
996
997 * check/range.ok, check/range.tst: New test case designed
998 to catch incorrect code generation, usually due to incorrect
999 test of immediate size. The test checks a large amount of
1000 encodings in "power of two" boundaries. This test exorcises
1001 a significant amount of code paths that was previously not
1002 tested.
1003
1004 * check/Makefile.am: Add range test to make check target.
1005
1006 * lib/jit_aarch64-cpu.c: Correct wrong address calculation
1007 for stxi_c, stxi_s, stxi_i and stxi_l when the offset is
1008 too large.
1009
1010 * lib/jit_mips-fpu.c: Correct wrong size test to check if
1011 an immediate can be encoded in a float or double store.
1012
1013 * lib/jit_s390x-cpu.c: Correct inverted encoding to stxi_s
1014 when the offset cannot be encoded, and fallbacks to an
1015 alternate encoding in 2 instructions.
1016
10172014-10-17 Paulo Andrade <pcpa@gnu.org>
1018
1019 * check/alu_rsb.ok, check/alu_rsb.tst: New files implementing
1020 tests for jit_rsb*.
1021
1022 * check/Makefile.am, check/lightning.c, include/lightning.h,
1023 lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c, lib/jit_aarch64-sz.c,
1024 lib/jit_aarch64.c, lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c,
1025 lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_arm-cpu.c,
1026 lib/jit_arm-swf.c, lib/jit_arm-sz.c, lib/jit_arm-vfp.c,
1027 lib/jit_arm.c, lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
1028 lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-cpu.c,
1029 lib/jit_ia64-fpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
1030 lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips-sz.c,
1031 lib/jit_mips.c, lib/jit_names.c, lib/jit_ppc-cpu.c,
1032 lib/jit_ppc-fpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
1033 lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
1034 lib/jit_s390x.c, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
1035 lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-cpu.c,
1036 lib/jit_x86-sse.c, lib/jit_x86-sz.c, lib/jit_x86-x87.c,
1037 lib/jit_x86.c, lib/lightning.c: Implement jit_rsb*. This
1038 was a missing lightning 1.x interface, that on most
1039 backends is synthesized, but on a few backends (hppa and ia64),
1040 it can generate better code as on those there is, or the
1041 only instruction with an immediate is in "rsb" format
1042 (left operand).
1043
10442014-10-17 Paulo Andrade <pcpa@gnu.org>
1045
1046 * lib/jit_names.c: New file with single definition of string
1047 representation of lightning IR codes.
1048
1049 * size.c: Modified to append the code name in a C comment
1050 after the maximum instruction size.
1051
1052 * lib/jit_print.c: Minor change to not duplicate jit_names.c
1053 contents.
1054
1055 * lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_arm-sz.c,
1056 lib/jit_hppa-sz.c, lib/jit_ia64-sz.c, lib/jit_mips-sz.c,
1057 lib/jit_ppc-sz.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
1058 lib/jit_x86-sz.c: Rewritten to add string representation of
1059 IR codes in a C comment.
1060
10612014-10-14 Paulo Andrade <pcpa@gnu.org>
1062
1063 * lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
1064 lib/jit_hppa-cpu.c, lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c,
1065 lib/jit_sparc-cpu.c: Implement or correct the internal
1066 nop(count) call that receives an argument that tells the
1067 modulo bytes to align the code for the next instruction.
1068
1069 * include/lightning.h, lib/lightning.c, lib/jit_aarch64.c,
1070 lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c,
1071 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
1072 lib/jit_x86.c: Implement the new jit_align() call that receive
1073 an argument, that tells the modulo, in bytes, to align the
1074 next instruction. In most backends the only value that makes
1075 a difference is a value that matches sizeof(void*), as all
1076 other values usually are already automatically aligned in
1077 labels, but not guaranteed to be aligned at word size bytes.
1078
1079 * check/align.ok, check/align.tst: New files, implementing
1080 a simple test for the new jit_align() interface.
1081
1082 * check/Makefile.am, check/lightning.c, lib/jit_aarch64-sz.c,
1083 lib/jit_alpha-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
1084 lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
1085 lib/jit_print.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
1086 lib/jit_x86-sz.c: Update for the new jit_code_align code and
1087 the jit_align() interface.
1088
10892014-10-13 Paulo Andrade <pcpa@gnu.org>
1090
1091 * include/lightning.h, lib/jit_size.c, size.c: Use a
1092 symbolic value for the last IR code.
1093
10942014-10-12 Paulo Andrade <pcpa@gnu.org>
1095
1096 * include/lightning.h, include/lightning/jit_private.h,
1097 lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
1098 lib/jit_hppa-cpu.c, lib/jit_ia64-cpu.c, lib/jit_mips-cpu.c,
1099 lib/jit_ppc-cpu.c, lib/jit_s390x-cpu.c, lib/jit_sparc-cpu.c,
1100 lib/jit_x86-cpu.c, lib/lightning.c: Implement the new
1101 jit_frame and jit_tramp interfaces, that allow writing
1102 trampoline like calls, where a single dispatcher jit buffer
1103 is written, and later other jit buffers are created, with
1104 the same stack frame layout as the dispatcher. This is the
1105 logic that GNU Smalltalk used in lightning 1.x, and is required
1106 to make a sane port for lighting 2.x.
1107
1108 * jit_ia64-cpu.c: Implement support for jit_frame and jit_tramp,
1109 and also correct wrong encoding for B4 instructions, that
1110 implement jmpr, as well as correct reverse logic in _jmpr,
1111 that was moving the branch register to the jump register,
1112 and not vice-versa.
1113 Also, if a stack frame is to be assumed, always assume it may
1114 call a function with up to 8 arguments, regardless of the
1115 hint frame argument.
1116
1117 * lib/jit_arm.c: Add a new must_align_p() interface to ensure
1118 function prologs are always aligned. This condition was
1119 previously always true, somewhat by accident, but with
1120 jit_tramp it is not guaranteed.
1121
1122 * jit_ia64-cpu.c: lib/jit_ppc.c: Add minor special handling
1123 required to implement jit_tramp, where a function descriptor
1124 should not be added before a prolog, as jit_tramp means omit
1125 prolog.
1126
1127 * check/lightning.c: Update test driver for the new interfaces.
1128
1129 * check/Makefile.am, check/tramp.tst, check/tramp.ok: Add
1130 a simple test and example of the jit_frame and jit_tramp
1131 usage implementing a simple Fibonacci function using a
1132 simulation of an interpreter stack and how it would handle
1133 state in language specific variables.
1134
1135 * doc/body.texi: Add documentation for jit_frame and
1136 jit_tramp.
1137
11382014-09-29 Paulo Andrade <pcpa@gnu.org>
1139
1140 * lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
1141 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
1142 lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
1143 lib/jit_x86.c, lib/lightning.c: Allow jit_jmpi on a
1144 target that is not a node. This may lead to hard to
1145 debug code generation, but is a required feature for
1146 certain generators, like the ones that used lightning
1147 1.2x. Note that previously, but not really well
1148 documented, it was instructed to use:
1149 jit_movi(rn, addr); jit_jmpr(rn);
1150 but now, plain:
1151 jit_patch_abs(jit_jmpi(), addr);
1152 should also work.
1153
11542014-09-24 Paulo Andrade <pcpa@gnu.org>
1155
1156 * lib/jit_x86-sz.c: Generate information about instruction
1157 lengths for more precise calculation of buffer size on
1158 Windows x64. This change is specially important because
1159 the maximum instruction length is larger than other
1160 systems, what could cause an out of bounds write on
1161 special conditions without this update.
1162
11632014-09-24 Paulo Andrade <pcpa@gnu.org>
1164
1165 * check/lightning.c: Add workaround to conflicting global
1166 optind variable in cygwin binutils that have an internal
1167 getopt* implementation.
1168
1169 * lib/jit_x86-cpu.c: Add a simple define ffsl ffs if building
1170 for 32 bit and there is no ffsl function.
1171
11722014-09-24 Paulo Andrade <pcpa@gnu.org>
1173
1174 * check/lightning.c: Add a hopefully temporary kludge to not use
1175 sprintf and sscanf returned by dlsym. This is required to pass
1176 the varargs test.
1177
1178 * include/lightning/jit_private.h: Use symbolic name for first
1179 integer register argument, as this is different in sysv and
1180 win64 abi.
1181
1182 * include/lightning/jit_x86.h: Add conditionals and definitions
1183 for Windows x64 (under __CYGWIN__ preprocessor conditional).
1184
1185 * lib/jit_x86-cpu.c: Correct one instruction encoding bug, that
1186 was working by accident. Only use rax to rdx for some byte
1187 operations to work on compatibility mode (that is, to generate
1188 the proper encoding, instead of actually generating encoding
1189 for high byte registers, e.g. %bh).
1190 Add proper prolog and epilog for windows x64.
1191
1192 * lib/jit_x86-sse.c: Correct a swapped rex prefix for float
1193 operations.
1194
1195 * lib/jit_x86.c: Adjust to support Windows x64 abi.
1196
1197 * check/check.x87.nodata.sh: New file, previously used but that
1198 was missing git.
1199
12002014-09-07 Paulo Andrade <pcpa@gnu.org>
1201
1202 * lib/lightning.c: Mark all registers advertised as live, as
1203 per jit_callee_save_p as live whenever reaching a jump that
1204 cannot be tracked. This is a rethink of the previous commit,
1205 and is a better approach, otherwise there would not be much
1206 sense on relying on jit_callee_save_p if it could not be
1207 trusted.
1208
1209 * check/jmpr.tst, check/jmpr.ok: New files implementing a very
1210 simple test case, that would actually cause an assertion on
1211 code before the change to only mark as live when reaching a
1212 jump that could not tracked, the actually advertised as callee
1213 save registers.
1214
1215 check/Makefile.am: Update for new jmpr test case.
1216
12172014-09-01 Paulo Andrade <pcpa@gnu.org>
1218
1219 * lib/lightning.c: Do not mark all registers in unknown state
1220 as live on jit_jmpr, or jit_jmpi to an absolute address. Instead,
1221 treat it as a function call, and only consider JIT_Vn registers
1222 as possibly live.
1223
12242014-08-29 Paulo Andrade <pcpa@gnu.org>
1225
1226 * doc/body.texi: Add a proper info menu entry for
1227 GNU lightning.
1228
1229 * doc/version.texi: Regenerate.
1230
12312014-08-16 Paulo Andrade <pcpa@gnu.org>
1232
1233 * lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
1234 lib/jit_arm-cpu.c, lib/jit_arm-vfp.c,
1235 lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
1236 lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c,
1237 lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
1238 lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c,
1239 lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c,
1240 lib/jit_s390x.c, lib/jit_sparc-cpu.c,
1241 lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
1242 lib/jit_x86-x87.c: Review generation of all branch
1243 instructions and always adds the jit_class_nospill
1244 bitfield for temporary registers that cannot be spilled
1245 because the reload would be after a conditional jump; the
1246 patch only adds an extra assertion. These conditions do
1247 not happen on documented lightning usage, but can happen
1248 if one uses the not exported jit_get_reg and jit_unget_reg
1249 calls and cause enough register starvation.
1250
12512014-08-16 Paulo Andrade <pcpa@gnu.org>
1252
1253 * lib/jit_alpha.c: Correct wrong bitmask of most argument
1254 float register arguments, that were being set as callee
1255 save instead of argument registers class.
1256
12572014-08-16 Paulo Andrade <pcpa@gnu.org>
1258
1259 * lib/jit_arm-sz.c: Regenerate table of known maximum
1260 instruction sizes for the software float fallback,
1261 that implements "virtual" float registers in the stack
1262 and operations as calls to libgcc.
1263
1264 * size.c: Correct typo in the generated jit_arm-sz.c file.
1265
12662014-08-10 Paulo Andrade <pcpa@gnu.org>
1267
1268 * include/lightning/jit_alpha.h, lib/jit_alpha-cpu.c,
1269 lib/jit_alpha-fpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c:
1270 New files implementing a lightning Alpha port. Thanks
1271 to Trent Nelson and snakebit.net staff for providing access
1272 to an Alpha system.
1273
1274 * check/float.tst, check/lightning.c, configure.ac,
1275 include/lightning.h, include/lightning/Makefile.am,
1276 include/lightning/jit_private.h, lib/Makefile.am,
1277 lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
1278 Minor changes to adapt for the new Alpha port.
1279
12802014-08-10 Paulo Andrade <pcpa@gnu.org>
1281
1282 * lib/lightning.c: Always mark JIT_RET and JIT_FRET as
1283 live in a function epilog. This is required because
1284 on some ports a complex sequence, allocating one or more
1285 registers, may be required to jump from a ret* to the
1286 epilog, and the lightning api does not have annotations
1287 to know if a function returns a value, or the type of
1288 the return value.
1289
12902014-08-10 Paulo Andrade <pcpa@gnu.org>
1291
1292 * lib/lightning.c: Change the correct live bitmask of
1293 return registers after a function call in jit_update.
1294
12952014-08-10 Paulo Andrade <pcpa@gnu.org>
1296
1297 * lib/lightning.c: Change assertions to have an int
1298 result and correct a bad bit mask assertion.
1299
13002014-08-10 Paulo Andrade <pcpa@gnu.org>
1301
1302 * lib/jit_aarch64.c: Correct bad setup for assertion
1303 of consistency before a patch.
1304
13052014-08-10 Paulo Andrade <pcpa@gnu.org>
1306
1307 * lib/jit_mips-cpu.c: Correct typo in the jit_bmsr
1308 implementation that was using the wrong test result
1309 register.
1310
13112014-07-28 Paulo Andrade <pcpa@gnu.org>
1312
1313 * lib/jit_memory.c: Do not call free on NULL pointers.
1314
1315 * include/lightning/jit_private.h, lib/jit_note.c,
1316 lib/lightning.c: Add a wrapper to memcpy and memmove
1317 to not actually call those functions with a zero size
1318 argument, and likely also a null src or dst.
1319
13202014-07-27 Paulo Andrade <pcpa@gnu.org>
1321
1322 * include/lightning/jit_private.h, lib/jit_disasm.c,
1323 lib/lightning.c: Remove the global jit_progname variable.
1324 It was being only used in jit_init_debug, that is called
1325 from init_jit, so, just pass an argument.
1326
13272014-07-27 Paulo Andrade <pcpa@gnu.org>
1328
1329 * doc/body.texi: Add note that jit_set_memory_functions
1330 should be called before init_jit, because init_jit
1331 itself may call the memory wrappers.
1332
13332014-04-22 Paulo Andrade <pcpa@gnu.org>
1334
1335 * lib/jit_arm.c: Do not get confused with default settings
1336 if /proc is not mounted on Linux specific code path.
1337
13382014-04-09 Paulo Andrade <pcpa@gnu.org>
1339
1340 * include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
1341 include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
1342 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
1343 include/lightning/jit_private.h, include/lightning/jit_s390x.h,
1344 include/lightning/jit_sparc.h, include/lightning/jit_x86.h:
1345 Do not add jit_regset_t, JIT_RA0, and JIT_FA0 to the installed
1346 header file. These types and definitions are supposed to be
1347 only used internally.
1348
13492014-04-05 Paulo Andrade <pcpa@gnu.org>
1350
1351 * lib/jit_arm-cpu.c: Only adjust stack pointer in prolog if
1352 need stack space, that is, do not emit a nop instruction
1353 subtracting zero from the stack pointer.
1354
13552014-04-04 Paulo Andrade <pcpa@gnu.org>
1356
1357 * lib/jit_disasm.c: Correct a crash in the doc/printf example
1358 on arm due to releasing the data_info information in
1359 jit_clear_state. This is a special case for arm only, and
1360 actually, only armv5 or older uses the data_info buffer,
1361 or when forcing arm instruction set mode besides thumb
1362 available.
1363
13642014-12-03 Paulo Andrade <pcpa@gnu.org>
1365
1366 * doc/body.texi: Write detailed description and examples for
1367 jit_get_memory_functions, jit_set_memory_functions,
1368 jit_get_code, jit_set_code, jit_get_data and jit_set_data.
1369
13702014-12-03 Paulo Andrade <pcpa@gnu.org>
1371
1372 * include/lightning.h, include/lightning/jit_private.h,
1373 lib/lightning.c: Implement the new jit_set_data() interface,
1374 and the new jit_get_data() helper. Like jit_set_code(),
1375 jit_realize() should be called before jit_set_data().
1376 The most common usage should be jit_set_data(JIT_DISABLE_DATA
1377 | JIT_DISABLE_NOTE), to force synthesize any float/double
1378 constant in the stack and not generate any debug information.
1379
1380 * lib/jit_note.c: Minor change to debug note generation as
1381 now it uses an alternate temporary data buffer during constants
1382 and debug generation to accommodate the possibility of the user
1383 setting an alternate data buffer.
1384
1385 * lib/jit_hppa-fpu.c, lib/jit_s390x.c, lib/jit_s390x-cpu.c,
1386 lib/jit_s390x-fpu.c, lib/jit_sparc.c, lib/jit_sparc-fpu.c,
1387 lib/jit_x86-sse.c, lib/jit_x86-x87.c: Implement jit_set_data.
1388
1389 * lib/jit_hppa-sz.c, lib/jit_sparc-sz.c, lib/jit_x86-sz.c,
1390 lib/jit_s390x-sz.c: Update for several instructions that now
1391 have a different maximum length due to jit_set_data.
1392
1393 * lib/jit_mips-fpu.c: Implement jit_set_data, but missing
1394 validation on n32 and n64 abis (and/or big endian).
1395
1396 * lib/jit_mips-sz.c: Update for changes in o32.
1397
1398 * lib/jit_ppc-fpu.c: Implement jit_set_data, but missing
1399 validation on Darwin PPC.
1400
1401 * lib/jit_ppc-sz.c: Update for changes in powerpc 32 and
1402 64 bit.
1403
1404 * lib/jit_ia64-fpu.c: Implement untested jit_set_data.
1405
1406 * TODO: Add note to list ports that were not tested for the
1407 new jit_set_data() feature, due to no longer having access
1408 to them.
1409
1410 * check/nodata.c: New file implementing a simple test exercising
1411 several different conditions created by jit_set_data().
1412
1413 * check/check.nodata.sh: New file implementing a wrapper
1414 over the existing *.tst files, that runs all tests without
1415 using a data buffer for constants; only meaningful (and
1416 enabled) on architectures that used to store float/double
1417 constants on a read only data buffer.
1418
1419 * configure.ac, check/Makefile.am: Update for the new test
1420 cases.
1421
1422 * check/lightning.c: Implement the new "-d" option that
1423 sets an internal flag to call jit_set_data() disable
1424 constants and debug, that is, using only a pure code
1425 buffer.
1426
14272014-11-03 Paulo Andrade <pcpa@gnu.org>
1428
1429 * include/lightning.h, include/lightning/jit_private.h,
1430 lib/lightning.c: Implement the new jit_set_code() interface,
1431 that allows instructing lightning to use an alternate code
1432 buffer. The new jit_realize() function should be called
1433 before jit_set_code(), and usually call jit_get_code()
1434 to query the amount of bytes expected to be required for
1435 the code.
1436
1437 * lib/jit_size.c: Minor update to have less chances of
1438 miscalculating the code buffer by starting the counter
1439 with the size of the longest instruction instead of zero,
1440 as code emit fails if at any moment less than the longest
1441 instruction bytes are available.
1442
1443 * check/setcode.c: New file implementing some basic tests
1444 of the new jit_set_code() interface.
1445
1446 * check/Makefile.am: Update for newer test case.
1447
14482014-06-03 Paulo Andrade <pcpa@gnu.org>
1449
1450 * include/lightning.h, lib/lightning.c: Add the new
1451 jit_indirect() call, that returns a special label node,
1452 and tells lightning that the label may be the target of
1453 an indirect jump.
1454
1455 * doc/body.texi: Document the new jit_indirect() call, and
1456 add examples of different ways to create labels and branches.
1457
14582014-23-02 Paulo Andrade <pcpa@gnu.org>
1459
1460 * lib/jit_x86.c: Rewrite previous patch to inline save/restore
1461 because clobbering %ebx in x86 is treated as an error
1462 (jit_x86.c:239:5: error: PIC register clobbered by 'ebx' in 'asm').
1463
14642014-19-02 Paulo Andrade <pcpa@gnu.org>
1465
1466 * lib/jit_x86.c: Rewrite incorrect inline assembly that could
1467 truncate a variable in a callee save register. Now it simply
1468 tells gcc that the register is clobbered, instead of using a
1469 *32 bit* swap with a temporary variable. The problem only
1470 happens when compiling with optimization.
1471
14722014-19-02 Paulo Andrade <pcpa@gnu.org>
1473
1474 * include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
1475 include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
1476 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
1477 include/lightning/jit_s390x.h, include/lightning/jit_sparc.h,
1478 include/lightning/jit_x86.h: Change jit_regset_t to an
1479 unsigned type, to allow safe right shift.
1480
1481 * lib/lightning.c: Rewrite jit_regset_scan1 to allow easier
1482 compiler optimization.
1483
14842013-12-03 Paulo Andrade <pcpa@gnu.org>
1485
1486 * lib/jit_x86-x87.c: Correct wrong optimization when
1487 loading the log(2) constant.
1488
14892013-12-03 Paulo Andrade <pcpa@gnu.org>
1490
1491 * lib/jit_x86-cpu.c: Use the emms instruction before
1492 calling any function. This is particularly important
1493 when using c99 complex functions as it can easily
1494 overflow the x87 stack due to the way lightning uses
1495 the x87 stack as a flat register file.
1496
14972013-12-02 Paulo Andrade <pcpa@gnu.org>
1498
1499 * lib/jit_x86-x87.c: Correct wrong code generation due
1500 to comparing the base and not the value register with
1501 %st(0) in stxi_f.
1502
15032013-12-02 Paulo Andrade <pcpa@gnu.org>
1504
1505 * lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
1506 stack offset for float/double x87 to/from sse move.
1507
15082013-11-27 Paulo Andrade <pcpa@gnu.org>
1509
1510 * configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
1511 changes that should at least allow building lightning
1512 on Apple iOS7.
1513
15142013-10-08 Paulo Andrade <pcpa@gnu.org>
1515
1516 * lib/jit_ppc-cpu.c: Correct wrong shortcut for ldxi_l with
1517 a zero offset, that was calling ldr_i instead of ldr_l.
1518
15192013-10-08 Paulo Andrade <pcpa@gnu.org>
1520
1521 * include/lightning/jit_arm.h, lib/jit_arm-cpu.c: Do not use
1522 by default load/store instructions that map to ldrt/strt.
1523 There is already the long displacement version for positive
1524 offsets, and when using a (shorter) negative offset it does
1525 not map to ldrt/strt. At least on qemu strt may cause
1526 reproducible, but unexpected SIGILL.
1527
15282013-10-08 Paulo Andrade <pcpa@gnu.org>
1529
1530 * lib/jit_arm-vfp.c: Correct wrong load/store offset
1531 calculation when the displacement is constant but too
1532 large to use an instruction with an immediate offset.
1533
15342013-10-07 Paulo Andrade <pcpa@gnu.org>
1535
1536 * check/self.c: Extend tests to validate jit_callee_save_p
1537 does not cause an assertion on valid arguments, and test
1538 extra registers defined on some backends.
1539
1540 * configure.ac: Do not ignore environment CFLAGS when
1541 checking if need to test runtime configurable options,
1542 like use x87 when sse2 is available, arm instruction set
1543 instead of thumb, etc.
1544
1545 * include/lightning/jit_arm.h: Correct wrong jit_f macro
1546 definition.
1547
519a9ea1 1548 * include/lightning/jit_ia64.h, include/lightning/jit_ppc.h:
4a71579b
PC
1549 Correct wrong jit_r macro definition.
1550
1551 * lib/jit_x86-x87.c, lib/jit_x86.c: Actually use the
1552 reserved stack space for integer to/from float conversion.
1553 The stack space was also changed to ensure it is 8 bytes
1554 aligned. Also, for Solaris x86 in 32 bit mode, an alternate
1555 truncr_d was implemented because for some reason it is
1556 failing with SIGILL if using the "fisttpl" instructions,
1557 that must be available on p6 or newer, but for the sake of
1558 making all tests pass, implement a 486 or newer sequence
1559 if "sun" is defined.
1560
15612013-10-03 Paulo Andrade <pcpa@gnu.org>
1562
1563 * include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
1564 lib/jit_mips-sz.c, lib/jit_mips.c, size: Build and
1565 pass all test cases on Irix big endian mips using
1566 the 64 bit abi.
1567
15682013-10-02 Paulo Andrade <pcpa@gnu.org>
1569
1570 * include/lightning/jit_mips.h: Add proper mips abi detection.
1571
15722013-09-30 Paulo Andrade <pcpa@gnu.org>
1573
1574 * lib/jit_print.c: Do not crash if calling jit_print from
1575 gdb before actually emitting code.
1576
1577 * lib/lightning.c: Correct misplaced check for already
1578 visited blocks on conditional branches, what was preventing
1579 proper merge live bit masks of forward blocks.
1580
15812013-09-30 Paulo Andrade <pcpa@gnu.org>
1582
1583 * lib/jit_x86-cpu.c: Correct not properly tested case of using
1584 %r12 as index register, what was causing an invalid assertion.
1585 %r12 is mapped to the "extra" JIT_R3 register, and test cases
1586 only test "standard" lightning registers.
1587
15882013-09-28 Paulo Andrade <pcpa@gnu.org>
1589
1590 * lib/jit_ia64.c: Minor change to force collecting the maximum
1591 instruction length in the --enable-devel-get-jit-size build
1592 mode. The actual generated file did not change because the
1593 sampling was large enough that it had already collected proper
1594 information in the previously slightly buggy code (not forcing
1595 a sync of the instructions that could be combined).
1596
15972013-09-27 Paulo Andrade <pcpa@gnu.org>
1598
1599 * lib/jit_arm.c: Correct build when disassembler is
1600 disabled.
1601
16022013-09-25 Paulo Andrade <pcpa@gnu.org>
1603
1604 * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
1605 off by one range checks (that were only accepting values
1606 one less than the maximum allowed) and an invalid test
1607 condition check that was forcing it to always use
1608 indirect jumps even when reachable with an immediate
1609 displacement.
1610
16112013-09-24 Paulo Andrade <pcpa@gnu.org>
1612
1613 * lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
1614 lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
1615 lib/jit_s390x-sz.c, lib/jit_size.c, lib/jit_sparc-sz.c,
1616 lib/jit_x86-sz.c: New files implementing static tables
1617 with longest known instructions length generated to match
1618 a lightning instruction. These tables should make it easier
1619 to make it very unlikely to ever miscalculate, or by too
1620 much, the size of a code buffer.
1621
1622 * lib/jit_size.c: New file that aids to either collect
1623 jit code size information, or use the information depending
1624 on build options.
1625
1626 * size.c: New helper file that parses input for, and create
1627 an initial jit_$arch-sz.c file, that needs some minor edit
1628 for arches with multiple configurations.
1629
1630 * configure.ac, Makefile.am: Add the new, devel mode only
1631 --enable-devel-get-jit-size configure option, that sets
1632 compile time flags to collect jit code size information,
1633 that will be used as input for the "noinst size program".
1634
1635 * lib/jit_aarch64.c, lib/jit_arm.c, lib/jit_disasm.c,
1636 lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_memory.c,
1637 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c,
1638 lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c: Minor
1639 changes for the --enable-devel-get-jit-size build mode,
1640 as well as the "production build mode" with jit code
1641 size information.
1642
16432013-09-14 Paulo Andrade <pcpa@gnu.org>
1644
1645 * include/lightning.h, lib/lightning.c: Add the new
1646 jit_pointer_p interface, that returns a boolean value
1647 telling if the pointer argument is inside the jit
1648 code buffer. This is useful to avoid the need to add
1649 extra labels and calls to jit_address to figure bounds
1650 of code buffer, and still keep internal data private.
1651
16522013-09-13 Paulo Andrade <pcpa@gnu.org>
1653
1654 * include/lightning.h, include/lightning/jit_private.h,
1655 lib/jit_note.c: Change the code argument of jit_get_note
1656 to a jit_pointer_t and make jit_get_note a public interface.
1657 It was intended so since start, as a way to map an offset
1658 in the code to a function name, file name and line number
1659 mapping.
1660
16612013-09-11 Paulo Andrade <pcpa@gnu.org>
1662
1663 * doc/body.texi: Correct reversed arguments in example of
1664 usage in a (possibly) multi threaded, multiple jit_state_t
1665 environments.
1666
1667 * include/lightning/jit_arm.h, include/lightning/jit_private.h,
1668 lib/jit_arm-cpu.c, lib/jit_arm.c: Make a previously, non
1669 documented, global state private to the related jit_state_t
1670 generating code.
1671
16722013-09-10 Paulo Andrade <pcpa@gnu.org>
1673
1674 * check/self.c, check/self.ok: New files implementing simple
1675 consistency check assertions. At first validating some macros
1676 that use values from different sources agree.
1677
1678 * check/Makefile.am: Update for the new test case.
1679
1680 * include/lightning.h, lib/lightning.c: Add the new
1681 jit_callee_save_p() call, that is intended to be used when
1682 writing complex code using lightning, so that one does not
1683 need to verify what backend is being used, or have access to
1684 private data, to query if a register is callee save or not;
1685 on several backends the scratch registers are actually callee
1686 save.
1687
1688 * include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
1689 include/lightning/jit_hppa.h, include/lightning/jit_mips.h,
1690 include/lightning/jit_ppc.h, include/lightning/jit_sparc.h,
1691 include/lightning/jit_x86.h: Add an explicit definition for
1692 JIT_R3-JIT_Rn, JIT_V3-JIT_Vn and JIT_F6-JIT_Fn when applicable.
1693 This allows one to write code based on "#if defined(JIT_XN)"
1694 and therefore, not need to check what is the current backend
1695 or have access to private data structures. This is particularly
1696 useful when writing virtual machines with several specialized,
1697 global registers.
1698
1699 * lib/jit_ia64.c: Properly flag the callee save general
1700 purpose registers as such, so that jit_callee_save_p() works
1701 as intended.
1702
17032013-09-10 Paulo Andrade <pcpa@gnu.org>
1704
1705 * check/lightning.c, configure.ac: Conditionally use the
1706 code written to workaround a bug in the Hercules emulator,
1707 as isnan and isinf are not available at least on HP-UX ia64.
1708
17092013-09-10 Paulo Andrade <pcpa@gnu.org>
1710
1711 * lib/jit_s390x-cpu.c: Spill/reload correct callee save
1712 float registers.
1713
17142013-09-10 Paulo Andrade <pcpa@gnu.org>
1715
1716 * lib/jit_hppa-cpu.c: Correct code to call a function stored
1717 in a register or a patched function address.
1718
17192013-09-10 Paulo Andrade <pcpa@gnu.org>
1720
1721 * lib/jit_ia64-cpu.c: Correct incorrect logic when restoring
1722 the value of the "r2" callee save register.
1723
17242013-08-29 Paulo Andrade <pcpa@gnu.org>
1725
1726 * lib/jit_arm-cpu.c, lib/jit_arm.c: Correct wrong test and update
1727 of the thumb offset information, when checking if needing to
1728 patch a jump from arm to thumb mode. The problem would happen when
1729 remapping the code buffer, and the new address being lower than
1730 the previous one.
1731
17322013-08-26 Paulo Andrade <pcpa@gnu.org>
1733
1734 * configure.ac: Extend FreeBSD test to also handle NetBSD.
1735
1736 * lib/jit_x86-cpu.c: Correct wrongly defined offset type of
1737 ldxi_ui. Problem detected when building on NetBSD.
1738
1739 * lib/lightning.c: Adjust code to handle NetBSD mremap,
1740 where arguments do not match Linux mremap.
1741
17422013-08-26 Paulo Andrade <pcpa@gnu.org>
1743
1744 * lib/jit_ppc.c: Correct C sequence point problem miscalculating
1745 the actual function address in a function descriptor. Problem
1746 happens with gcc 4.8.1 at least.
1747
17482013-08-11 Paulo Andrade <pcpa@gnu.org>
1749
1750 * lib/jit_s390x-cpu.c: Correct code checking if immediate
1751 fits instruction, but using the negated value.
1752
17532013-07-28 Paulo Andrade <pcpa@gnu.org>
1754
1755 * include/lightning/jit_s390x.h, lib/jit_s390x-cpu.c,
1756 lib/jit_s390x-fpu.c, lib/jit_s390x.c: New files
1757 implementing the new s390x port.
1758
1759 * configure.ac, include/lightning.h,
1760 include/lightning/Makefile.am,
1761 include/lightning/jit_private.h,
1762 lib/Makefile.am, lib/jit_disasm.c, lib/lightning.c:
1763 Minor adaptation for the new s390x backend.
1764
1765 * check/float.tst: Update for the s390x result of
1766 truncating +Inf to integer.
1767
1768 * check/qalu_mul.tst: Add extra test cases to better test
1769 high word of signed multiplication as the result is
1770 adjust from unsigned multiplication on s390x.
1771
17722013-07-28 Paulo Andrade <pcpa@gnu.org>
1773
1774 * check/lightning.c: Do not assume casting a double NaN or
1775 Inf to float will produce the expected float NaN or Inf.
1776 This is not true at least under s390x.
1777
17782013-07-28 Paulo Andrade <pcpa@gnu.org>
1779
1780 * check/check.arm.sh, check/check.sh, check/check.swf.sh,
1781 check/check.x87.sh: Properly check test programs output,
1782 not just rely on the test program self testing the results
1783 and not crashing.
1784
17852013-07-28 Paulo Andrade <pcpa@gnu.org>
1786
1787 * lib/jit_aarch64.c: Remove unused macros left from cut&paste
1788 of jit_arm.c.
1789
17902013-07-16 Paulo Andrade <pcpa@gnu.org>
1791
1792 * include/lightning/jit_aarch64.h, lib/jit_aarch64-cpu.c,
1793 lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: New files
1794 implementing the new aarch64 port, as a new architecture,
1795 not as an expansion of the existing armv[4-7] port.
1796
1797 * check/lightning.c: Add aarch64 support and a small
1798 change to recognize character constants as immediate
1799 values.
1800
1801 * check/float.tst: Add aarch64 preprocessor conditionals
1802 to select proper expected value when converting [+-]Inf
1803 and NaN to integer.
1804
1805 * include/lightning/jit_arm.h, lib/jit_arm.c: Minor changes
1806 to better match the new aarch64 files.
1807
1808 * configure.ac, include/lightning.h,
1809 include/lightning/Makefile.am, include/lightning/jit_private.h,
1810 lib/Makefile.am, lib/lightning.c: Minor adjustments
1811 for the aarch64 port.
1812
18132013-07-08 Paulo Andrade <pcpa@gnu.org>
1814
1815 * NEWS, THANKS, configure.ac, doc/version.texi: Update for
1816 the 1.99a second alpha release.
1817
18182013-06-25 Paulo Andrade <pcpa@gnu.org>
1819
1820 * lib/jit_mips.c: Correct cut&paste error that caused wrong
1821 stack offset calculation for double arguments in stack in
1822 the o32 abi.
1823 Correct typo in the __LITTLE_ENDIAN macro name, that came
1824 from cut&paste error in the original typo in lib/jit_ppc.c.
1825
1826 * lib/jit_ia64.c, lib/jit_ppc.c: Correct typo in the
1827 __LITTLE_ENDIAN macro name.
1828
18292013-06-22 Paulo Andrade <pcpa@gnu.org>
1830
1831 * check/lightning.c, configure.ac, include/lightning.h,
1832 lib/lightning.c: Add tests and quirks to build/detect
1833 and/or work on Irix.
1834
1835 * include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
1836 lib/jit_mips-fpu.c, lib/jit_mips.c: Adapt code to run
1837 in big endian mips, using the n32 abi.
1838
18392013-06-18 Paulo Andrade <pcpa@gnu.org>
1840
1841 * include/lightning.h: Minor extra preprocessor testing
1842 to "detect" byte order on x86 solaris, that now builds
1843 and pass all test cases.
1844
18452013-06-18 Paulo Andrade <pcpa@gnu.org>
1846
1847 * lib/jit_sparc-cpu.c: Correct compiler warning of value
1848 used before assignment. The usage is bogus as the api
1849 requires always patching jumps, but the random value used
1850 could cause an assertion due to invalid displacement.
1851
1852 * lib/jit_sparc.c: Always load and store double arguments
1853 in stack as 2 float loads or stores, for safety, as unaligned
1854 access is not allowed in Sparc Solaris.
1855
18562013-06-14 Paulo Andrade <pcpa@gnu.org>
1857
1858 * configure.ac: Force -mlp64 to CFLAGS on HP-UX ia64 port.
1859 It is the only supported mode, and expects gcc as C compiler.
1860
1861 * include/lightning.h, lib/jit_ia64-cpu.c, lib/jit_ia64.c:
1862 Correct ia64 port to work on HP-UX that runs it in big endian
1863 mode.
1864
18652013-06-10 Paulo Andrade <pcpa@gnu.org>
1866
1867 * lib/jit_hppa.c: Sanitize the cache synchronization inline
1868 assembly code that was doing twice the work and redundantly
1869 flushing the end address every loop iteration.
1870
18712013-06-09 Paulo Andrade <pcpa@gnu.org>
1872
1873 * configure.ac, check/Makefile.am, doc/Makefile.am: Do not
1874 explicitly link to -ldl, but instead autodetect the library
1875 with dlopen, dlsym, etc.
1876
1877 * check/lightning.c: Add workaround to apparently buggy
1878 getopt in HP-UX that sets optind to the wrong index, and
1879 use RTLD_NEXT on HP-UX instead of RTLD_DEFAULT to dlsym
1880 global symbols.
1881
1882 * include/lightning.h: Rework definitions of wordsize and
1883 byte order to detect proper values on HP-UX.
1884
1885 * lib/lightning.c: Minor correction to use MAP_ANONYMOUS
1886 instead of MAP_ANON on HP-UX.
1887
1888 * lib/jit_hppa.c: Float arguments must be passed on integer
1889 registers on HP-UX, not only for varargs functions.
1890 Add code to properly clear instruction cache. This was
1891 not required on Debian hppa port, but may have been working
1892 by accident.
1893
1894 * lib/jit_hppa-cpu.c: Follow pattern of HP-UX binaries and
1895 use bve,n instead of bv,n to return from functions.
1896
1897 * lib/jit_hppa-fpu.c: For some reason "fst? frX,rX,(rY)" did
1898 not work on the tested computer (HP-UX B.11.23 U 9000/785 HP-UX)
1899 so the code was changed, at first for __hpux only to add the
1900 base and offset register and use the instruction with an
1901 immediate (zero) offset.
1902
19032013-06-07 Paulo Andrade <pcpa@gnu.org>
1904
1905 * check/lightning.c, lib/jit_disasm.c, lib/jit_ppc-cpu.c,
1906 lib/jit_ppc-fpu.c, lib/jit_ppc.c, include/lightning.h,
1907 include/lightning/jit_ppc.h, include/lightning/jit_private.h:
1908 Adapt code to work on 32 bit AIX ppc using gcc. Most changes
1909 are basically to adapt the elf64 logic to 32 bit, as it does
1910 not use the same convention of 32 bit Darwin ppc.
1911
1912 * check/stack.tst: Add a fake memcpy function to the test
1913 case if running under AIX, as it is not available to dlsym.
1914
1915 * configure.ac: Check for getopt.h header, not available in
1916 AIX.
1917
19182013-06-01 Paulo Andrade <pcpa@gnu.org>
1919
1920 * include/lightning/jit_hppa.h, lib/jit_hppa-cpu.c,
1921 lib/jit_hppa-fpu.c, lib/jit_hppa.c: New files implementing
1922 the hppa port. Built on Debian Linux PA-RISC 2.0, 32 bit.
1923
1924 * check/float.tst: Add preprocessor for hppa expected
1925 values when converting NaN and +-Inf to an integer.
1926
1927 * check/ldst.inc: Ensure double load/store tests use an
1928 8 byte aligned address by default.
1929
1930 * lib/lightning.c: Correct a bug found during tests in
1931 the new port, where qmul* and qdiv* were not properly
1932 setting one of the result registers as modified in the
1933 function, what would be a problem if the only "write"
1934 usage were the qmul* or qdiv*.
1935
1936 * check/varargs.tst, check/varargs.ok: Add one extra
1937 interleaved integer/double test to validate proper code
1938 generation in the extra case.
1939
1940 * check/lightning.c, configure.ac, include/lightning.h,
1941 include/lightning/Makefile.am,
1942 include/lightning/jit_private.h, lib/Makefile.am,
1943 lib/jit_disasm.c: Update for the hppa port.
1944
19452013-04-27 Paulo Andrade <pcpa@gnu.org>
1946
1947 * check/varargs.tst: Correct misplaced .align directive
1948 that was causing the double buffer to not be aligned at
1949 8 bytes.
1950 * lib/jit_ia64-cpu.c:
1951 Properly implement abi for excess arguments passed on
1952 stack.
1953 Simplify load/store with immediate displacement argument
1954 with zero value.
1955 Simplify some calls to "subi" changing to "addi" with
1956 a negative argument.
1957 Remove some #if 0'ed code, that could be useful in
1958 special conditions, but the most useful one would be
1959 to "optimize" "static" jit functions, but for the sake
1960 of simplicity, jit functions are implemented in a way
1961 that can be passed back to C code as C function pointers.
1962 Add an attribute to prototypes of several unused functions.
1963 These functions are defined for the sake of implementing all
1964 Itanium documented instructions, but a significant amount of
1965 them is not used by lightning.
1966 * lib/jit_ia64-fpu.c: Simplify load/store with zero immediate
1967 displacement and add unused attribute for functions not used
1968 by lightning, but required to provide macros implementing all
1969 Itanium documented instructions.
1970 * lib/jit_ia64.c: Update for the properly implemented abi
1971 for stack arguments.
1972 * lib/lightning.c: Mark an unused function as such.
1973
19742013-04-27 Paulo Andrade <pcpa@gnu.org>
1975
1976 lib/jit_ia64-cpu.c:
1977 Correct immediate range check of integer comparisons when
1978 inverting arguments.
1979 Correct gei_u that was not decrementing immediate when
1980 inverting arguments.
1981 Correct b?add* and b?sub* that were not properly updating
1982 the result register.
1983
19842013-04-27 Paulo Andrade <pcpa@gnu.org>
1985
1986 * lib/jit_ia64-cpu.c: Correct wrong mapping of 2 instructions
1987 in "M-, stop, M-, stop" translation, that was ignoring the
1988 last stop (implemented as a nop I- stop).
1989
1990 * lib/jit_ia64-fpu.c: Properly implement fnorm.s and fnorm.d,
1991 as well as the proper integer to float or double conversion.
1992
19932013-04-27 Paulo Andrade <pcpa@gnu.org>
1994
1995 * lib/jit_ia64-cpu.c: Correct bogus implementation of ldr_T
1996 for signed integers, that was using ld1.s, ld2.s and ld4.s.
1997 The ".s" stands for speculative load, not sign extend.
1998
1999 * lib/jit_ia64-fpu.c: Correct bogus implementation of ldxr_T
2000 for float and double. The third (actually, second) argument
2001 is indeed added to the base register, but the base register
2002 is modified. The actual M7 implementation was already correct,
2003 just the ldxr_f and ldxr_d implementation that was kept in
2004 a prototype state, misinterpreting what M7 does.
2005
20062013-04-27 Paulo Andrade <pcpa@gnu.org>
2007
2008 * lib/jit_ia64-cpu.c: Correct X2 pattern matching by preventing
2009 it to attempt to require a stop between the L and the X
2010 instruction; that is, check the registers and predicates
2011 before emitting the L instruction, not after.
2012
2013 * lib/jit_ia64-fpu.c: Slightly simplify and correct
2014 divr_f and divrd_d implementation.
2015
2016 * check/lightning.c: Add __ia64__ preprocessor define
519a9ea1 2017 on Itanium.
4a71579b
PC
2018
2019 * check/alu.inc, check/clobber.tst, check/float.tst: Define
2020 several macros conditionally to __ia64__. This is required
2021 because __ia64__ jit generation can use way too many memory,
2022 due to not implementing instruction reordering to avoid
2023 as much as possible "stops", what causes way too many nops
2024 to be generated, as well as the fact that division and
2025 remainder requires function calls, and float division
2026 requires significant code to implement.
2027
20282013-04-27 Paulo Andrade <pcpa@gnu.org>
2029
2030 * include/lightning.h: Add new backend specific movr_w_d,
2031 movr_d_w and movi_d_w codes as helpers to ia64 varargs
2032 functions arguments.
2033
2034 * lib/jit_ia64-cpu.c:
2035 Correct wrong encoding of A5 small integers.
2036 Correct define of "mux" instruction modifiers.
2037 Correct ordering of arguments and predicates of cmp_xy
2038 implementation with immediate arguments; like most other
2039 codes with an immediate, the immediate is the second, not
2040 the third argument.
2041
2042 * lib/jit_ia64-fpu.c: Actual implementation of the code
2043 to move to/from gpr to/from fpr, to implement varargs abi.
2044
2045 * lib/jit_ia64.c: Make fpr argument registers not allocatable
2046 as temporaries, no need for the extra checks when there are
2047 plenty registers.
2048
2049 * lib/jit_print.c, lib/lightning.c: Minor updates for the
2050 new movr_w_d, movr_d_w and movi_d_w codes.
2051
20522013-04-26 Paulo Andrade <pcpa@gnu.org>
2053
2054 * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct code to
2055 also insert a stop to break an instruction group if a
2056 register is written more than once in the same group.
2057 This may happen if a register is argument and result of
2058 some lightning call (not a real instruction). The most
2059 common case should be code in the pattern:
2060 movl rn=largenum
2061 ...
2062 mov rn=smallnum
2063 where "rn" would end up holding "largenum".
2064 But the problem possibly could happen in other circumstances.
2065
20662013-04-26 Paulo Andrade <pcpa@gnu.org>
2067
2068 * include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
2069 lib/jit_ia64-fpu.c, lib/jit_ia64.c:
2070 Relocate JIT_Rn registers to the local registers, as, like
2071 float registers, div/rem and sqrt are implemented as function
2072 calls, and may overwrite non saved scratch registers.
2073 Change patch_at to receive a jit_code_t instead of a
2074 jit_node_t, so that it is easier to "inline" patches when
2075 some instruction requires complex code to implement, e.g.
2076 uneq and ltgt.
2077 Correct arguments to FMA and FMA like instructions that,
2078 due to a cut&paste error were passing the wrong argument
2079 to the related F- implementation function.
2080 Rewrite ltgt to return the proper result if one (or both)
2081 of the arguments is unordered.
2082
20832013-04-26 Paulo Andrade <pcpa@gnu.org>
2084
2085 * include/lightning/jit_ia64.h, include/lightning/jit_private.h,
2086 lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c,
2087 lib/lightning.c: Rework code to detect need of a "stop" to
2088 also handle predicates, as if a predicate is written, it
2089 cannot be read in the same instruction group.
2090 Use a single jit_regset_t variable for all registers when
2091 checking need for a stop (increment value by 128 for
2092 float registers).
2093 Correct wrong "subi" implementation, as the code executed
2094 is r0=im-r1, not r0=r1-im.
2095 Use standard lightning 6 fpr registers, and rework to
2096 use callee save float registers, that may be spill/reloaded
2097 in prolog/epilog. This is required because some jit
2098 instructions implementations need to call functions; currently
2099 integer div/mod and float sqrt, what may change the value of
2100 scratch float registers.
2101 Rework point of "sync" of branches that need to return a
2102 patch'able address, because the need for a "stop" before a
2103 predicate read causes all branches to be the instruction
2104 in slot 0, as there is no template to "stop" and branch
2105 in the same instruction "bundle".
2106
21072013-04-25 Paulo Andrade <pcpa@gnu.org>
2108
2109 * include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
2110 lib/jit_ia64-fpu.c, lib/jit_ia64.c: New files implementing
2111 the basic infrastructure of an Itanium port. The code
2112 compiles and can generate jit for basic hello world like
2113 functions.
2114
2115 * check/lightning.c, configure.ac, include/lightning.h,
2116 include/lightning/Makefile.am, include/lightning/jit_private.h,
2117 lib/Makefile.am, lib/lightning.c: Update for the Itanium
2118 port.
2119
2120 * lib/jit_mips-cpu.c, lib/jit_mips.c: Correct typo and
2121 make the jit_carry register local to the jit_state_t.
2122 This matches code reviewed in the Itanium port, that
2123 should use the same base logic to handle carry/borrow.
2124
21252013-04-10 Paulo Andrade <pcpa@gnu.org>
2126
2127 * include/lightning/jit_private.h, lib/jit_arm.c,
2128 lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c,
2129 lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
2130 lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
2131 lib/lightning.c: Change all jit_regset macros to take
2132 a pointer argument, to avoid structure copies when
2133 adding a port to an architecture with more than 64
2134 registers.
2135
21362013-04-08 Paulo Andrade <pcpa@gnu.org>
2137
2138 * lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache
2139 aligning to the next page boundary the end argument. It may
2140 actually truncate it.
2141
21422013-03-29 Paulo Andrade <pcpa@gnu.org>
2143
2144 * include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c,
2145 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c,
2146 lib/lightning.c: Do not start over jit generation if can grow
2147 the code buffer with mremap without moving the base pointer.
2148
21492013-03-29 Paulo Andrade <pcpa@gnu.org>
2150
2151 * lib/jit_memory.c: Implement a simple memory allocation wrapper
2152 to allow overriding calls to malloc/calloc/realloc/free, as well
2153 as ensuring all memory containing pointers is zero or points to
2154 allocated memory.
2155
2156 * include/lightning.h, include/lightning/jit_private.h: Definitions
2157 for the memory allocation wrapper.
2158
2159 * lib/Makefile.am: Update for new jit_memory.c file.
2160
2161 * lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_note.c,
2162 lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c:
2163 Use the new memory allocation wrapper code.
2164
21652013-03-22 Paulo Andrade <pcpa@gnu.org>
2166
2167 * configure.ac, include/lightning/jit_private.h, lib/lightning.c:
2168 Remove dependency on gmp. Only a simple bitmap was required, and
2169 that was not enough reason to force linking to gmp and possible
2170 complications caused by it.
2171
21722013-03-10 Paulo Andrade <pcpa@gnu.org>
2173
2174 * include/lightning.h: Add check for __powerpc__ defined
2175 in Linux, while Darwin defines __ppc__.
2176
2177 * include/lightning/jit_ppc.h: Adjust register definitions
2178 for Darwin 32 bit and Linux 64 bit ppc usage and/or ABI.
2179
2180 * include/lightning/jit_private.h: Add proper check for
2181 Linux __powerpc__ and an data definition for an workaround
2182 to properly handle code that starts with a jump to a "main"
2183 label.
2184
2185 * lib/jit_disasm.c: Add extra disassembler initialization
2186 for __powerpc64__.
2187
2188 * lib/jit_ppc-cpu.c: Add extra macros and functions, and
2189 correct/adapt previous ones to handle powerpc64.
2190
2191 * lib/jit_ppc-fpu.c: Adapt for 64 bit wordsize. Basically
2192 add conversion from/to int32/int64 and proper handling of
2193 load/store offsets too large for 32 bit.
2194
2195 * lib/jit_ppc.c: Add calls to 64 bit codes and adaptation
2196 for the PowerPC 64 bit Linux ABI.
2197
2198 * lib/jit_arm.c, lib/jit_mips.c, lib/jit_sparc, lib/jit_x86.c,
2199 lib/lightning.c: Correct off by one error when restarting jit
2200 of a function due to finding too late that needs to spill/reload
2201 some register. Problem was found by accident on a very special
2202 condition during PowerPC 64 code adaptation.
2203
22042013-03-08 Paulo Andrade <pcpa@gnu.org>
2205
2206 * check/lightning.c: Add missing ppc preprocessor definition.
2207
22082013-03-06 Paulo Andrade <pcpa@gnu.org>
2209
2210 * check/float.tst: Comment out the int to negative infinity
2211 test in mips for the moment because not all Loongson agrees
2212 on the result.
2213
2214 * lib/jit_disasm.c: Add a test instead of an assertion
2215 when loading symbols for disassembly due to a failure with
2216 a simple binutils build in Debian mipsel64.
2217
22182013-03-06 Paulo Andrade <pcpa@gnu.org>
2219
2220 * include/lightning/jit_private.h, lib/jit_arm-cpu.c,
2221 lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips-cpu.c,
2222 lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc-cpu.c,
2223 lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
2224 lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
2225 lib/lightning.c: Add an extra structure for data storage
2226 during jit generation, and release it after generating
2227 jit, to reduce a bit memory usage, and also to make it
2228 easier to understand what data is available during
2229 jit runtime.
2230
22312013-03-06 Paulo Andrade <pcpa@gnu.org>
2232
2233 * lib/lightning.c: Make data and code buffer readonly.
2234
22352013-02-20 Paulo Andrade <pcpa@gnu.org>
2236
2237 * doc/body.texi: Fool proof validate the examples of what
2238 an assembly-language programmer would write and correct the
2239 wrong sparc example.
2240
22412013-02-19 Paulo Andrade <pcpa@gnu.org>
2242
2243 * doc/body.texi: Add back the SPARC code generation example.
2244
22452013-02-19 Paulo Andrade <pcpa@gnu.org>
2246
2247 * check/lightning.c: Remove state flag to work with partial
2248 sparc port, by just disassembling if there was incomplete
2249 code generation.
2250
2251 * jit_sparc-cpu.c: Correct wrong range check for immediate
2252 integer constants (off by one bit shift).
2253 Correct macro implementing equivalent "rd %y, rd" assembly.
2254 Implement qmul* and qdiv*.
2255
2256 * jit_sparc.c: Update for qmul* and qdiv* and remove logic
2257 to handle incomplete code generation during sparc port.
2258
22592013-02-18 Paulo Andrade <pcpa@gnu.org>
2260
2261 * check/float.tst: Add sparc to list of known NaN and +-Inf
2262 to integer conversion.
2263
2264 * check/lightning.c: Define __sparc__ to preprocessor in
2265 the sparc backend.
2266
2267 * include/lightning/jit_private.h: Correct wrong definition
2268 of emit_stxi_d, that has lived for a long time, but would
2269 cause problems whenever needing to spill/reload a float
2270 register.
2271
2272 * include/lightning/jit_sparc.h: Can only use %g2,%g3,%g4
2273 for scratch variables, as other "global" registers are
2274 reserved for the system, e.g. libc.
2275 Reorder float register naming to make it easier to
2276 access odd float registers, so that generating code for
2277 pusharg and getarg is easier for the IR.
2278
2279 * lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c: Update to match
2280 new code in jit_sparc-cpu.c. It must call jit_get_reg
2281 with jit_class_nospill if using the register to move
2282 an unconditional branch address to it, as the reload
2283 will not happen (actually could happen in the delay
2284 slot...)
2285
2286 * lib/jit_sparc-cpu.c: Correct wrong macro definition for
2287 ldxr_s.
2288 Properly implement div* and implement rem. Div* needs
2289 to use the y register, and rem* needs to be synthesized.
2290 Correct b?sub* macro definitions.
2291
2292 * lib/jit_sparc-fpu.c: Correct reversed float to/from double
2293 conversion.
2294 Correct wrong jit_get_reg call asking for a gpr and then
2295 using the fpr with that number.
2296 Correct wrong branch displacement computation for
2297 conditional branches.
2298
2299 * lib/jit_sparc.c: Correct getarg_d and pushargi_d implementation.
2300 Add rem* entries to the switch converting IR to machine code.
2301
2302 * lib/lightning.c: Correct a problem detected when adding
2303 the jit_class_nospill flag to jit_get_reg, that was caused
2304 when having a branch to an "epilog" node, what would cause
2305 the code to think all registers in unknown state were live,
2306 while in truth, all registers in unknown state in the
2307 "just after return" point are actually dead.
2308
23092013-02-17 Paulo Andrade <pcpa@gnu.org>
2310
2311 * include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c,
2312 lib/jit_sparc-fpu.c, lib/jit_sparc.c: New files implementing
2313 the basic framework of the sparc port.
2314
2315 * configure.ac, include/lightning.h, include/lightning/Makefile.am,
2316 include/lightning/jit_private.h, lib/jit_disasm.c: Update
2317 for the sparc port framework.
2318
2319 * lib/jit_mips.c: Correct reversed retr/reti logic.
2320
2321 * lib/jit_ppc.c: Correct misspelled __LITTLE_ENDIAN.
2322
2323 * lib/lightning.c: Always do byte hashing in hash_data, because
2324 the logic to "compress" strings causes large pointers to not
2325 be guaranteed aligned at 4 byte boundaries.
2326 Update for the sparc port framework.
2327
23282013-02-11 Paulo Andrade <pcpa@gnu.org>
2329
2330 * lib/jit_arm.c: Correct jit_pushargi_f in the arm hardfp abi.
2331 Most of the logic uses even numbered register numbers, so that
2332 a float and a double can be used in the same register, but
2333 the abi requires packing the float arguments, so jit_pushargi_f
2334 needs to allocate a temporary register to modify only the
2335 proper register argument (or be very smart to push two
2336 immediate arguments if applicable).
2337
23382013-02-11 Paulo Andrade <pcpa@gnu.org>
2339
2340 * include/lightning.h, lib/lightning.c: Implement the new
2341 jit_clear_state and jit_destroy_state calls. jit_clear_state
2342 releases all memory not required during jit_execution; that
2343 is, leaves only the mmap'ed data and code buffers allocated.
2344 jit_destroy_state releases the mmap'ed buffers as well as
2345 the jit_state_t object itself, that holds pointers to the
2346 code and data buffers, as well as annotation pointers (for
2347 disassembly or backtrace) in the data buffer.
2348
2349 * lib/jit_note.c: Correct invalid vector offset access.
2350
2351 * check/ccall.c, check/lightning.c, doc/ifib.c, doc/incr.c,
2352 doc/printf.c, doc/rfib.c, doc/rpn.c: Use the new jit_clear_state
2353 and jit_destroy_state calls, to demonstrate the new code to
2354 release all jit memory.
2355
2356 * doc/body.texi: Add basic documentation and usage description
2357 of jit_clear_state and jit_destroy_state.
2358
23592013-02-11 Paulo Andrade <pcpa@gnu.org>
2360
2361 * include/lightning/jit_private.h, lib/jit_note.c, lib/lightning.c:
2362 Store all annotation information in the mmap'ed area reserved for
2363 read only data. This adds code to not allocate memory for jit_note_t
2364 objects, and to relocate jit_line_t objects and its contents after
2365 calculating annotation information. The jit_line_t objects are
2366 relocated because it is not possible to always calculate before
2367 hand data layout because note information may be extended or
2368 redundant entries removed, as well as allowed to be added in
2369 non sequential order.
2370 A bug was also corrected in _jit_set_note, that was causing it
2371 to allocate new jit_line_t objects when not needed. It was still
2372 working correctly, but allocating way more memory than required.
2373
23742013-02-05 Paulo Andrade <pcpa@gnu.org>
2375
2376 *include/lightning.h, lib/lightning.c: Add the new jit_live code
2377 to explicitly mark a register as live. It is required to avoid
2378 assuming functions always return a value in the gpr and fpr return
2379 register, and to avoid the need of some very specialized codes
2380 that vary too much from backend to backend, to instruct the
2381 optimization code the return register is live.
2382
2383 * lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
2384 lib/jit_x86.c: Update for the new jit_live code.
2385
2386 * check/ret.ok, check/ret.tst: New files implementing a simple
2387 test case that would previously fail at least in ix86/x86_64.
2388
2389 * check/Makefile.am: Update for new "ret" test case.
2390
23912013-02-05 Paulo Andrade <pcpa@gnu.org>
2392
2393 * lib/jit_ppc-cpu.c, lib/jit_ppc.c: Validate and correct
2394 problems in the qmul and qdiv ppc implementation.
2395
23962013-02-04 Paulo Andrade <pcpa@gnu.org>
2397
2398 * include/lightning.h, include/lightning/jit_private.h,
2399 lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_mips-cpu.c,
2400 lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c,
2401 lib/jit_x86-cpu.c, lib/jit_x86.c, lib/lightning.c:
2402 Implement the new qmul and qdiv instructions that return signed
2403 and unsigned lo/hi multiplication result and div/rem division result.
2404 These should be useful for jit translation of code that needs to
2405 know if a multiplication overflows (no branch opcode added) or if
2406 a division is exact (easy check if remainder is zero).
2407
2408 * check/lightning.c, lib/jit_print.c, check/Makefile.am,
2409 check/all.tst: Update for the new qmul and qdiv instructions.
2410
2411 * check/qalu.inc, check/qalu_div.ok, check/qalu_div.tst,
2412 check/qalu_mul.ok, check/qalu_mul.tst: New files implementing
2413 simple test cases for qmul and qdiv.
2414
24152013-01-30 Paulo Andrade <pcpa@gnu.org>
2416
2417 * doc/body.texi: Correct "jmpi" description that incorrectly
2418 told it was possible to pass any address as jump target. The
2419 only way to do that is "movi+jmpr".
2420
24212013-01-30 Paulo Andrade <pcpa@gnu.org>
2422
2423 * lib/jit_x86-cpu.c: Correct undefined behavior code.
2424 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56143
2425
24262013-01-29 Paulo Andrade <pcpa@gnu.org>
2427
2428 * configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER
2429 to have HAVE_CONFIG_H defined with latest aclocal.
2430
2431 * include/lightning/jit_private.h, lib/lightning.c: Add new
2432 abstraction to use an heuristic to calculate amount of space
2433 required for jit generation, and code to reallocate buffer if
2434 did miscalculate it.
2435
2436 * lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c:
2437 Update to use new code to estimate and resize of required buffer
2438 for jit code.
2439
2440 * lib/jit_x86-cpu.c: Minor cosmetic change to avoid adding a
2441 non required rex prefix when calling a function pointer stored
2442 in a register.
2443
24442013-01-24 Paulo Andrade <pcpa@gnu.org>
2445
2446 * check/Makefile.am: "make debug" target should pass only
2447 the main test tool program as argument for running gdb
2448
2449 * configure.ac: Add the --enable-assertions options.
2450
2451 * doc/Makefile.am, doc/body.texi, doc/lightning.texi:
2452 Major rewrite of the documentation to match the current
2453 implementation.
2454
2455 * doc/version.texi: Automatic date update.
2456
2457 * doc/ifib.c, doc/incr.c, doc/printf.c, doc/rfib.c, doc/rpn.c:
2458 Implementation of the documentation examples, that are also
2459 compiled during a normal build.
2460
2461 * doc/p-lightning.texi, doc/porting.texi, doc/toc.texi,
2462 doc/u-lightning.texi, doc/using.texi: These files were
2463 renamed in the documentation rewrite, as the documentation
2464 was significantly trimmed due to full removal of the porting
2465 chapters. Better porting documentation should be added but
2466 for the moment it was just removed the documentation not
2467 matching the implementation.
2468
24692013-01-18 Paulo Andrade <pcpa@gnu.org>
2470
2471 * lib/jit_note.c: Correct bounds check and wrong code keeping
2472 a pointer that could be changed after a realloc call.
2473
24742013-01-18 Paulo Andrade <pcpa@gnu.org>
2475
2476 * check/3to2.tst, check/add.tst, check/allocai.tst, check/bp.tst,
2477 check/call.tst, check/ccall.c, check/clobber.tst, check/divi.tst,
2478 check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst,
2479 check/ldstxi-c.tst, check/ldstxi.tst, check/ldstxr-c.tst,
2480 check/ldstxr.tst, check/lightning.c, check/rpn.tst, check/stack.tst,
2481 check/varargs.tst, include/lightning.h,
2482 include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_disasm.c,
2483 lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc.c, lib/jit_print.c,
2484 lib/jit_x86.c, lib/lightning.c: Extend the "jit_note" abstraction
2485 with the new "jit_name" call, that receives a string argument, and
2486 should usually be called to mark boundaries of functions of code
2487 generating jit (that is, it is not expected that the language
2488 generating jit map its functions to jit functions).
2489
24902013-01-17 Paulo Andrade <pcpa@gnu.org>
2491
2492 * check/add.tst, check/allocai.tst, check/bp.tst, check/divi.tst,
2493 check/fib.tst, check/lightning.c, include/lightning/jit_arm.h,
2494 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
2495 include/lightning/jit_private.h, include/lightning/jit_x86.h:
2496 Make JIT_RET, JIT_FRET and JIT_SP private. These should not be
2497 used in any operations due to frequently having special
2498 constraints (usually JIT_FRET). JIT_FP must be made available
2499 because it must be used as the base register to access stack
2500 space allocated with jit_allocai.
2501
25022013-01-14 Paulo Andrade <pcpa@gnu.org>
2503
2504 * include/lightning.h, lib/lightning.c: Add an extra align
2505 argument to the jit_data call (that should be made private),
2506 so that it should not align strings at 8 bytes.
2507 Correct the jit_note call to include the null ending byte
2508 when adding label/note names to the "jit data section".
2509
25102013-01-11 Paulo Andrade <pcpa@gnu.org>
2511
2512 * lib/jit_note.c: New file implementing a simple string+integer
2513 annotation, that should be used to map filename and line number
2514 to offsets in the generated jit.
2515
2516 * include/lightning.h, lib/lightning.c: Update for the new
2517 note code.
2518 Add an extra mandatory argument to init_jit, that is used
2519 as argument to bfd_openr.
2520 Change from generic void* to char* the argument to jit_note
2521 and add an extra integer argument, to map to filename and
2522 line number.
2523
2524 * check/ccall.c, check/lightning.c, include/lightning/jit_private.h,
2525 lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_ppc.c,
2526 lib/jit_print.c, lib/jit_x86.c: lib/Makefile.am: Update for the
2527 new annotation code.
2528
2529 * configure.ac, check/Makefile.am: Update to work with latest
2530 automake.
2531
25322013-01-09 Paulo Andrade <pcpa@gnu.org>
2533
2534 * include/lightning.h, lib/jit_arm.c, jit_mips-fpu.c,
2535 lib/jit_mips.c, lib/jit_print.c, lib/jit_x86.c, lib/lightning.c:
2536 Remove the jit_code_getarg_{f,d} and jit_code_pusharg{i,r}_{f,d}
2537 calls, replacing them with the new, internal only, jit_movr_w_f,
2538 jit_mov{r,i}_f_w, jit_movr_ww_d, and jit_mov{i,r}_d_ww, that
2539 better describe the operation being done, and allow removing
2540 the hackish code to detect special conditions for arm when
2541 moving from/to vfp from/to a grp register pair.
2542 Rename jit_code_retval_{f,d} to jit_code_x86_retval_{f,d} as
2543 it is specific to 32 bit x86, and used to move abi return
2544 value in x87 register to a sse register.
2545
25462013-01-05 Paulo Andrade <pcpa@gnu.org>
2547
2548 * check/cccall.c, check/ccall.ok: New test case to validate
2549 interleaved calls from/to C code and jit.
2550
2551 * check/Makefile.am: Update for the new ccall test case.
2552
2553 * include/lightning.h, lib/lightning.c: Add the new jit_address
2554 call that returns the real/final address of a "note" in the
2555 generated jit. It requires a jit_node_t as returned by the
2556 jit_note call, and is only valid after calling jit_emit.
2557 Add an intermediate solution to properly handle arm
2558 soft and softfp modes that move a double to an integer register
2559 pair. Currently it just adds extra tests for the condition,
2560 but the proper solution should be to have extra lightning
2561 codes for these conditions, codes which should be only used
2562 by the backends that need it, and merged with the existing
2563 jit_pusharg*_{f,d}.
2564
2565 * include/lightning/jit_private.h: Add new jit_state_t flag
2566 to know it finished jit_emit, so that calls to jit_address
2567 are valid.
2568
2569 * lib/jit_mips.c: Correct abi implementation so that the
2570 new ccall test case pass. Major problem was using
2571 _jit->function.self.arg{i,f} as boolean values, but that
2572 would cause lightning.c:patch_registers() to incorrectly
2573 assume only one register was used as argument when calling
2574 jit_regarg_p(); _jit->function.self.arg{i,f} must be the
2575 number of registers used as arguments (in all backends).
2576
2577 * lib/jit_x86.c: Add workaround, by marking %rax as used,
2578 to a special condition, when running out of registers and the
2579 allocator trying to spill and reload %rax, but %rax was used
2580 as a pointer to a function, what would cause the reload to
2581 destroy the return value. This condition can be better
2582 generalized, but the current solution is good enough.
2583
2584 * include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c, lib/jit_ppc.c:
2585 Rewrite logic to handle arguments, as the original code was
2586 written based on a SysV pdf about the generic powerpc ABI,
2587 what did "invent" a new abi for the previous test cases, but
2588 failed in the new ccall test in Darwin PPC. Now it properly
2589 handles 13 float registers for arguments, as well as proper
2590 computation of stack offsets when running out of registers
2591 for arguments.
2592
25932013-01-02 Paulo Andrade <pcpa@gnu.org>
2594
2595 * check/float.tst: Correct test case to match ppc also
2596 converting positive infinity to 0x7fffffff.
2597
2598 * lib/jit_arm-swf.c: Correct typos with double underscores.
2599
2600 * lib/lightning.c: Correct remaining wrong reverse jump logic.
2601
26022012-12-29 Paulo Andrade <pcpa@gnu.org>
2603
2604 * lib/lightning.c: Correct both, wrong and confusing logic
2605 to compute the reverse of a jump. Now it properly matches
2606 C semantics for "eq" (==) and "ne" (!=) and correct computation
2607 of reverse of "uneq" as "gt".
2608
2609 * check/branch.tst: Update "ne" float branch check that
2610 previously happened to be wrongly tested with a NaN argument.
2611
26122012-12-29 Paulo Andrade <pcpa@gnu.org>
2613
2614 * check/float.ok, check/float.tst: New test cases implementing
2615 extensive validation of float comparison and branch code
2616 generation as well as integer conversion, involving NaN and
2617 [+-]Inf.
2618
2619 * lib/jit_arm-swf.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
2620 Correct bugs found by new float test case.
2621
2622 * lib/jit_x86.c: Correct cut&paste error added in commit to
2623 convert jit_arg* return value to a jit_node_t*, that would
2624 cause it to not properly handle double arguments in ix86.
2625
2626 * check/Makefile.am: Update for the new test case.
2627
26282012-12-28 Paulo Andrade <pcpa@gnu.org>
2629
2630 * check/lightning.c, include/lightning.h, lib/jit_arm.c,
2631 lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c, lib/jit_x86.c,
2632 lib/lightning.c: Change return value of jit_arg{,_f,_d} to
2633 a jit_node_t* object, that should be used as argument to
2634 jit_getarg_{c,uc,s,us,i,ui,l,f,d}. This just requires changing
2635 from jit_int32_t to jit_pointer_t (or jit_node_t*) the "handle"
2636 for the getarg calls, with the benefit that it makes it easy
2637 to implement patching of the stack address of non register
2638 arguments, this way allowing to implement variable size stack
2639 frames if applicable; useful if there are too many registers and
2640 jit functions uses only a few callee save registers.
2641
26422012-12-27 Paulo Andrade <pcpa@gnu.org>
2643
2644 * lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
2645 regressions when patching jit_calli for a forward function.
2646
2647 * lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
2648 in jit_getarg_u{c,s} implementation.
2649
26502012-12-23 Paulo Andrade <pcpa@gnu.org>
2651
2652 * check/call.ok, check/call.tst: New test cases to validate
2653 simple typed argument and return values in function calls.
2654
2655 * check/lightning.c: Properly handle jit_movi of labels for
2656 backward and forward code labels.
2657
2658 * check/Makefile.am: Update for new test case.
2659
26602012-12-23 Paulo Andrade <pcpa@gnu.org>
2661
2662 * check/carry.ok, check/carry.tst: New test case to validate
2663 carry condition handling.
2664
2665 * check/Makefile.am: Update for new test case.
2666
26672012-12-22 Paulo Andrade <pcpa@gnu.org>
2668
2669 * lib/jit_ppc-cpu.c, lib/jit_ppc.c: Implement logic for
2670 jit_htonr for big endian, so that ppc (big endian) pass the
2671 new clobber.tst test case.
2672
26732012-12-22 Paulo Andrade <pcpa@gnu.org>
2674
2675 * lib/jit_arm.c: Correct use of wrong argument offset
2676 variable in armv7l or float/double argument for varargs
2677 function in armv7hl.
2678 Correct jit_getarg* logic in software float mode to
2679 match expected behavior in other backends, that is, if
2680 a function is not called, it is safe to use a few lightning
2681 calls before a next jit_getarg* call, as done in the test
2682 case check/stack.tst. The proper solution should be to
2683 extend the parser in lib/lightning.c to check if there is
2684 some float operation that will call some (libgcc?) function,
2685 but software float arm should be a very uncommon backend for
2686 lightning, so, just load the already in place arguments
2687 saved to stack, assuming the register argument was clobbered
2688 (what should not be the case most times...).
2689
26902012-12-22 Paulo Andrade <pcpa@gnu.org>
2691
2692 * check/clobber.ok, check/clobber.tst: New test case doing
2693 extensive validation tests to ensure registers not used in
2694 a operation are not clobbered.
2695
2696 * check/Makefile.am: Update for new test case.
2697
26982012-12-21 Paulo Andrade <pcpa@gnu.org>
2699
2700 * lib/lightning.c: Partially rewrite/revert code to compute
2701 initial register live state at the start of a basic block.
2702 The original logic was corrupted when adding optimizations
2703 to do as few computations as possible in jit_update. The
2704 reglive field must be always a known set of live registers
2705 at the start of a basic block. The value that was incorrect
2706 was the regmask field, that must be the set of registers
2707 that are in unknown state, because they are not known live,
2708 neither set (or possibly not set) in the basic block, and
2709 *must* store the state at the start of the basic block.
2710
27112012-12-20 Paulo Andrade <pcpa@gnu.org>
2712
2713 * include/lightning/jit_ppc.h: Correct mismatch of JIT_F{1,5}
2714 with enum codes, that were correct, and returned by jit_f().
2715
2716 * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: Properly
2717 implement and better describe values when generating stack
2718 frames.
2719
27202012-12-18 Paulo Andrade <pcpa@gnu.org>
2721
2722 * check/stack.ok, check/stack.tst: New files to test data
2723 integrity on a deep chain of stack frames.
2724
2725 * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
2726 lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
2727 lib/jit_x86.c, lib/jit_x86-cpu.c: Calculate _jit->function->stack
2728 in the emit stage, otherwise it will calculate it wrong if
2729 need to jit_allocai space to spill registers.
2730
2731 * lib/lightning.c: Correct wrong offset when updating the
2732 "current" jit function pointer in the code that may need to
2733 allocate stack space to spill registers.
2734
2735 * check/lightning.c: Correct off by one data space check.
2736
2737 * check/Makefile.am: Update for new test case.
2738
27392012-12-17 Paulo Andrade <pcpa@gnu.org>
2740
2741 * check/fop_abs.ok, check/fop_abs.tst, check/fop_sqrt.ok,
2742 check/fop_sqrt.tst: New files implementing simple test cases
2743 for the extra float operations.
2744
2745 * check/Makefile.am: Update for new test cases.
2746
2747 * check/alu.inc: Add an extra macro to check for unordered
2748 equality on tests where it is expected to use NaN as an
2749 argument.
2750
2751 * check/lightning.c: Minor change for proper/common argument
2752 syntax handling ommiting arguments to options.
2753
27542012-12-17 Paulo Andrade <pcpa@gnu.org>
2755
2756 * check/Makefile.am: Automatically generate pattern list
2757 of tests with alternate jit generation options. This should
2758 prevent typos and needing to change multiple places after
2759 a change.
2760
27612012-12-14 Paulo Andrade <pcpa@gnu.org>
2762
2763 * check/lightning.c: Remove the ".cpu name value" syntax,
2764 as it was not able to do proper changes before the jit
2765 internal data structure was initialized. Now it supports
2766 several getopt options to force using different jit
2767 generation options, effectively replacing the previous
2768 syntax.
2769
2770 * check/run-test: Add simple extra logic to handle differently
2771 named test scripts, used to test things like x87 coprocessor
2772 in ix86, and arm instruction set or software float in armv7l.
2773
2774 * configure.ac: Add some AC_RUN_IFELSE calls to figure at
2775 compile time if can test different code generation options,
2776 and update Makefile generation accordingly.
2777
2778 * check/Makefile.am, lib/jit_arm.c, lib/jit_x86.c: Update to
2779 properly work with the test tool updating the jit_cpu global
2780 information.
2781
2782 * check/check.arm.sh, check/check.swf.sh, check/check.x87.sh:
2783 New wrapper files passing -mthumb=0, mvfp=0 and -mx87=1 to
2784 the test tool, if applicable, so that it can validate alternate
2785 code generation options on test hosts that support them.
2786
27872012-12-14 Paulo Andrade <pcpa@gnu.org>
2788
2789 * lib/jit_x86-x87.c, lib/jit_x86.c: Correct test cases in ix86
2790 when using the x87 coprocessor instead of sse2+.
2791
27922012-12-14 Paulo Andrade <pcpa@gnu.org>
2793
2794 * include/lightning.h, include/lightning/jit_private.h,
2795 lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c,
2796 lib/lightning.c: Make jit_ellipsis implementation not
2797 backend specific. It is not intended to handle va_list
2798 like objects at runtime, as jit_arg* and jit_getarg*
2799 return constant values resolved at parse time, so, effectively
2800 it is not possible to create printf like jit functions, as
2801 there is no va_start, va_arg, va_end, etc, abstraction. This
2802 limitation should be kept for the sake of making new ports
2803 easier.
2804
28052012-12-14 Paulo Andrade <pcpa@gnu.org>
2806
2807 * include/lightning.h, lib/lightning.c: Add two extra wrapper
2808 functions to avoid need for excess pointer to/from word casts.
2809
2810 * check/lightning.c: Only need for pointer to/from word cast
2811 now is jit_movi, update accordingly.
2812
28132012-12-13 Paulo Andrade <pcpa@gnu.org>
2814
2815 * check/varargs.ok, check/varargs.tst: New test cases implementing
2816 simple varargs calls with a large amount of arguments to exercise
2817 excess arguments on stack.
2818
2819 * include/lightning.h: Include config.h if HAVE_CONFIG_H is
2820 defined.
2821
2822 * lib/jit_arm.c: Allocate a fpr register, not a gpr one for
2823 temporary when pushing varargs arguments in the stack.
2824
2825 * lib/jit_arm-swf.c: Correct code changing the wrong offset
2826 in jit_absr_d and jit_negr_d in software float.
2827
2828 * lib/jit_mips.c: Correct calculation of offsets of arguments
2829 on stack.
2830
2831 * lib/jit_ppc.c: Correct bogus logic for "next" offset of arguments
2832 on stack and adjust for fixed offset of stack arguments.
2833
28342012-12-12 Paulo Andrade <pcpa@gnu.org>
2835
2836 * include/lightning.h, lib/jit_arm.c, lib/jit_mips.c,
2837 lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Change jit_prepare
2838 to no longer receive an argument. If receiving an argument, it
2839 should be an ABI specifier, not a boolean if varargs or not,
2840 and add the new jit_ellipsis call, to specify where the
2841 ellipsis is in the C prototype of the function being called.
2842 Note that currently it is not supported to define varargs
2843 functions and it will be ignored if calling jit_ellipsis not
2844 in a prepare/finish* block, but this should be addressed.
2845
2846 * check/allocai.tst, check/alu_add.tst, check/alu_and.tst,
2847 check/alu_com.tst, check/alu_div.tst, check/alu_lsh.tst,
2848 check/alu_mul.tst, check/alu_neg.tst, check/alu_or.tst,
2849 check/alu_rem.tst, check/alu_rsh.tst, check/alu_sub.tst,
2850 check/alu_xor.tst, check/alux_add.tst, check/alux_sub.tst,
2851 check/bp.tst, check/branch.tst, check/cvt.tst, check/divi.tst,
2852 check/fib.tst, check/ldsti.tst, check/ldstr-c.tst,
2853 check/ldstr.tst, check/ldstxi-c.tst, check/ldstxi.tst,
2854 check/ldstxr-c.tst, check/ldstxr.tst, check/rpn.tst,
2855 check/lightning.c: Update for the change to jit_prepare and
2856 addition of jit_ellipsis.
2857
28582012-12-11 Paulo Andrade <pcpa@gnu.org>
2859
2860 * lib/jit_ppc-cpu.c: Make movr a function that checks arguments
2861 so that other code can safely assume it is a noop if src and dst
2862 are the same register.
2863 Implement rem{r,i}{,_u} as a div{,u}/mul/sub.
2864 Correct ANDIS, ORIS and XORIS calls to cast the argument to
2865 unsigned before the shift to avoid an assertion if the argument
2866 had the topmost bit set.
2867 Implement lshi, rshi and rshi_u as functions to test for a
2868 zero argument, that would otherwise trigger an assertion when
2869 computing the shift value.
2870 Do a simple implementation of bm{s,c}{r,i} with a temporary,
2871 "andr" of arguments and jump based on comparison with zero.
2872 Correct typo in ldxi_c.
2873
2874 * lib/jit_ppc-fpu.c: Correct wrong arguments to FDIV* and STF*.
2875
2876 * lib/jit_ppc.c: Correct wrong check for 6 instead of 8 integer
2877 arguments in registers. If calling a varargs function and
2878 passing a float or double argument, also either store the
2879 value in the stack or in integer registers, as varargs functions
2880 do not fetch it from float registers.
2881 Add "case" for new functions and incorrectly missing ones.
2882 Call libgcc's __clear_cache, that should know what to do
2883 if the hardware needs flushing cache before execution.
2884
2885 * lib/lightning.c: Do a simple/trivial logic in jit_regset_scan1,
2886 that should make it easier for the compiler to optimize it, and
2887 that also corrects the previously wrong code for big endian, and
2888 that was causing problems in ppc due to not saving all callee save
2889 registers as it was not "finding" them in the regset due to the
2890 little endian assumption bug.
2891
28922012-12-11 Paulo Andrade <pcpa@gnu.org>
2893
2894 * configure.ac: Only default to using the builtin disassembler
2895 if on GNU/Linux. This should be temporary, due to requiring
2896 /proc/self/exe.
2897 Correctly check $target_cpu for powerpc.
2898
2899 * include/lightning/jit_ppc.h: Correctly implement jit_v_num.
2900
2901 * include/lightning/jit_private.h: Declare proper prototype
2902 for jit_init_debug and jit_finish_debug.
2903
2904 * lib/jit_ppc-cpu.c: Remove code to save/restore callee save
2905 float registers, as it is not required since those float
2906 registers are not usable currently.
2907 Change prolog and epilog generation to, at least comparing
2908 code, match what gcc generates in "gcc -O0", but it is still
2909 failing in Darwin PPC, apparently due to the __clear_cache
2910 call not being enough, as frequently it will also fail to
2911 execute, and the code buffer is all zeroes.
2912
2913 * lib/lightning.c: Do not fail in jit_regset_scan1 calls due
2914 to passing 64 as argument on computers with 64 registers.
2915
29162012-12-10 Paulo Andrade <pcpa@gnu.org>
2917
2918 * lib/jit_mips-cpu.c: Correct all current test cases.
2919 Call the "xori" not the "XORI" macro for jit_xori implementation,
2920 as the XORI macro handles only 16 bit unsigned values.
2921 Call the "movr" macro, not the "movi" macro in the special
2922 case of adding or subtracting zero.
2923 Use the proper temporary register in the jit_andr implementation.
2924
29252012-12-09 Paulo Andrade <pcpa@gnu.org>
2926
2927 * check/alu.inc, check/alu_add.ok, check/alu_add.tst,
2928 check/alu_and.ok, check/alu_and.tst, check/alu_com.ok,
2929 check/alu_com.tst, check/alu_div.ok, check/alu_div.tst,
2930 check/alu_lsh.ok, check/alu_lsh.tst, check/alu_mul.ok,
2931 check/alu_mul.tst, check/alu_neg.ok, check/alu_neg.tst,
2932 check/alu_or.ok, check/alu_or.tst, check/alu_rem.ok,
2933 check/alu_rem.tst, check/alu_rsh.ok, check/alu_rsh.tst,
2934 check/alu_sub.ok, check/alu_sub.tst, check/alu_xor.ok,
2935 check/alu_xor.tst, check/alux_add.ok, check/alux_add.tst,
2936 check/alux_sub.ok, check/alux_sub.tst, check/branch.ok,
2937 check/branch.tst: New test cases for arithmetic and branch
2938 tests.
2939
2940 * check/Makefile.am: Update for new test cases.
2941
2942 * include/lightning/jit_private.h: Make the jit_reg_free_p
2943 macro shared by all backends. Previously was added for the
2944 arm backend, but is useful in the x86_64 backend when checking
2945 state of "special purpose register".
2946 Also add the new jit_class_named register class, that must be
2947 or'ed with the register value if calling jit_get_reg expecting
2948 an specific value, because the specific register value may be
2949 zero, that previously was treated as no register requested.
2950
2951 * lib/jit_arm-cpu.c: Correct argument order for T2_MVN.
2952
2953 * lib/jit_arm-swf.c: Call the proper function for double
2954 divide. The "software float" implementation just calls
2955 libgcc functions.
2956
2957 * lib/jit_arm.c: Return float/double values in the float
2958 register if using the hard float ABI.
2959
2960 * lib/jit_x86-cpu.c: Change the can_sign_extend_int_p macro
2961 to not include -0x80000000L, because there is code that
2962 "abuses" it and thinks it can negate the immediate value
2963 after calling that macro.
2964 Correct implementation of jit_subi that had a wrong code
2965 patch logic doing subtraction with reversed arguments.
2966 Correct REX prefix calculation in the jit_muli implementation.
2967 Correct logic to get/unget %*ax and %*dx registers in divremr
2968 and divremi.
2969 Correct divremi that was using the symbolic, unique %*ax
2970 value in on place (not using the _REGNO name suffix).
2971 Correct cut&paste error causing it to use "xor" instead of
2972 "or" in one code path of the jit_ori implementation.
2973 Correct several flaws when clobbering registers and/or when
2974 one of the arguments was %*cx in the rotshr wrapper function
2975 implementing most shift operations.
2976
2977 * lib/lightning.c: No longer expect that the backend be smart
2978 enough to know what to do when asking for a named register
2979 if that register is already an argument or is live. It fails
2980 if it is an argument, or if register is live, fails if cannot
2981 spill.
2982 No longer incorrectly assume that eqr_{f,d} and ltgr_{f,d} are
2983 safe to inverse value tests in jump thread optimization.
2984
29852012-12-05 Paulo Andrade <pcpa@gnu.org>
2986
2987 * check/Makefile.am, check/cvt.ok, check/cvt.tst: Add new
2988 "cvt" test case to test conversion from/to int/float types.
2989
2990 * check/lightning.c: Only define truncr_{f,d}_l in 64 bit mode.
2991
2992 * include/lightning.h: Correct typo that caused it to define
2993 jit_truncr_{f,d}_l in 32 bit mode.
2994
2995 * lib/jit_arm-cpu.c: Avoid assertion failure in the signed/unsigned
2996 extend opcodes generation as it shares an interface for 3 argument
2997 opcode generation.
2998
2999 * lib/jit_x86-cpu.c: Correct wrong argument passed to
3000 jit_unget_reg in the andi implementation and wrong byte
3001 unsigned extend code generation.
3002
3003 * lib/jit_x86-sse.c: Correct conversion from "word" to float or
3004 double as is dependent on wordsize.
3005
30062012-12-05 Paulo Andrade <pcpa@gnu.org>
3007
3008 * check/ldstr-c.ok, check/ldstr-c.tst, check/ldstxi-c.ok,
3009 check/ldstxi-c.tst, check/ldstxr-c.ok, check/ldstxr-c.tst:
3010 New test case files testing load clobbering the base and/or
3011 index register;
3012
3013 * check/ldst.inc: New file with common definition for all the
3014 ldst* test cases.
3015
3016 check/Makefile.am, check/ldsti.tst, check/ldstr.tst,
3017 check/ldstxi.tst, check/ldstxr.tst: Update for new common
3018 definitions file and new register clobber ldst tests.
3019
30202012-12-05 Paulo Andrade <pcpa@gnu.org>
3021
3022 * lib/jit_mips-fpu.c: Correct wrong register order in stxr_{f,d}
3023 in the mips backend.
3024
30252012-12-05 Paulo Andrade <pcpa@gnu.org>
3026
3027 * lib/jit_arm-vfp.c: Correct regression found in armv7l with
3028 latest test cases.
3029
30302012-12-05 Paulo Andrade <pcpa@gnu.org>
3031
3032 * check/ldstxi.tst, check/ldstxr.tst: Correct wrong argument
3033 order for 32 bit mode tests.
3034
3035 * configure.ac: Correct check for ix86 target_cpu.
3036
30372012-12-05 Paulo Andrade <pcpa@gnu.org>
3038
3039 * check/ldstr.ok, check/ldstr.tst, check/ldsti.ok,
3040 check/ldsti.tst, check/ldstxr.ok, check/ldstxr.tst,
3041 check/ldstxi.ok, check/ldstxi.tst:
3042 New test case files exercising a very large amount of
3043 register combinations to verify load/store implementation.
3044
3045 * check/Makefile.am: Update for new test cases.
3046
3047 * lib/jit_x86-cpu.c: Correct wrong argument order when
3048 computing REX prefix for {ld,st}r_T codes;
3049
30502012-12-04 Paulo Andrade <pcpa@gnu.org>
3051
3052 * lib/jit_mips-fpu.c, lib/jit_mips.c: Implement missing mips
3053 jit_sqrtr_{f,d} codes.
3054
3055 * check/all.tst, include/lightning.h, lib/jit_print.c: Change
3056 declaration order and call order in all.tst of {add,sub}c and
3057 {add,sub}x. *c must be called before to set the carry and *x
3058 second to use the carry and keep it set. The wrong call order
3059 was causing all.tst to fail in mips, where a register is
3060 allocated to keep a global carry state.
3061
30622012-12-04 Paulo Andrade <pcpa@gnu.org>
3063
3064 * include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
3065 lib/jit_mips-fpu.c, lib/jit_mips.c: Correct float/double
3066 argument handling and make the mips backend pass the initial
3067 test cases.
3068
3069 * include/lightning.h, ib/jit_print.c, lib/lightning.c:
3070 Add extra enum values for argument handling functions that
3071 could not be abstracted to the current codes, that is, when
3072 float values need to move from/to gpr from/to fpr. It would
3073 be more tempting to add such primitives, but they would have
3074 wordsize limitations, and it is not expected to add codes
3075 with one gpr argument for 64 bit and two for 32 bit.
3076
3077 * lib/jit_ppc.c: Check _jit->function before calling jit_epilog()
3078 to avoid a runtime exception.
3079
30802012-12-04 Paulo Andrade <pcpa@gnu.org>
3081
3082 * include/lightning/jit_mips.h, lib/jit_mips.c: Update to
3083 make the mips backend compile in a qemu image.
3084
3085 * lib/jit_ppc.c: Minor adaptations to help in having the
3086 ppc backend compilable.
3087
30882012-12-03 Paulo Andrade <pcpa@gnu.org>
3089
3090 * configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
3091 lib/jit_arm-swf.c, lib/jit_arm.c, check/Makefile.am: Correct
3092 implementation of the arm backend port to build and pass the
3093 current test cases. Tested on armv7 with softfp abi.
3094
3095 * lib/jit_disasm.c: Rename and change prototype of static
3096 disassemble function as in the arm backend it is required
3097 to access state information stored in the jit_state_t object.
3098
3099 * check/3to2.tst, check/add.tst: Correct test case code assuming
3100 JIT_RO and JIT_RET are the same, and even if they are the same,
3101 the logic was incorrect because it must always call jit_retval*
3102 to fetch a function call return before any other instruction.
3103 The arm backend hash a special condition if jit_retval is not
3104 called, because "r0" is not JIT_R0, but is JIT_RET and *also*
3105 the first argument for a called function, so JIT_RET must be
3106 only used as an argument to jit_retval.
3107
31082012-12-03 Paulo Andrade <pcpa@gnu.org>
3109
3110 * check/all.tst, check/lightning.c: Only declare or use 64 bit
3111 interfaces on 64 bit builds.
3112
3113 * check/fib.tst: Use simpler logic to not need preprocessor
3114 conditionals for 32 or 64 bit.
3115
3116 * include/lightning.h: Only declare 64 bit macros on a 64 bit
3117 build. Code using lightning must know about wordsize and the
3118 jit generation limitations, also, this way it generates a
3119 compile time failure, not a runtime assertion.
3120
3121 * include/lightning/jit_x86.h: Correct typo in macro name.
3122
3123 * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
519a9ea1 3124 lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
4a71579b
PC
3125 lib/jit_x86.c, lib/jit_x86-cpu.c: Correct wrong code to get
3126 current jit function pointer.
3127
3128 * lib/lightning.c: Move call to the simplify() optimization
3129 to after register liveness is known. Previous code did work
3130 by accident but now with proper test cases the problem was
3131 noticed.
3132
3133 * lib/jit_disasm.c: Always cast bfd_vma to long long when
3134 passing it as printf argument.
3135
31362012-12-03 Paulo Andrade <pcpa@gnu.org>
3137
3138 * configure.ac, check/Makefile.am, check/check.sh,
3139 doc/Makefile.am, include/lightning/Makefile.am,
3140 lib/Makefile.am: Correct make distcheck.
3141
31422012-12-02 Paulo Andrade <pcpa@gnu.org>
3143
3144 * lib/jit_ppc.c: Assign copyright ownership to FSF.
3145
3146 * lib/jit_x86-cpu.c: Correct integer multiplication that was
3147 generating code with reversed register arguments.
3148
3149 * check/rpn.ok, check/rpn.tst: New test case file.
3150
31512012-12-02 Paulo Andrade <pcpa@gnu.org>
3152
3153 * lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
3154 Actually change copyright owner to FSF as avertised.
3155
3156 * lib/jit_arm-cpu.c, lib/jit_arm-swf.c,
3157 lib/jit_arm-vfp.c, lib/jit_arm.c,
3158 lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c,
3159 lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: New
3160 files implementing initial code different jit backends.
3161
3162 * include/lightning/jit_private.h: Add extra field to the
3163 private jit_patch_t type, required by the arm port.
3164
3165 * lib/Makefile.am: Update for the new backend implementation
3166 files.
3167
31682012-12-02 Paulo Andrade <pcpa@gnu.org>
3169
3170 * check/Makefile.am: Add proper "make clean" rule and missing
3171 check.sh to EXTRA_DIST.
3172
31732012-12-02 Paulo Andrade <pcpa@gnu.org>
3174
3175 * .gitignore: Update pattern of ignored files.
3176
3177 * check/Makefile.am: Add rule to build liblightning.la dependency
3178 in case of running "make check" before building the library.
3179
31802012-12-02 Paulo Andrade <pcpa@gnu.org>
3181
3182 * lightning/Makefile.am, lightning/asm-common.h,
3183 lightning/core-common.h, lightning/fp-common.h,
3184 lightning/funcs-common.h, lightning/i386/Makefile.frag,
3185 lightning/i386/asm-32.h, lightning/i386/asm-64.h,
3186 lightning/i386/asm.h, lightning/i386/core-32.h,
3187 lightning/i386/core-64.h, lightning/i386/core.h,
3188 lightning/i386/fp-32.h, lightning/i386/fp-64.h,
3189 lightning/i386/fp.h, lightning/i386/funcs.h,
3190 lightning/ppc/asm.h, lightning/ppc/core.h,
3191 lightning/ppc/fp.h, lightning/ppc/funcs.h,
3192 lightning/sparc/asm.h, lightning/sparc/core.h,
3193 lightning/sparc/fp.h, lightning/sparc/funcs.h:
3194 Removed. The core logic is used in the new code, and new mips
3195 and arm ports will be added. At first, sparc will not be
3196 supported as it has not yet been ported to the new engine.
3197
31982012-12-02 Paulo Andrade <pcpa@gnu.org>
3199
3200 * tests/Makefile.am, tests/3to2.c, tests/3to2.ok, tests/add.c,
3201 tests/add.ok, tests/allocai.c, tests/allocai.ok, tests/bp.c,
3202 tests/bp.ok, tests/divi.c, tests/divi.ok, tests/fib.c, tests/fib.ok,
3203 tests/fibdelay.c, tests/fibdelay.ok, tests/fibit.c, tests/fibit.ok,
3204 tests/funcfp.c, tests/funcfp.ok, tests/incr.c, tests/incr.ok,
3205 tests/ldst.c, tests/ldst.ok, tests/ldxi.c, tests/ldxi.ok,
3206 tests/modi.c, tests/modi.ok, tests/movi.c, tests/movi.ok,
3207 tests/printf.c, tests/printf.ok, tests/printf2.c, tests/printf2.ok,
3208 tests/ret.c, tests/ret.ok, tests/rpn.c, tests/rpn.ok, tests/rpnfp.c,
3209 tests/rpnfp.ok, tests/sete.c, tests/sete.ok, tests/testfp.c,
3210 tests/testfp.ok, tests-run-test: Removed previous test suite, in
3211 favor of a newer one in the check subdirectory.
3212
3213 * check/3to2.ok, check/3to2.tst, check/add.ok, check/add.tst,
3214 check/allocai.ok, check/allocai.tst, check/bp.ok, check/bp.tst,
3215 check/divi.ok, check/divi.tst, check/fib.ok, check/fib.tst:
3216 New sample input for the new test program, loosely matching
3217 several of the previous test cases.
3218
3219 * check/Makefile.am: New test suite makefile.
3220
3221 * check/check.sh, check/run-test: New wrapper files for the
3222 new test suite.
3223
3224 * check/lightning.c: New file. The main driver of the new test
3225 suite, that compiles to a parser of a very simple assembly like
3226 language, generates jit and executes it.
3227
3228 * check/all.tst: New file. A generic debug and sample test file
3229 with a directive to prevent it from being executed, and useful to
3230 read disassembly of all possible instructions, using a fixed set
3231 of registers.
3232
3233 * include/Makefile.am, include/lightning.h,
3234 include/lightning/Makefile.am, include/lightning/jit_arm.h,
3235 include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
3236 include/lightning/jit_private.h, include/lightning/jit_x86.h,
3237 lib/Makefile.am, lib/jit_disasm.c, lib/jit_print.c,
3238 lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c,
3239 lib/jit_x86.c, lib/lightning.c: New files. These files are
3240 written from scratch, only by <pcpa@gnu.org>, and have now
3241 copyright assignment to the FSF. This is the core of the new
3242 lightning rework. Previously it was integrated in code with
3243 a garbage collector and several custom types like vectors and
3244 hash tables, so this first code merge with lightning converts
3245 that code into a library extracting only the jit bits, and at
3246 first only for x86_64 GNU/Linux.
3247
3248 * lightning.h, m4/lightning.m4: Removed. These are no longer
3249 required in the new lightning code.
3250
3251 .gitignore, Makefile.am, configure.ac: Update for the new
3252 lightning code.
3253
32542012-12-02 Paulo Andrade <pcpa@gnu.org>
3255 * .cvsignore: Removed for extra cleanup.
3256
3257 * build-aux: Rename directory to m4.
3258
3259 * m4: Renamed to "default" name and for consistency with merge
3260 with code rework to be imported in lightning.
3261
3262 * .gitignore, configure.ac, Makefile.am, doc/Makefile.am:
3263 Update for build-aux to m4 rename.
3264
32652012-12-01 Paulo Andrade <pcpa@gnu.org>
3266
3267 * opcode/Makefile.am, opcode/Makefile.in, opcode/ansidecl.h,
3268 opcode/bfd.h, opcode/dis-asm.h, opcode/dis-buf.c, opcode/disass.c,
3269 opcode/i386-dis.c, opcode/i386.h, opcode/ppc-dis.c, opcode/ppc-opc.c,
3270 opcode/ppc.h, opcode/sparc-dis.c, opcode/sparc-opc.c, opcode/sparc.h,
3271 opcode/sysdep.h: Removed. Do not bundle GNU binutils files.
3272
3273 * aclocal.m4, configure, Makefile.in, config.h.in, doc/Makefile.in,
3274 lightning/Makefile.in, tests/Makefile.in: Removed. Do not maintain
3275 autogenerated files that also generate too much diff noise when
3276 regenerated in git.
3277
3278 * build-aux/help2man, build-aux/texinfo.tex, build-aux/texi2dvi:
3279 Removed. Buildenvironment must have an up to date version from
3280 upstream installed.
3281
3282 * build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
3283 build-aux/install-sh build-aux/mdate-sh build-aux/missing: Removed.
3284 Do not maintain a copy of automake files in git. Release tarballs
3285 must use an up to date version.
3286
3287 * lightningize.in, doc/lightningize.1: Removed. Do not encourage
3288 bundling lightning in other packages. It should use a system package
3289 or a proper thirdy part subdirectory.
3290
3291 * INSTALL: Removed. Autoreconf removes it and creates a symlink
3292 when regenerating files, so, avoid conflicts in git and let
3293 automake create the symlink.
3294
3295 * .gitignore: Add INSTALL and autogenerated files.
3296
3297 * configure.ac, Makefile.am: Update for removal of opcode subdir,
3298 auto generated files and lightningize.
3299
3300 * tests/Makefile.am, tests/3to2.c, tests/add.c, tests/bp.c,
3301 tests/fib.c, tests/fibdelay.c, tests/fibit.c, tests/funcfp.c,
3302 tests/incr.c, tests/printf.c, tests/rpn.c, tests/rpnfp.c,
3303 tests/sete.c, tests/testfp.c: Update for removal of opcode subdir.
3304
3305 * doc/Makefile.am: Update for removal of lightningize.
3306
3307 * configure.ac, lightning/ppc/funcs.h, lightning/sparc/funcs.h,
3308 lightning/i386/fp.h, lightning/i386/core.h, lightning/i386/asm.h,
3309 tests/3to2.c, tests/add.c, tests/bp.c, tests/fib.c, tests/fibdelay.c,
3310 tests/fibit.c, tests/funcfp.c, tests/incr.c, tests/printf.c,
3311 tests/rpn.c, tests/rpnfp.c, tests/sete.c, tests/testfp.c:
3312 Remove LIGHTNING_CROSS, it is half supported and incomplete.
3313
3314 * tests/3to2.c, tests/funcfp.c, tests/rpnfp.c: Remove preprocessor
3315 check on JIT_FPR. If no hardware registers are available, the backend
3316 must provide an alternative for software float.
3317
3318 * lightning/ppc/core.h, lightning/sparc/core.h, tests/Makefile.am:
3319 Remove JIT_NEED_PUSH_POP. It is absolutely not trivial to implement
3320 properly on some backends due to stack alignment constraints, and
3321 whenever it is required, using jit_allocai and using a properly
3322 aligned stack vector, or a heap buffer, is better.
3323
3324 * tests/push-pop.c, tests/push-pop.ok: Removed due to
3325 JIT_NEED_PUSH_POP no longer available.
3326
33272011-02-28 Paolo Bonzini <bonzini@gnu.org>
3328
3329 * lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_,
3330 fix jit_mul{i,r}_{l,ul}.
3331
33322010-08-20 Paolo Bonzini <bonzini@gnu.org>
3333
3334 * lightning/i386/fp-64.h: Return patch address from jit_bXYr_{f,d}.
3335 Reported by Paulo César Pereira de Andrade.
3336 * lightning/ppc/fp.h: Likewise.
3337 * lightning/sparc/fp.h: Implement FP branches.
3338
33392010-08-18 Paolo Bonzini <bonzini@gnu.org>
3340
3341 * lightning/i386/fp-64.h: Fix jp in jit_bner_{f,d}.
3342
33432010-08-18 Paolo Bonzini <bonzini@gnu.org>
3344
3345 * lightning/i386/fp-32.h: Fix -D_ASM_SAFETY compilation.
3346 Reported by Paulo César Pereira de Andrade.
3347
33482010-08-15 Paolo Bonzini <bonzini@gnu.org>
3349
3350 * tests/ldst.c: Update.
3351 * tests/Makefile.am: Use -ffloat-store to compile it.
3352
33532010-08-15 Paolo Bonzini <bonzini@gnu.org>
3354
3355 * lightning/i386/core.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
3356 jit_ldxr_s): Move...
3357 * lightning/i386/core-32.h: ... here.
519a9ea1 3358 * lightning/i386/core-64.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s):
4a71579b
PC
3359 Use movsbq and movswq.
3360
33612010-08-10 Paulo César Pereira de Andrade <pcpa@mandriva.com.br>
3362
3363 * lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir.
3364 (jit_movbrm): Check index register as well.
3365 * lightning/i386/fp-64.h: Add jit_extr_f_d and jit_extr_d_f.
3366 * lightning/fp-common.h: Add jit_extr_f_d and jit_extr_d_f.
3367
33682010-07-28 Paolo Bonzini <bonzini@gnu.org>
3369
3370 * tests/Makefile.am: Add ldst test.
3371 * tests/Makefile.in: Regenerate.
3372 * tests/ldst.c: New.
3373 * tests/ldst.ok: New.
3374
33752010-07-28 Paolo Bonzini <bonzini@gnu.org>
3376
3377 * THANKS: Add Paulo Cesar Pereira de Andrade.
3378 * doc/porting.texi: Fix ordering of arguments in jit_stxi.
3379 * lightning/i386/core-32.h (jit_replace): Remove cmp argument.
3380 * lightning/i386/fp-64.h (jit_movi_f): Fix.
3381
33822010-07-26 Paolo Bonzini <bonzini@gnu.org>
3383
3384 * lightning/i386/core-32.h (jit_replace): Move here (removed
3385 2009-03-01).
3386
33872010-07-19 Paolo Bonzini <bonzini@gnu.org>
3388
3389 * build-aux/lightning.m4: Always set and replace lightning_frag.
3390 * Makefile.in: Regenerate.
3391 * aclocal.m4: Regenerate.
3392 * config.h.in: Regenerate.
3393 * configure: Regenerate.
3394 * doc/Makefile.in: Regenerate.
3395 * doc/lightningize.1: Regenerate.
3396 * doc/version.texi: Regenerate.
3397 * lightning/Makefile.in: Regenerate.
3398 * opcode/Makefile.in: Regenerate.
3399 * tests/Makefile.in: Regenerate.
3400
34012009-03-01 Paolo Bonzini <bonzini@gnu.org>
3402
3403 * lightning/i386/core-64.h: Use Mike's macros for x86-64 too.
3404 * lightning/i386/core.h: Remove jit_replace.
3405
3406 2009-02-27 Mike Spivey <mike@comlab.ox.ac.uk>
3407
3408 * lightning/i386/core.h: Rewrite shift-handling macros.
3409 * lightning/fp-common.h: Fix jit_extr_{f_d,d_f}.
3410
34112009-02-17 Mike Spivey <mike@comlab.ox.ac.uk>
3412
3413 * lightning/i386/core.h: Fix blunder in operand order.
3414
34152009-02-17 Paolo Bonzini <bonzini@gnu.org>
3416
3417 * lightning/i386/fp-32.h: Another fix to jit_fp_btest.
3418
34192009-02-17 Paolo Bonzini <bonzini@gnu.org>
3420
3421 * lightning/fp-common.h: Define double branches if missing.
3422 * lightning/i386/asm.h: Define JC and JNC mnemonics.
3423 * lightning/i386/fp-32.h: Fix jit_fp_btest. All reported
3424 by Mike Spivey.
3425
34262008-10-09 Paolo Bonzini <bonzini@gnu.org>
3427
3428 * lightning/ppc/funcs.h (jit_flush_code): Subtract 1 from end.
3429 Reported by Eli Barzilay and Matthew Flatt.
3430
34312008-08-23 Nix <nix@esperi.org.uk>
3432
3433 * lightning/i386/Makefile.frag: fp-32.h and fp-64.h are target files.
3434
34352008-07-02 Laurent Michel <ldm@engr.uconn.edu>
3436
3437 * lightning/ppc/funcs.h (jit_flush_code): modified the computation
3438 of start/end. The pointer arithmetic was done without casting. It
519a9ea1 3439 prevented compilation with recent gcc versions.
4a71579b
PC
3440 * lightning/ppc/core.h (jit_pushr_i): The offset for the store was
3441 incorrect. Should have been 4 bytes below SP (not above).
519a9ea1
PC
3442 * lightning/ppc/core.h (jit_popr_i): The offset for the load was
3443 incorrect. Should have been 0 (not +8).
4a71579b
PC
3444
34452008-06-17 Paolo Bonzini <bonzini@gnu.org>
3446
3447 * lightning/i386/asm-64.h: Forward IMULQir to IMULQirr,
3448 fix REXQ order for IMULQirr.
3449
34502008-06-17 Paolo Bonzini <bonzini@gnu.org>
3451
3452 * lightning/i386/core.h: Fix _rN vs. _rR.
3453
34542008-06-16 Paolo Bonzini <bonzini@gnu.org>
3455
3456 * lightning/i386/core.h: Use jit_save in jit_replace. Move JIT_R
3457 definition...
3458 * lightning/i386/core-32.h: ... here; define jit_save so that
3459 the core.h has no effect on the 32-bit backend.
3460 * lightning/i386/core-64.h: Place JIT_R1/JIT_R2 in R10/R11,
3461 place outgoing arguments in the right spot from the beginning,
3462 define jit_save, fix jit_reg8/jit_reg16.
3463
34642008-06-15 Paolo Bonzini <bonzini@gnu.org>
3465
3466 * lightning/i386/core-64.h: Rewrite argument passing to
3467 support up to 6 arguments and generate less code.
3468
34692008-06-14 Laurent Michel <ldm@thorgal.homelinux.org>
3470
3471 * lightning/i386/core-64.h (jit_movi_l): When the operand is 0,
3472 the XOR should be on a quadword.
3473 * lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack
3474 alignment.
3475 (jit_ret): Always use LEAVE.
3476
34772008-06-13 Laurent Michel <ldm@thorgal.homelinux.org>
3478
3479 * lightning/i386/core-64.h: Add (void) casts for C++ compatibility.
3480 * lightning/i386/asm.h: Likewise.
3481
34822008-06-12 Paolo Bonzini <bonzini@gnu.org>
3483
3484 * lightning/i386/core.h: Move JIT_V definition...
3485 * lightning/i386/core-32.h: ... here.
3486 * lightning/i386/core-64.h: ... and here. Avoid dancing between
3487 RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13.
3488
34892008-06-11 Paolo Bonzini <bonzini@gnu.org>
3490
3491 * build-aux/lightning.m4: Adjust LIGHTNING_BACKENDS, don't
3492 use suffix support to distinguish i386/x86_64.
3493 * lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES
3494 to distribute *-32.h and *-64.h files now.
3495 * lightning/i386/asm-i386: Moved to...
3496 * lightning/i386/asm.h: Include the appropriate subtarget file.
3497 * lightning/i386/core-i386: Moved to...
3498 * lightning/i386/core.h: Include the appropriate subtarget file.
3499 * lightning/i386/fp.h: New, include the appropriate subtarget file.
3500 * lightning/i386/asm-32: Do not include asm-i386.h.
3501 * lightning/i386/asm-64.h: Likewise.
3502 * lightning/i386/core-32: Do not include core-i386.h.
3503 * lightning/i386/core-64.h: Likewise.
3504 * lightning/Makefile.am: Adjust for renamed files.
3505
3506 * configure.ac: Define LIGHTNING_TARGET here.
3507 * opcode/disass.c: Change list of valid LIGHTNING_TARGET values.
3508
3509 * lightningize.in: Robustify against missing subtarget files.
3510
35112008-06-11 Paolo Bonzini <bonzini@gnu.org>
3512
3513 * lightning/i386/core-32.h: Use MOVLir instead of jit_movi_l
3514 to implement jit_movi_p.
3515
35162008-06-11 Paolo Bonzini <bonzini@gnu.org>
3517
3518 * lightning/i386/core-32.h: Use separate __APPLE__ and SysV
3519 prolog/ret macros. Subtract 12 bytes in __APPLE__ case to
3520 keep stack aligned, and always use LEAVE in the epilog.
3521
35222008-06-11 Paolo Bonzini <bonzini@gnu.org>
3523
3524 * lightning/i386/core-i386.h: Fix C++ incompatibility.
3525
35262008-06-10 Laurent Michel <ldm@engr.uconn.edu>
3527
3528 * lightning/i386/core-i386.h: Fix jit_replace8 for
3529 case when one of the operands is _EAX.
3530
35312008-05-19 Paolo Bonzini <bonzini@gnu.org>
3532
3533 * tests/run-test: Avoid CRLF issues on mingw.
3534
35352008-03-21 Paolo Bonzini <bonzini@gnu.org>
3536
3537 * lightning/i386/core-64.h: Fix jit_{ld,st}{,x}i_{i,l}.
3538 Remove jit_ld{,x}i_ul.
3539 * lightning/core-common.h: Make jit_ld{,x}{i,r}_ul
3540 always a synonym of the _l variant.
3541 * doc/porting.texi: Document this.
3542
35432008-03-19 Paolo Bonzini <bonzini@gnu.org>
3544
3545 * lightning/i386/core-64.h: Fix uses of jit_qop_.
3546
35472008-03-19 Paolo Bonzini <bonzini@gnu.org>
3548
3549 * lightning/i386/core-64.h: Add boolean operations.
3550
35512008-03-19 Paolo Bonzini <bonzini@gnu.org>
3552
3553 * lightning/i386/asm-64.h: Add LEAQmr.
3554
35552008-03-19 Paolo Bonzini <bonzini@gnu.org>
3556
3557 * lightning/i386/core-64.h: Misc bugfixes.
3558
35592008-03-19 Paolo Bonzini <bonzini@gnu.org>
3560
3561 * lightning/i386/core-i386.c: Remove jit_ldr_i, jit_ldxr_i.
3562 * lightning/i386/core-32.h: Add jit_ldr_i, jit_ldxr_i.
3563 * lightning/i386/core-64.h: Add jit_ld{r,xr,i,xi}_{ui,l,ul};
3564 move jit_ldr_i, jit_ldxr_i, jit_str_l, jit_stxr_l with others.
3565
35662008-03-19 Paolo Bonzini <bonzini@gnu.org>
3567
3568 * lightning/asm-common.h: Add _s32P.
3569
35702008-03-19 Paolo Bonzini <bonzini@gnu.org>
3571
3572 * lightning/i386/core-64.h: Implement long mul/div/mod.
3573
35742008-03-19 Paolo Bonzini <bonzini@gnu.org>
3575
3576 * lightning/i386/asm-i386.h: Cast memory address to long for JCCim.
3577
35782008-03-15 Paolo Bonzini <bonzini@gnu.org>
3579
3580 * lightning/asm-common.h: Add underscores around __unused__
3581 attribute.
3582
35832008-03-15 Paolo Bonzini <bonzini@gnu.org>
3584
3585 * lightning/ppc/core.h: Avoid some "value computed is not used"
3586 warnings.
3587 * lightnings/tests/allocai.c: Silence other warnings.
3588
35892008-03-14 Paolo Bonzini <bonzini@gnu.org>
3590
3591 * lightningize.in: Fix some problems (not all).
3592
35932008-03-14 Paolo Bonzini <bonzini@gnu.org>
3594
3595 * lightning/i386/core-32.h: Avoid some "value computed is not used"
3596 warnings; reported by Sam Steingold.
3597
35982008-03-08 Paolo Bonzini <bonzini@gnu.org>
3599
3600 * lightning/i386/core-32.h: Fix stxr_c(_EAX, _EBX, _ESI).
3601
36022008-02-13 Paolo Bonzini <bonzini@gnu.org>
3603
3604 * lightning/i386/asm-32.h: Avoid redefinition of _r1, reported by
3605 Sam Steingold.
3606 * lightning/i386/asm-64.h: Likewise.
3607
36082008-02-08 Paolo Bonzini <bonzini@gnu.org>
3609
3610 * lightning/i386/asm-i386.h: Don't define _VOID, reported
3611 by Reini Urban.
3612
36132008-02-03 Paolo Bonzini <bonzini@gnu.org>
3614
3615 * build-aux/lightning.m4: Add --with-lightning-prefix option, suggested
3616 by Sam Steingold.
3617
36182008-01-14 Paolo Bonzini <bonzini@gnu.org>
3619
3620 * lightning/i386/core-64.h: Use CALLsr, not CALLLsr.
3621
36222008-01-13 Paolo Bonzini <bonzini@gnu.org>
3623
3624 * lightning/i386/core-i386.h: Move jit_calli and jit_callr...
3625 * lightning/i386/core-32.h: ... here.
3626 * lightning/i386/core-64.h: Redefine them.
3627
36282008-01-05 Paolo Bonzini <bonzini@gnu.org>
3629
3630 * lightning/i386/fp-32.h: Fix sub(a,0,a).
3631 * lightning/tests/3to2.c: Add new testcases.
3632 * lightning/tests/3to2.ok: Add new testcases.
3633
36342008-01-02 Paolo Bonzini <bonzini@gnu.org>
3635
3636 * lightning/i386/fp-32.h: Fix sub(a,b,a) with a ~= JIT_FPR0.
3637 * lightning/tests/3to2.c: New.
3638 * lightning/tests/3to2.ok: New.
3639
36402007-11-07 Paolo Bonzini <bonzini@gnu.org>
3641
3642 * opcode/Makefile.am: Fix AM_CPPFLAGS.
3643
36442007-08-12 Paolo Bonzini <bonzini@gnu.org>
3645
3646 * lightning/i386/core-i386.h: Improve encoding of set* instructions.
3647 * lightning/i386/core-64.h: Fix jit_bra_l.
3648 * tests/sete.c: New.
3649 * tests/sete.ok: New.
3650
36512007-06-29 Paolo Bonzini <bonzini@gnu.org>
3652
3653 * tests/bp.c: Upgrade to GPL/LGPLv3.
3654 * lightning/i386/asm-32.h: Upgrade to GPL/LGPLv3.
3655 * lightning/i386/asm-64.h: Upgrade to GPL/LGPLv3.
3656 * lightning/i386/core-32.h: Upgrade to GPL/LGPLv3.
3657 * lightning/i386/core-64.h: Upgrade to GPL/LGPLv3.
3658 * lightning/i386/fp-64.h: Upgrade to GPL/LGPLv3.
3659 * lightning/sparc/asm.h: Upgrade to GPL/LGPLv3.
3660 * lightning/sparc/core.h: Upgrade to GPL/LGPLv3.
3661 * lightning/sparc/fp.h: Upgrade to GPL/LGPLv3.
3662 * lightning/sparc/funcs.h: Upgrade to GPL/LGPLv3.
3663 * lightning/i386/asm-i386.h: Upgrade to GPL/LGPLv3.
3664 * lightning/i386/core-i386.h: Upgrade to GPL/LGPLv3.
3665 * lightning/i386/fp-32.h: Upgrade to GPL/LGPLv3.
3666 * lightning/i386/funcs.h: Upgrade to GPL/LGPLv3.
3667 * lightning/ppc/asm.h: Upgrade to GPL/LGPLv3.
3668 * lightning/ppc/core.h: Upgrade to GPL/LGPLv3.
3669 * lightning/ppc/fp.h: Upgrade to GPL/LGPLv3.
3670 * lightning/ppc/funcs.h: Upgrade to GPL/LGPLv3.
3671 * lightning.h: Upgrade to GPL/LGPLv3.
3672 * tests/add.c: Upgrade to GPL/LGPLv3.
3673 * tests/fib.c: Upgrade to GPL/LGPLv3.
3674 * tests/testfp.c: Upgrade to GPL/LGPLv3.
3675 * tests/fibdelay.c: Upgrade to GPL/LGPLv3.
3676 * tests/fibit.c: Upgrade to GPL/LGPLv3.
3677 * tests/funcfp.c: Upgrade to GPL/LGPLv3.
3678 * tests/incr.c: Upgrade to GPL/LGPLv3.
3679 * tests/printf.c: Upgrade to GPL/LGPLv3.
3680 * tests/printf2.c: Upgrade to GPL/LGPLv3.
3681 * tests/rpn.c: Upgrade to GPL/LGPLv3.
3682 * tests/rpnfp.c: Upgrade to GPL/LGPLv3.
3683 * lightning/asm-common.h: Upgrade to GPL/LGPLv3.
3684 * lightning/core-common.h: Upgrade to GPL/LGPLv3.
3685 * lightning/fp-common.h: Upgrade to GPL/LGPLv3.
3686 * lightning/funcs-common.h: Upgrade to GPL/LGPLv3.
3687 * opcode/dis-buf.c: Upgrade to GPL/LGPLv3.
3688 * opcode/disass.c: Upgrade to GPL/LGPLv3.
3689 * opcode/i386-dis.c: Upgrade to GPL/LGPLv3.
3690 * opcode/sparc-dis.c: Upgrade to GPL/LGPLv3.
3691 * opcode/sparc-opc.c: Upgrade to GPL/LGPLv3.
3692 * lightningize.in: Upgrade to GPL/LGPLv3.
3693 * opcode/bfd.h: Upgrade to GPL/LGPLv3.
3694 * opcode/i386.h: Upgrade to GPL/LGPLv3.
3695 * opcode/sparc.h: Upgrade to GPL/LGPLv3.
3696
36972007-01-26 Thomas Girard <thomas.g.girard@free.fr>
3698
3699 * lightning/Makefile.am: Add clean-local target.
3700
37012006-12-02 Paolo Bonzini <bonzini@gnu.org>
3702
3703 * lightning/i386/asm-i386.h: Add CVTTS?2SIL.
3704 * lightning/i386/asm-64.h: Add CVTTS?2SIQ.
3705 * lightning/i386/fp-64.h: Use it.
3706
3707 * lightning/Makefile.am: Place files in nodist_lightning_HEADERS.
3708
37092006-11-23 Paolo Bonzini <bonzini@gnu.org>
3710
3711 * lightning/core-common.h: Add casts in "*i_p" variants.
3712 * lightning/i386/asm-32.h: Add _r1.
3713 * lightning/i386/asm-64.h: Likewise, and add SSE instructions.
3714 * lightning/i386/asm-i386.h: Merge SSE instructions from Gwenole.
3715 Use short form for 16-bit AX instructions. Remove _r1
3716 * lightning/i386/core-64.h: Add FP ABI support in its infancy.
3717 * lightning/i386/core-i386.h: Move jit_arg_f and jit_arg_d...
3718 * lightning/i386/core-32.h: ... and jit_prepare_f and jit_prepare_d...
3719 * lightning/i386/fp-32.h: ... here.
3720 * lightning/i386/fp-64.h: Write the code.
3721 * lightning/sparc/fp.h: Fix jit_extr_{f_d,d_f} register order.
519a9ea1 3722
4a71579b
PC
37232006-11-22 Paolo Bonzini <bonzini@gnu.org>
3724
3725 * lightning/i386/asm-i386.h: Move x86-64 instructions...
3726 * lightning/i386/asm-64.h: ... here.
3727 * lightning/i386/fp-32.h: Fix bugfixes worked around in froofyJIT.
3728 Add JIT_FPRET.
3729 * lightning/sparc/fp.h: Likewise.
3730 * lightning/ppc/fp.h: Likewise.
3731 * lightning/fp-common.h: Adjust for JIT_FPRET.
3732 * tests/funcfp.c: Adjust for JIT_FPRET.
3733 * tests/rpnfp.c: Adjust for JIT_FPRET.
3734
37352006-11-20 Paolo Bonzini <bonzini@gnu.org>
3736
3737 * lightning/i386/asm-i386.h: Add an underscore to macros without
3738 a parameter.
3739
37402006-11-20 Paolo Bonzini <bonzini@gnu.org>
3741
3742 * lightning/i386/core-i386.h: Move jit_movip, jit_check8, jit_reg8,
3743 jit_reg16, jit_movbrm...
3744 * lightning/i386/core-32.h: ... here.
3745 * lightning/i386/core-64.h: Redefine them. Fix other bugs.
3746
3747 * tests/printf.c: Do not do a varargs call.
3748
37492006-11-20 Paolo Bonzini <bonzini@gnu.org>
3750
3751 * lightning/i386/asm-i386.h: Check in rewrite from Basilisk II.
3752 * lightning/i386/asm-32.h: Adjust.
3753 * lightning/i386/asm-64.h: Adjust.
3754 * lightning/i386/fp-32.h: Adjust.
3755
3756 * lightning/i386/core-32.h: Adjust. Add jit_{ld,ldx,st,stx}i*.
3757 * lightning/i386/core-64.h: Adjust. Add jit_{ld,ldx,st,stx}i*.
3758 * lightning/i386/core-i386.h: Adjust. Remove these patterns.
3759
37602006-11-20 Paolo Bonzini <bonzini@gnu.org>
3761
3762 * lightning/i386/asm-i386.h: Merge 64-bit cleanliness changes from
3763 mzscheme.
3764 Add SSE.
3765 * lightning/i386/asm-64.h: Likewise.
3766
37672006-11-20 Paolo Bonzini <bonzini@gnu.org>
3768 Ludovic Courtes <ludo@chbouib.org>
3769
3770 * lightning/i386/core-32.h: Disable jit_push and jit_pop if stack not
3771 needed.
3772 * lightning/i386/core-64.h: Disable jit_push and jit_pop if stack not
3773 needed.
3774 * lightning/sparc/core.h: Merge final implementation of jit_pushr and
3775 jit_popr.
3776 * lightning/ppc/core.h: Fix implementation of jit_pushr and jit_popr to
3777 work (more or less) across function calls.
3778
3779 * tests/push-pop.c, tests/push-pop.ok: New test.
3780 * tests/Makefile.am: Run it.
3781
37822006-11-20 Paolo Bonzini <bonzini@gnu.org>
3783
3784 * lightning/asm-common.h: Make 64-bit safe.
3785 * lightning/i386/funcs.h: Make 64-bit safe.
3786
3787 * lightning/i386/asm-64.h: More merge from mzscheme.
3788 * lightning/i386/asm-i386.h: More merge from mzscheme.
3789 * lightning/i386/core-32.h: More merge from mzscheme.
3790 * lightning/i386/core-64.h: More merge from mzscheme.
3791 * lightning/i386/core-i386.h: More merge from mzscheme.
3792
3793 * tests/rpnfp.c, tests/testfp.c, tests/funcfp.c: Skip if no
3794 floating-point support.
3795
37962006-11-04 Paolo Bonzini <bonzini@gnu.org>
3797
3798 * tests/rpn.c: Remove pushr/popr.
3799
38002006-11-04 Paolo Bonzini <bonzini@gnu.org>
3801
3802 * lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.
3803 * lightning/ppc/funcs.h: Store frame size into _jitl. Store R1 before
3804 the STMW, so that the offset is unchanged when we patch the STMW.
3805 * lightning/i386/core.h: Define JIT_FP to be EBP.
3806 * lightning/i386/core-32.h: Implement jit_allocai, put LEAVE in the
3807 epilog if jit_allocai was used.
3808 * lightning/i386/core-64.h: Implement jit_allocai, put LEAVE in the
3809 epilog if jit_allocai was used.
3810
38112006-11-04 Ludovic Courtes <ludo@chbouib.org>
3812
3813 * lightning/sparc/core.h: Implement jit_allocai.
3814 * tests/allocai.c: New.
3815 * tests/Makefile.am: Point to new tests.
3816
38172006-11-03 Paolo Bonzini <bonzini@gnu.org>
3818
3819 * lightning/ppc/core.h: Fix jit_bms using BNE rather than BGT.
3820 "AND." does signed comparisons.
3821
38222006-10-31 Paolo Bonzini <bonzini@gnu.org>
3823
3824 * doc/porting.texi: Rename JIT_FP to JIT_AP.
3825 * lightning/core-common.h: Likewise.
3826 * lightning/i386/core-i386.h: Likewise.
3827 * lightning/fp-common.h: Provide default versions of jit_getarg_[fd].
3828 * lightning/i386/fp-32.h: Don't provide jit_getarg_[fd].
3829 * lightning/ppc/fp.h: Likewise.
3830
38312006-10-31 Ludovic Courtes <ludo@chbouib.org>
3832
3833 * doc/using.texi (The instruction set): Clarified the use of `JIT_RET' and
3834 documented `jit_retval'.
3835 * tests/ret.c (generate_function_proxy): After `jit_finish', use
3836 `jit_retval_i' to move FUNC's return value into the correct register.
3837
38382006-10-31 Paolo Bonzini <bonzini@gnu.org>
3839 Ludovic Courtes <ludo@chbouib.org>
3840
3841 * tests/divi.c, tests/divi.ok, tests/movi.c, tests/movi.ok: New.
3842 * tests/ldxi.c: Ensure large pointer is generated.
3843 * tests/Makefile.am: Point to new tests.
3844 * lightning.h: Include funcs-common.h before funcs.h.
3845 * lightning/sparc/core.h: Fix bugs in modi/divi.
3846
38472006-10-30 Paolo Bonzini <bonzini@gnu.org>
3848
3849 * lightning/Makefile.am: Use "ln -sf".
3850 * lightning/core-common.h: Define jit_negr_l if necessary.
3851
38522006-10-30 Paolo Bonzini <bonzini@gnu.org>
3853
3854 * lightning/i386/asm.h (MOVS*, MOVZ*): Use correct _r[124] macros.
3855
38562006-10-29 Paolo Bonzini <bonzini@gnu.org>
3857
3858 * configure.ac: Use lightning.m4 macros.
3859 * lightning.m4: Refactor to use common code in configure.ac. Move...
3860 * build-aux/lightning.m4: ... here.
3861 * lightningize.in: Support suffixes.
3862 * opcode/disass.in: Adapt to changes in configure.ac.
3863
3864 * lightning/ppc/funcs.h: Use __APPLE__ instead of _CALL_DARWIN.
3865 * lightning/i386/core-32.h: Likewise.
3866
38672006-10-26 Paolo Bonzini <bonzini@gnu.org>
3868
3869 * configure.ac: Fix compilation test.
3870 * lightning/Makefile.am: Symlink LIGHTNING_TARGET_FILES in
3871 non-distribution mode.
3872 * lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES.
3873
38742006-10-26 Paolo Bonzini <bonzini@gnu.org>
3875
3876 * configure.ac: Subst cpu.
3877 * lightning/core-common.h: Make tests pass on i386.
3878 * lightning/i386/asm-32.h: Make tests pass on i386.
3879 * lightning/i386/asm-64.h: Make tests pass on i386.
3880 * lightning/i386/asm-i386.h: Make tests pass on i386.
3881 * lightning/i386/core-32.h: Make tests pass on i386.
3882 * lightning/i386/core-64.h: Make tests pass on i386.
3883 * lightning/i386/core-i386.h: Make tests pass on i386.
3884 * tests/Makefile.am: Include files from cpu directory.
3885
38862006-10-26 Paolo Bonzini <bonzini@gnu.org>
3887
3888 * lightning/i386/asm.h: Move to asm-i386.h
3889 * lightning/i386/asm-32.h: New, from Matthew Flatt.
3890 * lightning/i386/asm-64.h: New, from Matthew Flatt.
3891 * lightning/i386/core.h: Move to core-i386.h
3892 * lightning/i386/core-32.h: New, from Matthew Flatt.
3893 * lightning/i386/core-64.h: New, from Matthew Flatt.
3894 * lightning/i386/fp.h: Move to fp-32.h
3895 * lightning/i386/fp-64.h: New, dummy.
3896 * lightning/i386/Makefile.frag: New.
3897 * lightning/Makefile.am: Support per-target Makefile fragments.
3898 * configure.ac: Support per-target Makefile fragments and CPU suffixes.
3899
39002006-10-16 Paolo Bonzini <bonzini@gnu.org>
3901
3902 * lightning/i386/i386.h (jit_flush_code): Fix syntax error. :-(
3903
39042006-07-06 Paolo Bonzini <bonzini@gnu.org>
3905 Ludovic Courtes <ludovic.courtes@laas.fr>
3906
3907 * doc/using.texi: Clarify "Using autoconf" section
3908 and rename it to "Bundling lightning"
3909 * lightning.m4: Work also if lightning is not bundled.
3910
39112006-07-06 Paolo Bonzini <bonzini@gnu.org>
3912 Ludovic Courtes <ludovic.courtes@laas.fr>
3913
3914 * lightning/ppc/core.h (_jit_mod): Replace with...
3915 (_jit_mod_big, _jit_mod_small): ... these.
3916 (jit_modi_i, jit_modi_ui): Rewrite.
3917 * tests/modi.c, tests/modi.ok: New tests.
3918
39192006-05-18 Matthew Flatt <mflatt@cs.utah.edu>
3920
3921 * lightning/i386/asm.h: Fix test for extending the mprotect area
3922 towards lower addresses.
3923
39242006-05-16 Bruno Haible <bruno@clisp.org>
3925
3926 * lightning/asm-common.h: Don't use __func__ nor __FUNCTION__ if
3927 not compiling with GNU C.
3928
39292006-02-16 Paolo Bonzini <bonzini@gnu.org>
3930
3931 * lightning/ppc/core.h: Fix jit_ldxi_* with big displacement.
3932
39332006-01-23 Paolo Bonzini <bonzini@gnu.org>
3934
3935 * configure.ac: Fix comments in config.h.in.
519a9ea1 3936
4a71579b
PC
39372005-11-25 Paolo Bonzini <bonzini@gnu.org>
3938
3939 * lightning/sparc/fp.h: Fix header comment.
3940 * lightning/ppc/fp.h: Fix header comment.
3941
39422005-04-27 Paolo Bonzini <bonzini@gnu.org>
3943
3944 * lightning/i386/asm.h (JCm, JCSm, JNCm, JNCSm): New.
3945
39462004-11-26 Paolo Bonzini <bonzini@gnu.org>
3947
3948 * lightning/ppc/funcs.h (_jit_epilog): Remove unused variable.
3949
39502004-11-13 Paolo Bonzini <bonzini@gnu.org>
3951
3952 * lightning/i386/funcs.h [__linux__]: Include sys/mman.h.
3953
39542004-11-09 Paolo Bonzini <bonzini@gnu.org>
3955
3956 * lightning/sparc/fp.h: Fix fp-to-integer conversions.
3957 * lightning/ppc/testfp.c: Test fp-to-integer conversions
3958 of integer numbers.
3959 * lightning/ppc/testfp.ok: Adjust for the above.
3960
39612004-11-08 Paolo Bonzini <bonzini@gnu.org>
3962
3963 * lightning/ppc/testfp.c: Always flush code before
3964 testing it.
3965
39662004-11-08 Paolo Bonzini <bonzini@gnu.org>
3967
3968 * lightning/ppc/fp.h: Do not clobber f31.
3969
39702004-11-08 Paolo Bonzini <bonzini@gnu.org>
3971
3972 * lightning.h: New name of...
3973 * lightning-inst.h: ... this file.
3974 * lightning.h.in: Removed.
3975
3976 * opcodes/disass.c: Include config.h.
3977 * tests/add.c: Include config.h.
3978 * tests/bp.c: Include config.h.
3979 * tests/fib.c: Include config.h.
3980 * tests/fibdelay.c: Include config.h.
3981 * tests/fibit.c: Include config.h.
3982 * tests/funcfp.c: Include config.h.
3983 * tests/incr.c: Include config.h.
3984 * tests/printf.c: Include config.h.
3985 * tests/printf2.c: Include config.h.
3986 * tests/rpn.c: Include config.h.
3987 * tests/rpnfp.c: Include config.h.
3988 * tests/testfp.c: Include config.h.
3989
39902004-10-12 Paolo Bonzini <bonzini@gnu.org>
3991
3992 * lightning/i386/fp.h: Fix bugs in conditional branches.
3993
39942004-10-10 Paolo Bonzini <bonzini@gnu.org>
3995
3996 * lightning/i386/funcs.h: Fix pasto in jit_flush_code.
3997
39982004-10-08 Paolo Bonzini <bonzini@gnu.org>
3999
4000 * lightning/ppc/fp.h: Optimized conditional branches.
4001
40022004-09-20 Paolo Bonzini <bonzini@gnu.org>
4003
4004 * lightning/ppc/asm.h: Fix more typos.
4005
40062004-09-20 Paolo Bonzini <bonzini@gnu.org>
4007
4008 * lightning/ppc/asm.h: Fix typos, replace `26' with JIT_AUX.
4009
40102004-09-20 Paolo Bonzini <bonzini@gnu.org>
4011
4012 * lightning/ppc/fp.h: Added conditional branches.
4013
40142004-09-18 Laurent Michel <ldm@thorgal.homelinux.org>
4015
4016 * lightning/ppc/fp.h (jit_unler_d, jit_unltr_d, jit_unger_d,
4017 jit_ungtr_d, jit_ltgt_d, jit_uneq_d): Implemented missing tests
4018 to fully support testfp.
4019 (jit_floorr_d_i, jit_ceilr_d_i, jit_roundr_d_i, jit_truncr_d_i):
4020 New macros.
4021 * lightning/ppc/asm.h: Added missing opcodes FCTIWZ and MTFSFI.
4022 * lightning/ppc/funcs.h (_jit_prolog): Fixed minor mistake in
4023 the initialization of _jitl.nextarg_geti, relying on the
4024 JIT_AUX macro as well to get the register offset.
4025
40262004-09-07 Paolo Bonzini <bonzini@gnu.org>
4027
4028 * lightning/ppc/funcs.h: Fix typo.
4029
40302004-09-06 Paolo Bonzini <bonzini@gnu.org>
4031
4032 * tests/funcfp.c: Use %g. Remove C99 variable declarations.
4033 * tests/testfp.c: Don't use __builtin_nan.
4034
4035 * lightning/ppc/core.h: Add three V registers.
4036 * lightning/ppc/funcs.h: Adjust.
4037
4038 * lightning/sparc/core.h: Some fixes related to FP argument passing.
4039 Move R0 to %g2, use %o7 for JIT_BIG2.
4040 * lightning/sparc/fp.h: Some fixes related to FP argument passing.
4041
40422004-09-02 Paolo Bonzini <bonzini@gnu.org>
4043
4044 * lightning/sparc/core.h: Add another V register,
4045 move R0 to %o7.
4046
40472004-07-15 Paolo Bonzini <bonzini@gnu.org>
4048
4049 * lightning/i386/funcs.h: Implement jit_flush_code,
4050 in order to support Fedora's exec-shield.
4051
40522004-07-14 Paolo Bonzini <bonzini@gnu.org>
4053
4054 * lightning/core-common.h: Add more jit_extr_*_* macros.
4055 * lightning/doc/using.texi: Be clearer about the order
4056 of arguments in jit_extr_*_*.
4057 * lightning/doc/porting.texi: Add more jit_extr_*_* macros.
4058 * lightning/i386/fp.h: Fix typo in jit_extr_i_d.
4059
40602004-07-14 Paolo Bonzini <bonzini@gnu.org>
4061
4062 * lightning/ppc/funcs.h: Adjust offset of LR into
4063 stack frame if running under the Darwin ABI.
4064
40652004-07-13 Paolo Bonzini <bonzini@gnu.org>
4066
4067 * lightning/i386/fp.h: Rename jit_exti_d to jit_extr_i_d.
4068
40692004-07-13 Paolo Bonzini <bonzini@gnu.org>
4070
4071 * lightning/ppc/core.h: Fix thinko.
4072
4073 * lightning/i386/core.h: Fix jit_lti_ui.
4074 * lightning/core-common.h: Add missing macros.
4075
4076 * lightning/ppc/fp.h: Rename jit_neg_* to jit_negr_*.
4077 * lightning/i386/fp.h: Rename jit_neg_* to jit_negr_*.
4078 * lightning/sparc/fp.h: Rename jit_neg_* to jit_negr_*.
4079 * lightning/fp-common.h: Rename jit_neg_* to jit_negr_*.
4080 * doc/porting.texi: Add undocumented macros.
4081
40822004-07-12 Paolo Bonzini <bonzini@gnu.org>
4083
4084 * doc/porting.texi: Add missing macros.
4085
40862004-07-12 Paolo Bonzini <bonzini@gnu.org>
4087
4088 * lightning/ppc/funcs.h: Don't generate trampolines.
4089 Separate prolog and epilog generation.
4090 * lightning/ppc/core.h: Generate epilog explicitly.
4091 Don't reserve r31 anymore.
4092 * lightning/core-common.h: Remove call to jit_setup_code.
4093
40942004-07-09 Paolo Bonzini <bonzini@gnu.org>
4095
4096 * lightning/lightning.h.in: Avoid preprocessor warnings.
4097 * lightning/lightning-inst.h: Likewise.
4098
4099 * lightning/i386/core.h: Define JIT_R, JIT_R_NUM, JIT_V,
4100 JIT_V_NUM.
4101 * lightning/ppc/core.h: Likewise.
4102 * lightning/sparc/core.h: Likewise.
4103 * lightning/i386/fp.h: Define JIT_FPR, JIT_FPR_NUM.
4104 * lightning/ppc/fp.h: Likewise.
4105 * lightning/sparc/fp.h: Likewise.
4106 * lightning/core-common.h: Define fixed register names.
4107 * lightning/fp-common.h: Likewise for FP regs.
4108
41092004-07-09 Paolo Bonzini <bonzini@gnu.org>
4110
4111 * lightning/ppc/funcs.h: Fix location where return address
4112 is stored.
4113 * lightning/i386/asm.h: Add a trailing _ to opcodes without
4114 any parameter.
4115 * lightning/i386/core.h: Adjust for the above.
4116
41172004-04-15 Paolo Bonzini <bonzini@gnu.org>
4118
4119 * lightning/i386/fp.h: Change "and" to "_and"
4120 to satisfy C++ compilers.
4121
41222004-04-14 Paolo Bonzini <bonzini@gnu.org>
4123
4124 * lightning/sparc/fp.h: Use memcpy to implement jit_movi.
4125 * lightning/ppc/fp.h: Use memcpy to implement jit_movi.
4126 Move floating-point opcodes...
4127 * lightning/ppc/asm.h: ... here.
4128
41292004-04-14 Paolo Bonzini <bonzini@gnu.org>
4130
4131 * lightning/core-common.h: Add jit_finishr.
4132 * lightning/ppc/core.h: Add jit_callr and jit_finishr.
4133 * lightning/i386/core.h: Add jit_callr.
4134 * lightning/sparc/core.h: Add jit_callr. Fix typo.
4135
41362004-04-14 Paolo Bonzini <bonzini@gnu.org>
4137
4138 * lightning/i386/core.h: Fix pasto in jit_b*_ui.
4139
41402004-03-30 Laurent Michel
4141
4142 * lightning/ppc: Implement PowerPC floating point
4143 (ChangeLog entry missing).
4144
41452004-03-12 Paolo Bonzini <bonzini@gnu.org>
4146
4147 * lightning/fp-common.h: Load/store macros are not the
4148 same for floats and doubles anywhere, but jit_retval may be.
4149 * lightning/i386/asm.h: Fix = mistaken for == in ESCrri.
4150 * lightning/i386/core.h: Fix typo in jit_prepare_[fd].
4151 * lightning/i386/fp.h: Rewritten.
4152 * tests/testfp.c: Add tests for unordered comparisons.
4153 * tests/testfp.ok: Add results.
4154
41552004-03-15 Paolo Bonzini <bonzini@gnu.org>
4156
4157 Merge changes from Laurent Michel.
4158
4159 * lightning/asm-common.h: Add _jit_I_noinc.
4160 * lightning/core-common.h: Support jit_init,
4161 jit_setup_code, jit_patch_at. Return patchable IP from
4162 jit_movi_p.
4163 * lightning/funcs-common.h: Provide defaults
4164 for jit_setup_code, jit_start_pfx, jit_end_pfx
4165 * lightning/i386/core.h: Add jit_patch_at, jit_patch_movi.
4166 * lightning/ppc/core.h: Likewise.
4167 * lightning/sparc/core.h: Likewise.
4168 * lightning/ppc/asm.h: Fix generation of branch destination
4169 displacements in _FB and _BB
4170 * lightning/ppc/core.h: Generate trampolines in the user
4171 area.
4172 * lightning/ppc/funcs.h: Add a few casts.
4173 * tests/bc.c: New testcase.
4174
4175 * lightning/i386/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
4176 * lightning/ppc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
4177 * lightning/sparc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
4178
4179
41802004-03-09 Paolo Bonzini <bonzini@gnu.org>
4181
4182 * lightning/sparc/fp.h: Rewrite. Move macros for
4183 FP code generation...
4184 * lightning/sparc/asm.h: ... here.
4185 * lightning/sparc/core.h: Rename jit_prepare to
4186 jit_prepare_i, jit_retval to jit_retval_i.
4187 * lightning/ppc/core.h: Rename jit_prepare to
4188 jit_prepare_i, jit_retval to jit_retval_i.
4189 * lightning/i386/core.h: Rename jit_prepare to
4190 jit_prepare_i, jit_retval to jit_retval_i.
4191 * lightning/core-common.h: Provide backwards
4192 compatible synonyms for the above.
4193 * lightning/fp-common.h: Rewrite.
4194 * lightning-inst.h: Include fp unconditionally.
4195 * lightning.h.in: Include fp unconditionally.
4196 * tests/Makefile.am: Enable fp tests.
4197 * tests/fib.c: Use jit_retval_i.
4198 * tests/fibit.c: Cast codeBuffer to char *.
4199 * tests/funcfp.c: Use new fp macros.
4200 * tests/printf.c: Use jit_retval_i.
4201 * tests/rpnfp.c: Use new fp macros.
4202 * tests/testfp.c: Use new fp macros.
4203
42042004-03-02 Paolo Bonzini <bonzini@gnu.org>
4205
4206 * lightning/i386/core.h: generate correct code when
4207 doing lt/le/ge/etc. on ESI and EDI. Use MOVZX/MOVSX
4208 where possible.
4209 * lightning/i386/asm.h: Add macros for MOVZX/MOVSX.
4210 Move macros for x87 here, and add many of them.
4211 * lightning/i386/fp.h: Use new macros for x87.
4212
42132004-02-06 Paolo Bonzini <bonzini@gnu.org>
4214
4215 * lightning/i386/core.h: avoid generating MOV reg, reg.
4216 * lightning/sparc/core.h: fix several bugs.
4217 * lightning/ppc/core.h: fix several bugs.
4218 * tests/rpn.c: rewritten.
4219
42202004-01-08 Paolo Bonzini <bonzini@gnu.org>
4221
4222 * tests/rpnfp.c: new example, suggested by Basile
4223 Starynkevitch.
4224 * tests/rpnfp.ok: new example.
4225
42262003-12-12 Paolo Bonzini <bonzini@gnu.org>
4227
4228 * tests/add.c: new test, suggested by Steve Dekorte.
4229 * tests/add.c: new test.
4230
42312003-11-14 Paolo Bonzini <bonzini@gnu.org>
4232 John Redford <eirenik@hotmail.com>
4233
4234 * lightning/asm-common.h: change the 'pc' field of _jit to
4235 be a union of various data types, because ISO C99 doesn't
4236 permit using ++ on a = cast. Change the incremented casts of
4237 _jit.pc to be _jit.x.uc_pc, _jit.x.us_pc, etc.
4238 * all files: change all non-cast instances of _jit.pc to be
4239 _jit.x.pc.
4240 * lightning/i386/core.h: remove casts from jit_might.
4241
42422003-05-25 Paolo Bonzini <bonzini@gnu.org>
4243
4244 * lightning/i386/core.h: use JITSORRY in jit_replace
4245 * lightning/asm-common.h: define JITSORRY
4246
42472003-05-14 Paolo Bonzini <bonzini@gnu.org>
4248
4249 * lightning/i386/core.h: fix missing comma in several
4250 load/store macros.
4251 * lightning/core-common.h: fix long/unsigned long/pointer
4252 jit_pushr/jit_popr.
4253 * lightning/ppc/funcs.h: correctly align stack pointer
4254
4255No changelogs for the assemblers (lightning directory) until 1.0
519a9ea1 4256
4a71579b
PC
42572003-03-27 Paolo Bonzini <bonzini@gnu.org>
4258
4259 * tests/printf2.c: new test
4260
42612001-05-03 Paolo Bonzini <bonzini@gnu.org>
4262
4263 * tests/printf.c: made the message platform independent
4264
42652001-01-19 Paolo Bonzini <bonzini@gnu.org>
4266
4267 * configure.in: support cross-assembling
519a9ea1 4268
4a71579b
PC
4269 * disass/bfd.h, disass/dis-asm.h, disass/dis-buf.c,
4270 disass/i386-dis.c, disass/i386.h, disass/ppc-dis.c,
4271 disass/ppc.h, disass/ppc-opc.c, disass/sparc-dis.c,
4272 disass/sparc.h, disass/sparc-opc.c: new files, from GDB
4273
4274 * disass/disass.c, disass/Makefile.am: new files
4275
4276 * tests/fib.c, tests/fibit.c, tests/incr.c, tests/printf.c,
4277 tests/rpn.c, tests/testfp.c, tests/Makefile.am: support
4278 disassembling