-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChangeLog
More file actions
4183 lines (3098 loc) · 153 KB
/
ChangeLog
File metadata and controls
4183 lines (3098 loc) · 153 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2021-04-03 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
* check/Makefile.am: Add test for the live instruction.
* check/live.ok: New file.
* check/live.tst: New file.
* doc/body.texi: Add documentation for the live instruction and
for jit_get_reg/jit_get_unreg. Fix menu entries.
* include/lightning.h.in (jit_get_reg, jit_unget_reg): Expose the
macros in the public header file.
* include/lightning/jit_private.h (jit_get_reg, jit_unget_reg):
Remove the macros from the private header file.
2021-04-03 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
* Makefile.am, check/Makefile.am, doc/Makefile.am,
lib/Makefile.am: Include $(top_builddir)/include in include paths
for the autoconf-generated header file lightning.h.
2021-04-03 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
* doc/.gitignore: Add version.texi to list of ignored files.
* doc/version.texi: Remove file from version control.
2020-18-04 Paulo Andrade <pcpa@gnu.org>
* lib/jit_x86-cpu.c, lib/jit_x86.c: Implement %rip relative
calls and jumps on x86_64. Currently very conservative, assuming
a jit block can be larger than 2G, so, if a jump or call is in
the same jit generation, but target is unknown, use an indirect
branch (could have an option to assume a jit code block is
never larger than 2G). Also a deoptimization is that now does
not always generate ip relative jmpi; previously implicitly
assumed jmpi would never be larger than 2G. Overall still an
optimization.
2020-23-01 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Add a proper fix to the condition of considering
a register dead at entry of a block when it modifies the register
!after! a branch to a target where it is live.
The correction is just to split blocks on branches. It uses an
extra label per branch, but makes following the code simpler and
avoid costly searches.
2020-22-01 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Correct a special condition of a register
only assigned in a block, and incorrectly marked as dead before
a jump where the register is live.
2019-10-04 Paulo Andrade <pcpa@gnu.org>
* check/lightning.c, include/lightning/jit_private.h,
include/lightning/jit_x86.h, lib/jit_x86-cpu.c, lib/jit_x86-sz.c,
lib/jit_x86.c: Correct issues with MinGW64 that defines _WIN32
and needs long long for jit_word_t.
2019-09-16 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Do not add registers that are never modified
to the set of registers to scan for live range, what might
consume a lot of cpu time, doing nothing.
2019-09-16 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
* include/lightning/jit_x86.h, lib/jit_x86.c: Correct x86_64
backend, made %r12 a callee-save register as dictated by the
System V AMD64 ABI.
2019-09-16 Paulo Andrade <pcpa@gnu.org>
* Makefile.am: Do not force CFLAGS for the get_jit_size target.
* check/lightning.c: Drop __ppc__ check.
* include/lightning.h.in: Drop __ppc__ check. Add new
jit_flag_vararg flag, for special case in powerpc 32 bit using
the SYSV abi, and need to pass an extra argument during code
generation.
* include/lightning/jit_ppc.c: Drop __ppc_ check. Remove the
ABI_ELFv2 macro, as it now directly checks for the _CALL_ELF
value when/if appropriate.
* include/lightning/jit_private.h: Drop __ppc_ check. Check for
_CALL_AIXDESC to define extra data to handle function
descriptors.
* lib/jit_ppc-cpu.c: Update to check for _CALL_SYSV; assume
!_CALL_SYSV == (_CALL_AIX || _CALL_LINUX). Significant code
rework for the SYSV abi.
* lib/jit_ppc-sz.c: Update for the SYSV abi.
* lib/jit_ppc.c: Update for the SYSV abi. Add matching va_list
type. Drop __ppc__ check.
* lib/jit_size.c: Drop __ppc_ check.
* lib/lightning.c: Drop __ppc__ check. Add proper check for
__powerpc__ and _CALL_AIXDESC to manage function descriptors.
* lib/size.c: Update to drop __pppc_ check and SYSV abi.
2019-08-30 Paulo Andrade <pcpa@gnu.org>
* lib/jit_mips-cpu.c: Use JALR to get the same effect as JR, as
in mips32r6 JR generates an illegal instruction. Thanks to
Bruno Haible for providing a patch and the information, reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925129
* THANKS: update.
2019-08-29 Marc Nieper-Wißkirchen <marc@nieper-wisskirchen.de>
* include/lightning/jit_private.h: Move definition of offsetof
from the public header file here.
* configure.ac, include/Makefile.am, include/lightning.h,
include/lightning.h.in: Generate lightning.h from lightning.in.h
and remove the dependence on config.h from the public header file.
2019-06-04 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_riscv.h, lib/jit_riscv-cpu.c,
lib/jit_riscv-fpu.c, lib/jit_riscv-sz.c, lib/jit_riscv.c:
Implement riscv port. Only 64 bit Linux supported. Built on
Fedora 28 image.
* check/all.tst, check/float.tst, configure.ac, include/lightning.h,
include/lightning/Makefile.am, include/lightning/jit_private.h,
lib/Makefile.am, lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
Minor updates for the new riscv port.
2019-06-04 Paulo Andrade <pcpa@gnu.org>
* lib/jit_alpha.c lib/jit_ia64.c lib/jit_mips.c lib/jit_sparc.c:
Correct assertion of _jitc->regarg after emiting an instruction.
jit_carry may be set, but not an argument to the current instruction.
2019-06-01 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Correct assertion on jit_unget_reg when the
argument is jit_carry, and jit_carry was not used in the
instruction.
2019-06-01 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_private.h: Remove no longer need
setmask field of jit_block_t and blockmask from jit_compiler_t.
* lib/lightning.c: Rework of register live and unknown state
information during jit generation. It no longer recurses nor
do dangerous bit unset of registers in unknown state. The
only pitfall known, that must be taken care now is that jmpr
(or jmpi to not a jit node) is treated as a function call, as
otherwise it would need to consider all registers live, and
spill/reload during all jit generation.
2018-12-28 Paulo Andrade <pcpa@gnu.org>
* lib/jit_disasm.c: Release bfd handle. Thanks for patch to
Marc Nieper-Wißkirchen.
2018-08-30 Paulo Andrade <pcpa@gnu.org>
* lib/jit_disasm.c: Add hints to select hppa disassembler.
* lib/jit_hppa-cpu.c: Correct address of vastart when all
argument registers were used as non vararg arguments.
* lib/jit_hppa-fpu.c: Disable load/store of rv,ix,rb where
rv is the value, ix is an register or integer offset and rb
is a base register. These should be better tested, as they do
not work on all environments (fail on qemu-hppa).
2018-04-20 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_private.h: Add new register classes to
flag float registers and double only registers, required for sparc64
where only low 32 bit fpr registers can be used for single precision
operations.
Add new 128 bit jit_regset_t type for sparc64 register set.
* include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
lib/jit_sparc-sz.c, lib/jit_sparc.c: Update for 64 bits sparc.
* lib/lightning.c: Update for new jit_regset_t required for sparc64.
2018-02-26 Paulo Andrade <pcpa@gnu.org>
* check/lightning.c, include/lightning.h: Add the new jit_va_push
interface. That should be called when passing a va_list to a C
function. This is required because on Alpha a va_list is passed
by value, and lightning does not know about data types, so, cannot
understand it is pushing a va_list as argument.
* lib/jit_names.c, lib/lightning.c: Minor changes for the new
jit_code_va_push.
* check/cva_list.c: Update only test case using jit_va_push, to
pass a va_list to a C function.
doc/body.texi: Better documentation of the varargs interface.
* jit_alpha.c, jit_alpha-cpu.c: Update to properly push a
C va_list and correctly calculate varargs offset.
* lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_alpha-sz.c,
lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_mips-sz.c, lib/jit_mips.c,
lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_s390-sz.c, lib/jit_s390.c,
lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-sz.c, lib/jit_x86.c:
Update for the new jit_va_push interface.
2018-02-22 Paulo Andrade <pcpa@gnu.org>
* lib/jit_alpha-cpu.c: Always set t12 to the address of the
current function, to properly work on all systems. Previously
the shortcut did only work on Tru64. For Linux and glibc the
change is required.
2018-02-22 Paulo Andrade <pcpa@gnu.org>
* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c:
Correct wrong logic in usage of jit_live in jit_retr. The
problem is that if a temporary is required during epilog,
the return register might be allocated, so, jit_live must always
be used.
2018-01-31 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Avoid deep recursions when computing live
register ranges.
2018-01-31 Paulo Andrade <pcpa@gnu.org>
* lib/jit_mips-cpu.c: Correct frame size and varargs
initialization for the n32 abi.
* lib/jit_mips.c, lib/jit_mips-fpu.c: Correct 32 bit abis
in big-endian.
2017-09-13 Paulo Andrade <pcpa@gnu.org>
* configure.ac: Add check for binutils 2.29 prototype to the
disassembler function.
* lib/jit_disasm.c: Adapt for binutils 2.29 change.
2017-06-09 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_private.h, lib/lightning.c: Add a
second pass from start when computing register live ranges.
This should be used temporarily, and is required for certain
loop constructs, with several consecutive blocks not referencing
a live register.
2016-05-05 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Correct wrong movr simplification,
remove no longer needed code to set return registers live
and update live register set when reaching a label boundary,
but do not descend if the block has been already visited.
The later need some tuning for complex code generation, where
it will still have issues.
2015-11-30 Paulo Andrade <pcpa@gnu.org>
* doc/body.texi: Change documentation to no longer say
it is a variant of the Fibonacci sequence, and document
a proper implementation.
Thanks to Jon Arintok for pointing out that the Fibonacci
sequence generation was incorrect. It was documented, but
still confusing.
* check/fib.tst, check/fib.ok, check/bp.tst, check/bp.ok,
doc/ifib.c, doc/rbif.c: Implement a proper Fibonacci
sequence implementation.
2015-07-03 Paulo Andrade <pcpa@gnu.org>
* lib/jit_mips-cpu.c: Correct definition of htonr_ul.
Correct prolog/epilog/va* routines to work on o64 abi.
* lib/jit_mips-fpu.c: Correct load of double literal
argument when not using a data buffer.
Remove alignment correction in vaarg_d if using the
new mips abi.
* lib/jit_mips.c: Correct code to allow creating variadic
jit functions when using the new mips abi.
* lib/jit_rewind.c: Minor adjust for rewind when using
the new mips abi, if there are varargs arguments in
registers.
2015-06-06 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ia64-cpu.c: Search backward for the last output
register used, otherwise would stop too early if a float
argument used the slot.
Correct offset of first va_list argument, and use proper
va_list abi.
* lib/jit_ia64-fpu.c: Add new functions to move a gpr
to a fpr register, to counterpart the ones that move a
fpr to a gpr. These are required to properly implement
jit_getarg*_{f,d} on complex prototypes, or variadic
jit functions.
* lib/jit_ia64-sz.c: Update for support to jit variadic
functions.
* lib/jit_ia64.c: Implement proper abi for variadic
jit functions.
2015-06-04 Paulo Andrade <pcpa@gnu.org>
* lib/jit_rewind.c: New file implementing generic functions
to "rewind", or rewrite IR code sequences.
* include/lightning.h: Add several new codes, that previously
were a function call, that would synthesize the operation.
Now, there is a code for the operation, and a new flag to
know an operation is synthesized.
* include/lightning/jit_private.h: Add several new macros to
help construct synthesized IR code sequences.
* lib/Makefile.am: Update for lib/jit_rewind.c.
* lib/jit_disasm.c: Update for a small rework on jit_node_t,
so that --enable-devel-disassembler does not need a change
in the layout of jit_node_t.
* lib/jit_names.c: Update for the new codes.
* lib/jit_print.c: Update to print more readable output, and
flag synthesized IR code sequences.
* lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_x86-sz.c,
lib/jit_x86.c: Update for new synthesized IR code sequences.
* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu., lib/jit_ppc-sz.c,
lib/jit_ppc.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_s390-fpu.c,
lib/jit_s390-sz.c, lib/jit_s390.c: Update for new synthesized
IR code sequences and correct bugs in the initial varargs
implementation support.
* lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_hppa-sz.c,
lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
lib/jit_sparc-sz.c, lib/jit_sparc.c: Add generic, untested
support for the new synthesized IR code sequences. Known
most likely broken right now, and should be corrected once
access to these hosts is available.
* lib/lightning.c: Update for new IR codes, and add support
for not yet existing instructions that change third argument.
* size.c: Change to use different tables for LE and BE PowerPC.
Correct a wrong endif for x32.
2015-05-25 Paulo Andrade <pcpa@gnu.org>
* check/cva_list.c: New file implementing a test to ensure
the value returned by jit_va_start is a valid C va_list.
* check/va_list.ok: New simple helper file, as now the
va_list.tst test is enabled.
* check/va_list.tst: Rewritten for an extensive variadic
jit functions test.
* check/Makefile.am: Update for the new tests.
* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
lib/jit_arm.c: Correct broken software float in a previous
commit. Note that the hard float abi implementation is known
broken at this time, for special cases involving variadic
functions, and should be corrected next.
lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c: Correct
the jit_va_list_t semantics to match C va_list.
2015-05-24 Paulo Andrade <pcpa@gnu.org>
* lib/Makefile.am: Bump library major. This is a preparation
for a rework that was due for quite some time, but that is
now required to properly implement variadic jit functions.
The rework is mainly required to know at prolog parsing, if
a function is variadic or not. This will benefit a few
backends, and is mandatory for the hard float arm abi.
The rework was already planned for quite some time, to
be able to use a variable stack framesize, and for leaf
functions optimization where applicable.
The change will be source compatible, but will change
some internals, and jit_code_t values, as some new will
be added.
The only behavior change is that, jit_arg_register_p may
change return value on hard float arm abi, if called before
or after jit_ellipsis. Common sense anyway, would say to
make that call after jit_ellipsis, but documentation
should be updated for it.
2015-05-24 Paulo Andrade <pcpa@gnu.org>
* lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: Correct base
aarch64 varargs code.
2015-05-24 Paulo Andrade <pcpa@gnu.org>
* check/lightning.c: Clearly run check if clang is the system
compiler.
2015-05-20 Paulo Andrade <pcpa@gnu.org>
* lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c, lib/jit_sparc.c:
Add base support to jit vararg functions to the sparc backend.
2015-05-20 Paulo Andrade <pcpa@gnu.org>
* lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c, lib/jit_alpha.c:
Add base support to jit vararg functions to the alpha backend.
2015-05-19 Paulo Andrade <pcpa@gnu.org>
* lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c, lib/jit_hppa.c:
Add base support to jit vararg functions to the hppa backend.
2015-05-10 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c:
Add base support to jit vararg functions to the ia64 backend.
2015-05-10 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
and movi_f_w implementation to work when not using a
data buffer. This causes the check varargs.tst to
work when passing "-d" to the lightning test tool.
2015-05-10 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ia64.c: Implement inline assembly cache flush,
required on multiprocessor systems.
2015-05-06 Paulo Andrade <pcpa@gnu.org>
* lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c:
Add base support to jit vararg functions to the mips backend.
Currently only supported on the o32 abi, until access to a
n32 system is arranged.
2015-05-05 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c:
Add base support to jit vararg functions to the PowerPC backend.
2015-05-02 Paulo Andrade <pcpa@gnu.org>
* lib/jit_s390-cpu.c, lib/jit_s390-fpu.c, lib/jit_s390.c:
Add base support to jit vararg functions to the s390 backend.
2015-05-01 Paulo Andrade <pcpa@gnu.org>
* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
lib/jit_arm.c: Add base support to jit vararg
functions to the arm backend.
2015-04-30 Paulo Andrade <pcpa@gnu.org>
* lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
lib/jit_aarch64.c: Add base support to jit vararg
functions to the aarch64 backend.
2015-04-27 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, include/lightning/jit_private.h,
lib/jit_names.c, lib/lightning.c: Add initial support
for the new jit_va_start, jit_va_arg, jit_va_arg_d, and
jit_va_end interfaces. The jit_va_start call is supposed
to return a va_list compatible pointer, but not yet
decided if it will be "declared" stdarg compatible,
as for now only x86 support has been added (and should
be compatible), but issues may arise on other backends.
* check/lightning.c: Add wrappers to call the new jit_va_*
interfaces.
* lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
jit_va_* for x86.
* lib/jit_x86-sz.c: Add fields, but not yet fully updated,
as this is an intermediate commit.
* lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
lib/jit_alpha-sz.c, lib/jit_alpha.c,
lib/jit_arm-sz.c, lib/jit_arm.c,
lib/jit_hppa-sz.c, lib/jit_hppa.c,
lib/jit_ia64-sz.c, lib/jit_ia64.c,
lib/jit_mips-sz.c, lib/jit_mips.c,
lib/jit_ppc-sz.c, lib/jit_ppc.c,
lib/jit_s390-sz.c, lib/jit_s390.c,
lib/jit_sparc-sz.c, lib/jit_sparc.c: Prepare for the
new jit_va_* interfaces. Not yet implemented, and will
cause an assertion if used.
* check/va_list.tst: Simple early test case, that works
on x86_64, x32, ix86, cygwin, and cygwin64.
2015-02-17 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, include/lightning/jit_private.h,
lib/jit_aarch64-cpu.c, lib/jit_aarch64.c,
lib/jit_alpha-cpu.c, lib/jit_alpha.c,
lib/jit_arm-cpu.c, lib/jit_arm.c,
lib/jit_hppa-cpu.c, lib/jit_hppa.c,
lib/jit_ia64-cpu.c, lib/jit_ia64.c,
lib/jit_mips-cpu.c, lib/jit_mips.c,
lib/jit_ppc-cpu.c, lib/jit_ppc.c,
lib/jit_s390-cpu.c, lib/jit_s390.c,
lib/jit_sparc-cpu.c, lib/jit_sparc.c,
lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
jit_allocar(offs, size) interface, that receives
two integer registers arguments, allocates space
dynamically in the stack, returns the offset in
the first argument, and uses the second argument
for the size in bytes of the memory to be allocated.
* check/allocar.ok, check/allocar.tst: New files
implementing test cases for the new jit_allocar
interface.
* check/Makefile.am, check/lightning.c: Update for
the new test case and interface.
* doc/body.texi: Add documentation of the new
interface.
2015-02-17 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_x86.h, lib/jit_x86-cpu.c,
lib/jit_x86-x87.c: No longer make st(7) available.
Need to keep one x87 slots empty to avoid exceptions.
This has the side effect of no longer needing the
hackish emms instruction before a function call.
2015-02-16 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Remove the jit_regno_patch bitfield
register fields before actual emit, as it is only really
used before emit, otherwise, on special conditions it
may consider live registers as dead during code emit.
2015-02-15 Paulo Andrade <pcpa@gnu.org>
* lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
Correct encoding of ldxr* stxr* in the x32 abi. If the
displacement register is negative, it would generate
a 64 bit instruction with a 32 bit unsigned displacement.
* check/ranger.tst, check/ranger.ok: New files, implementing
a test case for negative loads and stores. This is range.tst
converted to use registers instead of immediate offsets.
check/Makefile.am: Update for the new test case.
2015-02-07 Paulo Andrade <pcpa@gnu.org>
* lib/jit_size.c: Preventively use at least 144 bytes
if JIT_INSTR_MAX is less than it. The logic is not
guaranteed to be 100% precise, it is mostly heuristics
to allocate a buffer with as close as possible size,
but a wrong value may cause code generation to write
past the end of the buffer.
2015-02-03 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Correct the reason the bug in
simplify_stxi was not triggered before, it was due to
incorrectly resetting the value->code field, what was
causing it to never properly optimize:
stxi Im0 Rb0 Rt0
ldxi Rt1 Rb1 Im1
when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
There was another possible issue, that has been also
addressed in this commit, that would be the case of
Rbn == Rtn, where no redundancy removal is possible.
2015-02-03 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Correct wrong check in simplify_stxi.
The test was incorrectly comparing the target register
and the displacement offset. This was a time bomb bug,
that would trigger in code like:
stxi Im0 Rb0 Rt0
stxi Im1 Rb1 Rt1
if Rb0 == Rb1 && Rt0 == Rt1 && Im0 == Rt1, that is,
the wrong check was Im0 == Rt1, instead of the supposed
Im0 == Imm1 (that was what the code mean't to do). It
was removing the second stxi assuming it was redundantly
generated; as that is not uncommon pattern on
translators generating jit.
2015-02-02 Paulo Andrade <pcpa@gnu.org>
* configure.ac, include/lightning/jit_private.h,
lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
lib/jit_disasm.c, lib/jit_hppa.c, lib/jit_ia64.c,
lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c: Add a new
--enable-devel-disassembler option, that should be used
during development, or lightning debug. This option
intermixes previous jit_print and jit_disassemble
output, making it easier to visualize what lightning
call was used, and what code was generated.
2015-01-31 Paulo Andrade <pcpa@gnu.org>
* lib/jit_arm-cpu.c, lib/jit_arm.c: Only limit to 24 bit
displacement non conditional jump in the same jit_state_t.
2015-01-19 Paulo Andrade <pcpa@gnu.org>
* doc/body.texi: Reorder documentation, making jit_frame
and jit_tramp the lightning response to the need of
trampolines, continuations and tail call optimizations.
A pseudo code example of a factorial function was added.
Also added a section for description of the available
predicates.
* doc/fact.c: New file, implementing a simple example of
a translation of a trivial, recursive, tail call optimization
into lightning calls. This is the conversion to functional C
code of the example in doc/body.texi.
* doc/Makefile.am: Update for the next test case.
2015-01-17 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, lib/jit_aarch64.c,
lib/jit_alpha.c, lib/jit_arm-vfp.c, lib/jit_arm.c,
lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
lib/jit_ppc.c, lib/jit_s390.c, lib/jit_sparc.c,
lib/jit_x86.c: Add the new jit_arg_register_p predicate.
The predicate is expected to be used to know if an
argument is in a register, what would need special
handling if code that can overwrite non callee save
registers is executed.
* check/carg.c: New test case to check consistency and
expected usage of jit_arg_register_p.
* check/Makefile.am: Update for new test case.
2015-01-17 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_aarch64.h,
include/lightning/jit_alpha.h,
include/lightning/jit_arm.h,
include/lightning/jit_hppa.h,
include/lightning/jit_mips.h,
include/lightning/jit_ppc.h,
include/lightning/jit_s390.h,
include/lightning/jit_sparc.h,
include/lightning/jit_x86.h,
lib/jit_aarch64.c, lib/jit_alpha.c,
lib/jit_arm.c, lib/jit_hppa.c,
lib/jit_ia64.c, lib/jit_mips.c,
lib/jit_ppc.c, lib/jit_s390.c,
lib/jit_sparc.c, lib/jit_x86.c: Remove jit_arg_reg_p and
jit_arg_f_reg_p from a public header, and define it only
on port specific files where an integer offset is used
to qualify an argument identifier. Exported code expects
an opaque pointer (but of jit_node_t* type) to "qualify"
an argument identifier.
This patch, and the code review/simplification done during
it also corrected some bugs:
o Inconsistent jit_arg_d value of double argument after 3
integer arguments in arm for jit_functions; tested, C
functions were being properly called.
o Inconsistent use of getarg_{f,d} and putarg*_{f,d} on
s390 (32-bit) that happened to not have a proper test
case, as it would only happen for jit functions, and
tested, called C functions had proper arguments.
o Corrected a "last minute" correction that did not go
to the committed version, and would not compile on hppa,
due to bad _jit_putargi_d prototype definition.
2015-01-17 Paulo Andrade <pcpa@gnu.org>
* doc/body.texi: Correct wrong/outdated information for
hton*, pusharg* and ret*, and add missing documentation
for rsb*, qmul*, qdvi* and putarg*.
2015-01-15 Paulo Andrade <pcpa@gnu.org>
* configure.ac, lib/jit_disasm.c: Rewrite workaround
to apparent problem to initialize powerpc disassembler.
2015-01-15 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, lib/jit_aarch64.c,
lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c:
Implement jit_putarg*. It works as a mix of jit_getarg*
and jit_pusharg*, in the way that the first argument is
a register or immediate, and the second is a pointer
returned by jit_arg*. The use of the interface is to change
values of arguments to the current jit function.
* check/put.ok, check/put.tst: New test cases exercising
the new jit_putarg* interface.
* check/Makefile.am, check/lightning.c: Update for the
new test case and interface.
2015-01-08 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_s390.h, lib/jit_s390-cpu.c,
lib/jit_s390-fpu.c, lib/jit_s390-sz.c, lib/jit_s390.c:
Renamed s390x* files to s390*.
* check/float.tst, check/lightning.c, configure.ac,
include/lightning.h, include/lightning/Makefile.am,
lib/Makefile.am, lib/jit_s390.c, lib/jit_size.c,
lib/lightning.c: Update for renamed files.
2015-01-08 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, include/lightning/jit_private.h,
include/lightning/jit_s390x.h, lib/jit_disasm.c,
lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
lib/jit_s390x.c, lib/jit_size.c, lib/lightning.c:
Add support for generating jit for s390 32 bit. This change
also removed %f15 from the list of temporaries fpr registers;
it was not being used, but if were, it would corrupt the
stack frame because the spill address would overwrite grp
offsets.
2014-12-26 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Correct some endianess issues
on the powerpc le backend.
2014-12-26 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ppc-cpu.c: Add mcrxr instruction emulation,
as this instruction has been phased out, and should be
implemented as a kernel trap.
2014-12-26 Paulo Andrade <pcpa@gnu.org>
* lib/jit_arm.c: Better check for need to flush constants
before the pool being no longer reachable.
2014-12-25 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h: Split jit_htonr in the new 3 interfaces
jit_htonr_us, jit_htonr_ui and jit_htonr_ul, the later only
available on 64 bit. The plain/untyped jit_htonr macro call
maps to the wordsize one.
* lib/jit_aarch64-cpu.c, lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
lib/jit_alpha-cpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c,
lib/jit_arm-cpu.c, lib/jit_arm-sz.c, lib/jit_arm.c,
lib/jit_hppa-cpu.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
lib/jit_ia64-cpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
lib/jit_mips-cpu.c, lib/jit_mips-sz.c, lib/jit_mips.c,
lib/jit_ppc-cpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
lib/jit_s390x-cpu.c, lib/jit_s390x-sz.c, lib/jit_s390x.c,
lib/jit_sparc-cpu.c, lib/jit_sparc-sz.c, lib/jit_sparc.c,
lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c:
Update backends for the new jit_htonr*.
* check/lightning.c, lib/jit_names.c, lib/lightning.c:
Update for the new jit_htonr* interfaces.
* check/Makefile.am: Update for new test cases.
* check/hton.ok, check/hton.tst: New test cases.
2014-12-24 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_private.h, include/lightning/jit_x86.h,
lib/jit_disasm.c, lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
lib/jit_x86-sz.c, lib/jit_x86-x87.c, lib/jit_x86.c,
size.c: Implement support for the x32 abi. Built and
tested on Gentoo default/linux/amd64/13.0/x32 profile.
2014-12-24 Paulo Andrade <pcpa@gnu.org>
* lib/jit_names.c: Add missing rsbi_f and rsbi_d strings.
2014-12-21 Paulo Andrade <pcpa@gnu.org>
* lib/jit_arm.c: Call __clear_cache for every page.
This should only be required for older boards or
toolchain setup, but has been reported to be required
for lightning at some point.
2014-12-21 Paulo Andrade <pcpa@gnu.org>
* lib/jit_arm.c: Correct check to guard overflow of index
of constants from program counter.
2014-11-24 Paulo Andrade <pcpa@gnu.org>
* lib/lightning.c: Remove an optimization to calee save
registers that may incorrectly remove a jit_movr under
special conditions.
2014-11-20 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c,
lib/jit_ppc.c: Add initial powerpc le support.
2014-11-20 Paulo Andrade <pcpa@gnu.org>
* lib/jit_disasm.c: Change thumb or arm disassemble based on
jit code before disassembly.
* lib/jit_arm-cpu.c: Correct reversed arguments to LDRD and
STRD instructions, and correct checking for support of those.
* lib/jit_arm-swf.c: Correct wrong use of LDRD and STRD and
only use those if the register is even.
* check/check.arm.swf.sh, check/check.arm4.swf.sh: New files
to test LDRD and STRD, as well as the alternate code path
when those are not available, in the .arm4. test case.
* check/Makefile.am: Update for the new test cases.
2014-11-08 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_private.h, lib/jit_aarch64.c,
lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c:
Implement a private jit_flush call, that flushes
the cache, if applicable, aligning down to the
previous and up to the next page boundary.
2014-11-08 Paulo Andrade <pcpa@gnu.org>
* check/ctramp.c: New file. It just repeats the test
of tramp.tst, but using two jit_state_t, what should
test possible issues with two contexts, and also validate
jit_tramp works on backends with function descriptions.
* check/Makefile.am: Update for new test case.
2014-11-03 Paulo Andrade <pcpa@gnu.org>
* include/lightning/jit_mips.h: Do not make the t9 register
JIT_R11 (or JIT_R7 for n32 or n64 abi) available. Previously
it cause problems if one expects it to not be changed in a
function call. For example, calling a jit function, where it
really does not need to be changed.
2014-10-26 Paulo Andrade <pcpa@gnu.org>
* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Add an
assertion to all code generation "drivers" to ensure
_jitc->regarg is empty or in an expected state, after
translation of a lightning instruction to native code.
This change was a brute force test to find out other cases
of a temporary not being release (like was happening with
_bmsi and _bmci on x86), but no other case was found,
after running make check, with assertions enabled, on all
backends.
2014-10-26 Paulo Andrade <pcpa@gnu.org>
* lib/jit_x86-cpu.c: Correct a register allocation leak in
_bmsi and _bmci.
2014-10-25 Paulo Andrade <pcpa@gnu.org>
* lib/jit_disasm.c: Do not cause an fatal error if init_jit
fails in the jit_init_debug call.
2014-10-24 Paulo Andrade <pcpa@gnu.org>
* lib/jit_ia64.c, lib/jit_ppc.c: Correct handling of function
descriptor when first prolog is a jit_tramp prolog. The
test case was using the same jit_context_t, so was not
triggering this condition.
* lib/jit_ppc-cpu.c: Properly handle jump displacements that
do not fit on 24 powerpc. This required changing from previous
"mtlr reg, blr" to "mtctr reg, bctr" to properly handle
the logic to "hide" function descriptors, but that would
also be required as the proper jit_jmpr when/if implementing
optimizations to leaf functions (was working with blr because
it is saved/reloaded in prolog/epilog).
2014-10-21 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, lib/lightning.c: Add three predicates
to query information about labels. jit_forward_p(label)
will return non zero if the label is "forward", that is
need a call to jit_link(label), jit_indirect_p(label)
that returns non zero if the label was created with the
jit_indirect() call, and jit_target_p(label) that will
return non zero if there is at least one jump patched
to land at that label.
2014-10-18 Paulo Andrade <pcpa@gnu.org>
* check/range.ok, check/range.tst: New test case designed
to catch incorrect code generation, usually due to incorrect
test of immediate size. The test checks a large amount of
encodings in "power of two" boundaries. This test exorcises
a significant amount of code paths that was previously not
tested.
* check/Makefile.am: Add range test to make check target.
* lib/jit_aarch64-cpu.c: Correct wrong address calculation
for stxi_c, stxi_s, stxi_i and stxi_l when the offset is
too large.
* lib/jit_mips-fpu.c: Correct wrong size test to check if
an immediate can be encoded in a float or double store.
* lib/jit_s390x-cpu.c: Correct inverted encoding to stxi_s
when the offset cannot be encoded, and fallbacks to an
alternate encoding in 2 instructions.
2014-10-17 Paulo Andrade <pcpa@gnu.org>
* check/alu_rsb.ok, check/alu_rsb.tst: New files implementing
tests for jit_rsb*.
* check/Makefile.am, check/lightning.c, include/lightning.h,
lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c, lib/jit_aarch64-sz.c,
lib/jit_aarch64.c, lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c,
lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_arm-cpu.c,
lib/jit_arm-swf.c, lib/jit_arm-sz.c, lib/jit_arm-vfp.c,
lib/jit_arm.c, lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-cpu.c,
lib/jit_ia64-fpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips-sz.c,
lib/jit_mips.c, lib/jit_names.c, lib/jit_ppc-cpu.c,
lib/jit_ppc-fpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
lib/jit_s390x.c, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-cpu.c,
lib/jit_x86-sse.c, lib/jit_x86-sz.c, lib/jit_x86-x87.c,
lib/jit_x86.c, lib/lightning.c: Implement jit_rsb*. This
was a missing lightning 1.x interface, that on most
backends is synthesized, but on a few backends (hppa and ia64),
it can generate better code as on those there is, or the
only instruction with an immediate is in "rsb" format
(left operand).
2014-10-17 Paulo Andrade <pcpa@gnu.org>
* lib/jit_names.c: New file with single definition of string
representation of lightning IR codes.
* size.c: Modified to append the code name in a C comment
after the maximum instruction size.
* lib/jit_print.c: Minor change to not duplicate jit_names.c
contents.
* lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_arm-sz.c,
lib/jit_hppa-sz.c, lib/jit_ia64-sz.c, lib/jit_mips-sz.c,
lib/jit_ppc-sz.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
lib/jit_x86-sz.c: Rewritten to add string representation of
IR codes in a C comment.
2014-10-14 Paulo Andrade <pcpa@gnu.org>
* lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
lib/jit_hppa-cpu.c, lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c,
lib/jit_sparc-cpu.c: Implement or correct the internal
nop(count) call that receives an argument that tells the
modulo bytes to align the code for the next instruction.
* include/lightning.h, lib/lightning.c, lib/jit_aarch64.c,
lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c,
lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
lib/jit_x86.c: Implement the new jit_align() call that receive
an argument, that tells the modulo, in bytes, to align the
next instruction. In most backends the only value that makes
a difference is a value that matches sizeof(void*), as all
other values usually are already automatically aligned in
labels, but not guaranteed to be aligned at word size bytes.
* check/align.ok, check/align.tst: New files, implementing
a simple test for the new jit_align() interface.
* check/Makefile.am, check/lightning.c, lib/jit_aarch64-sz.c,
lib/jit_alpha-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
lib/jit_print.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
lib/jit_x86-sz.c: Update for the new jit_code_align code and
the jit_align() interface.
2014-10-13 Paulo Andrade <pcpa@gnu.org>
* include/lightning.h, lib/jit_size.c, size.c: Use a
symbolic value for the last IR code.
2014-10-12 Paulo Andrade <pcpa@gnu.org>