1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00
Commit graph

20710 commits

Author SHA1 Message Date
Andy Wingo
7e0b0be1ba Fix GPR temporary selection 2019-05-15 16:26:18 +02:00
Andy Wingo
09e71475f4 Allow a backend to have multiple temporary registers 2019-05-15 16:19:33 +02:00
Andy Wingo
5b8262e804 Rework register saving to avoid push/pop
Push and pop are not well supported on AArch64, so we might as well just
bump the stack pointer once and fill in by offset.
2019-05-15 15:41:02 +02:00
Andy Wingo
0bfdcc7016 Refactor to add support for constant tables, shifted relocs 2019-05-14 15:53:25 +02:00
Andy Wingo
19e7712358 First pass at aarch64 assembler port 2019-05-14 15:46:19 +02:00
Mark H Weaver
65d98d8fd2 Update iconv.m4 from gnulib.
* m4/iconv.m4: Update from gnulib-v0.1-2176-ga79f2a287.
2019-05-14 01:44:02 -04:00
Andy Wingo
fc9b474da6 Refactor some bits from x86 to lightening 2019-05-10 14:14:32 +02:00
Andy Wingo
f7080facb4 Refactor to move temp register acquire to core 2019-05-09 16:02:39 +02:00
Andy Wingo
1b98734c82 Fix eta-reduction of prompts
* module/language/cps/simplify.scm (eta-reduce): Fix renaming of labels
  referenced by prompts.  Thanks a million to Stefan Israelsson Tampe
  for the report and the fix!  Fixes #33652.
2019-05-08 22:26:35 +02:00
Andy Wingo
638846dc61 Merge from upstream lightening 2019-05-08 21:46:57 +02:00
Andy Wingo
570f361c6c Remove Sparc support
Sadly, this is a dead architecture, without an official Debian port.
Rest in peace!
2019-05-08 21:44:03 +02:00
Andy Wingo
ced3c42dee Remove hppa support
This is a dead architecture without an official Debian port.
2019-05-08 21:44:03 +02:00
Andy Wingo
d51bd7d592 Remove alpha support
This is a dead architecture without an official Debian port.
2019-05-08 21:44:01 +02:00
Andy Wingo
80f79fca93 Remove ia64 (itanium) support
This is a dead architecture without an official Debian port.
2019-05-08 21:37:40 +02:00
Mark H Weaver
7c2b48a6bd Strings, i18n: Limit the use of alloca to approximately 8 kilobytes.
* libguile/i18n.c (SCM_MAX_ALLOCA): New macro.
(SCM_STRING_TO_U32_BUF): Accept an additional variable to remember
whether we used malloc to allocate the buffer.  Use malloc if the
allocation size is greater than SCM_MAX_ALLOCA.
(SCM_CLEANUP_U32_BUF): New macro.
(compare_u32_strings, compare_u32_strings_ci, str_to_case): Adapt.
* libguile/strings.c (SCM_MAX_ALLOCA): New macro.
(normalize_str, unistring_escapes_to_r6rs_escapes): Use malloc if the
allocation size is greater than SCM_MAX_ALLOCA.
* test-suite/tests/i18n.test, test-suite/tests/strings.test: Add tests.
2019-05-07 04:41:30 -04:00
Mark H Weaver
91b5b1631f put-u8: Always write a single byte, regardless of the port encoding.
Previously, 'put-u8' used textual I/O to write a single character,
relying on the usual practice of setting the port encoding to ISO-8859-1
for binary ports.

* libguile/r6rs-ports.c (scm_put_u8): Use 'scm_c_write', not 'scm_putc'.
2019-05-07 04:41:15 -04:00
Mark H Weaver
5b42fd80d7 Optimize fixnum exact integer square roots.
* libguile/numbers.c (scm_exact_integer_sqrt, scm_sqrt)
(exact_integer_is_perfect_square, exact_integer_floor_square_root):
Where it is trivial to do so, use GMP's low-level mpn functions to
avoid heap allocation.
2019-05-07 04:39:52 -04:00
Mark H Weaver
162a031e5f Avoid 'with-latin1-locale' in binary I/O tests.
* test-suite/tests/r6rs-ports.test ("put-bytevector [2 args]")
("put-bytevector [3 args]", "put-bytevector [4 args]"): Set the default
port encoding instead of setting the locale.
2019-05-07 04:39:52 -04:00
Mark H Weaver
74d536bf52 Fix indentation in scm_sum. 2019-05-07 04:37:52 -04:00
Mark H Weaver
16b4bac355 Fix typo in comment. 2019-05-07 04:37:52 -04:00
Mark H Weaver
2a1f22c00a Add 'scm_c_make_char' and use it where appropriate.
This reverts the change to SCM_MAKE_CHAR made in the previous commit
63818453ad, which used an arithmetic trick
to avoid evaluating its argument more than once.

Here, we restore the previous implementation of SCM_MAKE_CHAR, which
evaluates its argument twice.  Instead, we introduce a new inlinable
function 'scm_c_make_char' and replace uses of SCM_MAKE_CHAR with calls
to 'scm_c_make_char' where appropriate.

* libguile/chars.h (scm_c_make_char): New inline function.
* libguile/inline.c: Include chars.h.
* libguile/srfi-13.c (REF_IN_CHARSET, scm_string_any, scm_string_every)
(scm_string_trim, scm_string_trim_right, scm_string_trim_both)
(scm_string_index, scm_string_index_right, scm_string_skip)
(scm_string_skip_right, scm_string_count, string_titlecase_x)
(string_reverse_x, scm_string_fold, scm_string_fold_right)
(scm_string_for_each, scm_string_filter, scm_string_delete):
Use 'scm_c_make_char' instead of 'SCM_MAKE_CHAR' in cases where the
argument calls a function.
* libguile/chars.c (scm_char_upcase, scm_char_downcase, scm_char_titlecase),
libguile/ports.c (scm_port_decode_char),
libguile/print.c (scm_simple_format),
libguile/read.c (scm_read_character),
libguile/strings.c (scm_string_ref, scm_c_string_ref),
libguile/vm-engine.c ("string-ref"): Ditto.
2019-05-07 04:37:52 -04:00
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