Debian Codegraph @

libguile/lightening/ChangeLog.lightning

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