1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

19998 commits

Author SHA1 Message Date
Andy Wingo
6e9d59f34d Merge from upstream lightening 2019-04-29 17:15:58 +02:00
Andy Wingo
d6eea0b499 Attempt to pop x87 stack 2019-04-29 17:15:46 +02:00
Andy Wingo
7982839031 Merge from upstream lightening 2019-04-29 16:13:48 +02:00
Andy Wingo
57b31f1111 Stack alignment is 16 even on x86-32 2019-04-29 16:12:38 +02:00
Andy Wingo
c461126fab Fix u64-ref JIT on 32-bit
* libguile/jit.c (compile_u64_ref): Fix 32-bit load path; endianness was
  reversed.
2019-04-29 09:41:03 +02:00
Andy Wingo
85b3ee0ec3 Fix unneeded stack alignment.
* libguile/jit.c (emit_entry_trampoline): Remove unneeded alignment.
2019-04-28 18:45:10 +02:00
Andy Wingo
8f695c058a Merge from upstream lightening 2019-04-28 18:44:13 +02:00
Andy Wingo
483e880b10 Fix byte stores on x86-32
Also on x86-32, use RBX as the tmp register, as it is byte-addressable.
2019-04-28 18:42:55 +02:00
Andy Wingo
983af3be3b Merge from upstream lightening 2019-04-28 16:21:22 +02:00
Andy Wingo
2a5d315ab9 Unget temp xpr after mem->mem addend fixup 2019-04-28 16:21:09 +02:00
Andy Wingo
fb1f3ba051 Fix errors in 32-bit JIT support
* libguile/jit.c (compile_ursh_immediate):
(compile_ulsh_immediate): Fix immediate/register variant calling.
Happily a benefit of lightening, as type safety did this for us.
(DEFINE_CLOBBER_RECORDING_EMITTER_R_R_2): Pass JIT state.
2019-04-28 13:54:34 +02:00
Andy Wingo
61c6a0d3dd Enable JIT on 32-bit x86
* acinclude.m4 (GUILE_ENABLE_JIT): Turn on JIT for 32-bit x86.
2019-04-28 13:54:34 +02:00
Andy Wingo
334d0ba860 Adapt to lightening changes
* libguile/jit.c (emit_entry_trampoline): Use
  jit_{enter,leave}_jit_abi.
  (compile_allocate_words_immediate): Use JIT_OPERAND_ABI_WORD.
2019-04-28 13:54:34 +02:00
Andy Wingo
26bd81716b Align stack before entering JIT code
* libguile/jit.c (emit_entry_trampoline): Ensure stack is aligned when
  going into JIT code.
2019-04-28 13:54:34 +02:00
Andy Wingo
51618e7e83 Merge from upstream lightening 2019-04-28 13:53:16 +02:00
Andy Wingo
04cd8874de Stack alignment takes saved return address into account 2019-04-28 12:37:19 +02:00
Andy Wingo
7d4a286d7e Merge branch 'x86-32-ci' into 'master'
Add 32-bit x86 to CI

See merge request wingo/lightening!1
2019-04-28 10:04:42 +00:00
Andy Wingo
eae25f464a Add x86-32 tests to default test target 2019-04-28 12:01:30 +02:00
Andy Wingo
59ead16eab Mark test files as precious to prevent them from being deleted by make 2019-04-28 10:47:52 +02:00
Andy Wingo
d8bdefbd2f Add test for JIT callee with many args 2019-04-27 23:11:13 +02:00
Andy Wingo
d11864f098 Add {enter,leave}_jit_abi calls in tests
This saves and restores RBP on x86-32.
2019-04-27 22:54:38 +02:00
Andy Wingo
81ba8830a2 Fix ABI of arg to extr_d_f test 2019-04-27 22:36:06 +02:00
Andy Wingo
d617315fdb Fix jit_leave_jit_abi to pop correct registers
Also relax stack alignment on 32-bit x86
2019-04-27 22:27:39 +02:00
Andy Wingo
e0cf51e482 Small bug fixes for ia32 2019-04-26 17:41:43 +02:00
Andy Wingo
42bc762d26 Add facility to enter and leave JIT ABI
This allows us to save and restore callee-save temporaries, i.e. RBP on
32-bit x86.  Otherwise it's a disaster shuffling stack arguments using
temporaries.
2019-04-26 17:28:29 +02:00
Andy Wingo
9906cd5f84 Remove most __X64_32 code
The x32 ABI (i.e., amd64 with 32-bit pointers) is mostly a C language
question.  From a JIT perspective it mostly looks just like amd64.  We
can fix any differences in a followup, but x32 is also a pretty dead
ABI, so I feel OK with this.
2019-04-26 17:19:16 +02:00
Andy Wingo
24950994ef Simplify 64/32 concerns in x86-cpu.c
* lightening/x86-cpu.c (il): Take a uint64_t.  It's only called this
  way.
(imovi): Remove some x64_32 conditions; they seem bogus.
2019-04-26 16:13:29 +02:00
Andy Wingo
fe34e3cdf1 Make jit_cpu private 2019-04-26 16:09:06 +02:00
Andy Wingo
19da79c8c1 Fix 32-bit movi_d
* lightening/x86-sse.c (movi_d): Fix combining of low and high double
  halves.
2019-04-26 15:57:25 +02:00
Andy Wingo
b116314591 Fix compile warnings for 32-bit tests 2019-04-26 15:56:08 +02:00
Andy Wingo
e9d1567f7f Use jit_word_t for register-sized values instead of intmax_t 2019-04-26 15:00:29 +02:00
Andy Wingo
bab1f40b5e Fix lightening to compile on 32-bit x86 2019-04-26 14:44:09 +02:00
Andy Wingo
89fd69fc00 Account for saved return address when locating args
Also, fix alignment to be in bytes rather than bits.  Oops!
2019-04-26 14:38:29 +02:00
Andy Wingo
ac972e1dba Inline some internal definitions into backend-specific files 2019-04-26 14:37:35 +02:00
Andy Wingo
14e64a8b57 Ensure stack alignment in JIT code.
* libguile/jit.c (emit_entry_trampoline): Explicitly align stack.
2019-04-26 12:45:16 +02:00
Andy Wingo
5b45f04cc8 Merge from upstream Lightening 2019-04-26 12:41:47 +02:00
Andy Wingo
04d89a7ce2 Implement reloc shortening, and remove unused functionality 2019-04-26 12:40:44 +02:00
Andy Wingo
796f263ed8 Remove unused jit_epilog definition 2019-04-26 11:40:06 +02:00
Andy Wingo
4e5329676b Fix backtraces with call-with-values during bootstrap
* libguile/programs.c (scm_i_program_name): Use scm_i_primitive_name for
  primitives.  No functional change though.
* libguile/vm.c (DEFINE_BUILTIN): Mark builtins as primitives.
2019-04-26 11:15:49 +02:00
Andy Wingo
dc28ac03c1 Make jit_align_stack and jit_shrink_stack public 2019-04-26 10:04:04 +02:00
Andy Wingo
c54c248bc9 Track frame size to more reliably align stack before calls 2019-04-26 09:56:46 +02:00
Andy Wingo
a3e044c808 Move jit_move_operands etc to common lightening.c file 2019-04-26 09:09:50 +02:00
Andy Wingo
52248cf622 Adapt to changes in upstream lightening
* libguile/jit.c (emit_entry_trampoline): Adapt to change in callee-save
  predicates.
2019-04-25 23:47:27 +02:00
Andy Wingo
5622396cd9 Merge from upstream lightening 2019-04-25 23:24:27 +02:00
Andy Wingo
e29977a82b Simplify register representation even more
The register structures just contain the regno.  Since the only flag is
the callee-save flag, we can punt that to a separate per-backend,
per-target predicate.
2019-04-25 23:22:44 +02:00
Andy Wingo
2602f17fb4 Simplify register representation again
There's only one flag, "callee-save".  Also the regno range is limited
to 0-63 inclusive, to allow for cheap register sets as uint64_t values.
2019-04-25 19:12:55 +02:00
Andy Wingo
4088915a7e Lower default JIT threshold as JIT is cheaper now
* libguile/jit.c (default_jit_threshold): Lower from 50000 to 1000.
2019-04-25 18:41:03 +02:00
Andy Wingo
e9a372b020 Re-enable fixnum less-than JIT fast-path
* libguile/jit.c (compile_less): Re-enable fast-path for fixnums, now
  that the JIT library works :)
2019-04-25 18:24:20 +02:00
Andy Wingo
f0be544463 Merge from upstream lightening 2019-04-25 18:12:42 +02:00
Andy Wingo
af4e0422ae Align stack on 64-bit targets for calls 2019-04-25 18:12:23 +02:00