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

20647 commits

Author SHA1 Message Date
Andy Wingo
aa44a71750 Merge https://gitlab.com/wingo/lightening master branch 2020-07-30 14:34:52 +02:00
Andy Wingo
8b37b783ea Merge branch 'word-spills' into 'master'
Spill whole words to stack, even for uint8_t args

Closes #15

See merge request wingo/lightening!11
2020-07-30 12:34:20 +00:00
Andy Wingo
2784bee8e5 Spill whole words to stack, even for uint8_t args
* lightening/lightening.c (abi_gpr_to_mem): Write whole words when
  spilling GPRs to the stack.  Always correct given that all Lightening
  operations that write GPRs write the whole register, and the current
  ABI targets allow writing the extra words.  Closes #15.
2020-07-30 14:26:37 +02:00
Andy Wingo
2aa05ff3c4 Update use of jit_begin_data API
* libguile/jit.c (compile_jtable): Pass computed jump table size.
2020-07-30 14:12:26 +02:00
Andy Wingo
d4e730a458 Merge https://gitlab.com/wingo/lightening master branch 2020-07-30 14:11:26 +02:00
Andy Wingo
ca35ac9a4b Merge branch 'word-align-literal-pools' into 'master'
Literal pools have word-alignment, not u64-alignment

See merge request wingo/lightening!10
2020-07-30 12:09:24 +00:00
Andy Wingo
ca1cc01cdf Literal pools have word-alignment, not u64-alignment
Prevents useless over-alignment for ARM.

* lightening/lightening.c (struct jit_literal_pool_entry): Value is a
  uintptr_t.
  (emit_uintptr): New helper.
  (emit_abs_reloc): Use new helper.
  (patch_pending_literal): Value is a uintptr_t.
  (emit_literal_pool): Adapt to literal entry being uintptr_t.
2020-07-30 14:04:47 +02:00
Andy Wingo
a6fc30d810 Merge branch 'size-data' into 'master'
Allow jit_begin_data to declare max data size

See merge request wingo/lightening!9
2020-07-30 11:44:44 +00:00
Andy Wingo
44b07aef4b Allow jit_begin_data to declare max data size
* lightening.h:
* lightening/lightening.c (jit_begin_data): Add max data size
  parameter.  If nonzero, can allow the JIT to avoid prematurely
  emitting a constant pool.
  (jit_end_data): Allow pending literals.
* tests/jmp_table.c (run_test): Use new API.
2020-07-30 13:41:02 +02:00
Andy Wingo
5342eb542f Add JIT implementation for jtable
* libguile/jit.c (compile_jtable): Implement.
2020-07-30 13:26:12 +02:00
Andy Wingo
439e93a5ed Merge https://gitlab.com/wingo/lightening master branch 2020-07-30 13:07:02 +02:00
Andy Wingo
644ee3a37f Merge branch 'table-switch' into 'master'
Add support for emitting inline data and table switches

See merge request wingo/lightening!6
2020-07-30 11:06:08 +00:00
Andy Wingo
91c1591e41 Add support for emitting inline data and table switches
* lightening.h:
* lightening/lightening.c (jit_begin_data, jit_end_data)
  (jit_emit_u8, jit_emit_u16, jit_emit_u32, jit_emit_u64): Add new raw
  data-emitting primitives, bracketed by begin/end so that we can flush
  constant pools first, if needed.
* lightening/lightening.c (struct jit_state): Add new emitting_data
  flag.
  (jit_begin, jit_reset, jit_end): Handle the new flag.
  (emit_abs_reloc): Move here, from x86.c.
* lightening/x86.c (emit_abs_reloc): Remove.
  (jit_try_shorten): Don't shorten if loc == start; could be raw data.
* tests/jmp_table.c: New test.
2020-07-30 13:02:46 +02:00
Andy Wingo
7b4840d7df Merge branch 'fix-tail-call-test' into 'master'
Ensure tail caller and callee in jmpi test have compatible ABI

See merge request wingo/lightening!8
2020-07-30 10:01:28 +00:00
Andy Wingo
6c7813a05f Ensure tail caller and callee in jmpi test have compatible ABI
* tests/jmpi.c: Emit the tail callee using the JIT, to ensure that it
  saves and restores registers in the same way as the caller.  Fixes
  #16.
2020-07-30 11:52:57 +02:00
Andy Wingo
56d92850c6 Merge branch 'fix-aarch64-veneers' into 'master'
Fix patch_veneer on aarch64

See merge request wingo/lightening!7
2020-07-30 09:19:39 +00:00
Andy Wingo
b2ef1d5fba Fix patch_veneer on aarch64
* lightening/aarch64.c (patch_veneer): Fix absolutely bogus patch_veneer
  implementation.
2020-07-30 11:17:46 +02:00
Andy Wingo
bb7fa5bdc2 Add jtable instruction
* doc/ref/vm.texi (Instruction Set): Document new v32-x8-l24 instruction
  kind.
  (Branch Instructions): Document jtable.
* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add
  V32_X8_L24.
* libguile/jit.c (compile_jtable, compile_jtable_slow):
  (COMPILE_X8_S24__V32_X8_L24, analyze): Add stub JIT compiler
  implementation.
* libguile/vm-engine.c (jtable): New instruction.
* module/language/bytecode.scm (instruction-arity): Deprecate.
* module/system/vm/assembler.scm (encoder, assembler): Add V32_X8_L24
  case.
* module/system/vm/disassembler.scm (u32-ref, s32-ref): Move definitions
  to expansion-time only.
  (define-op-handlers): New definition, replacing visit-opcodes.
  (disassemblers, jump-parsers, stack-effect-parsers, clobber-parsers):
  Rework in terms of define-op-handlers.  Default case becomes #f, and
  add support for jtable.
  (disassemble-one, instruction-relative-jump-targets)
  (instruction-stack-size-after, instruction-slot-clobbers): Inline
  default case in the lookup procedure, not copied in the handler
  vector.
  (compute-labels): Add jtable case.
  (instruction-lengths-vector, instruction-length): Rework to allow
  variable-length instructions, and mark jtable as being
  variable-length.
  (instruction-has-fallthrough?): Add jtable to the no-fallthrough
  set.
2020-07-23 12:24:11 +02:00
Ludovic Courtès
5e1748f751 Update NEWS.
* NEWS: Update.
2020-06-24 15:42:12 +02:00
Ludovic Courtès
4e8ead96f7 GNU Guile 3.0.4 (SONAME fix).
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_CURRENT): Increment.
(LIBGUILE_INTERFACE_REVISION): Reset.
(LIBGUILE_INTERFACE_AGE): Increment.  This accounts for commit, which
adds a new symbol to the ABI.
2020-06-24 15:30:55 +02:00
Ludovic Courtès
1b2be93d6e Revert "GNU Guile 3.0.3."
This change suggested an ABI incompatibility that's not there for normal
builds:

  https://lists.gnu.org/archive/html/guile-user/2020-06/msg00059.html

Reported by Chris Vine.

This reverts commit 5d052c87bd.
2020-06-24 15:30:47 +02:00
Ludovic Courtès
5d052c87bd GNU Guile 3.0.3.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
(LIBGUILE_INTERFACE_CURRENT): Increment.
(LIBGUILE_INTERFACE_REVISION, LIBGUILE_INTERFACE_AGE): Reset.
This accounts for commit b517a91ba4 and
similar, which remove C functions in '--disable-deprecated' builds.
2020-06-21 22:17:20 +02:00
Ludovic Courtès
492717db95 Update NEWS.
* NEWS: Update.
2020-06-21 22:17:20 +02:00
Ludovic Courtès
3523ad1326 Update NEWS.
* NEWS: Update.
2020-06-21 15:11:43 +02:00
Ludovic Courtès
7e814190e3 Merge upstream 'lightening'
* libguile/lightening: Merge from https://gitlab.com/wingo/lightening,
commit 24ef197b12.
2020-06-21 15:04:32 +02:00
Dale P. Smith
24ef197b12 Add 'movi' test.
This is a followup to 1bb909a44d.  It
reproduces the bug that 1bb909a44d fixes
on ARMv7.

* tests/movi.c: New file.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-06-20 16:34:37 +02:00
Ludovic Courtès
e20ca01d9b tests: Remove 'glibc' from the 'guix environment' command line.
* tests/Makefile (CC_IA32, CC_AARCH64, CC_ARMv7): Remove 'glibc' from
the 'guix environment' command line since it's redundant with
'gcc-toolchain'.
2020-06-20 16:14:10 +02:00
Ludovic Courtès
e3d9bdf03f tests: Make 'TARGETS' overridable.
This allows users to run "make TARGETS=armv7", for instance.

* tests/Makefile (TARGETS): Make it overridable.
2020-06-20 16:13:16 +02:00
Andrew Gierth
1bb909a44d Fix ARMv7 THUMB encoding for immediates.
* lightening/arm-cpu.c (encode_thumb_immediate): Fix return value in
third case.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-20 15:57:06 +02:00
Ludovic Courtès
5f22d1090b popen: Correct 'pipeline' docstring.
* module/ice-9/popen.scm (pipeline): Change docstring for correct
Texinfo syntax and to use commas instead of em dashes, as in the manual.
2020-06-19 21:06:09 +02:00
Ludovic Courtès
c7f76d94da popen: 'open-process' returns unbuffered ports.
* module/ice-9/popen.scm (open-process)[unbuffered, fdes-pair]: New
procedures.
Use them.  Return unbuffered ports.
* test-suite/tests/popen.test ("open-pipe*"): New test prefix.
2020-06-19 20:59:04 +02:00
Andy Wingo
52baa45d40 Merge upstream 'lightening'
* libguile/lightening: Merge from https://gitlab.com/wingo/lightening.
2020-06-19 16:30:59 +02:00
Andy Wingo
2c0fdb045e Fix unused variable warning for no-literal-pool targets
* lightening/lightening.c (jit_patch_there): Conditionally define
  flags.
2020-06-19 16:30:12 +02:00
Andy Wingo
85d2766aa4 Merge upstream 'lightening'
* libguile/lightening: Merge from https://gitlab.com/wingo/lightening.
2020-06-19 16:26:53 +02:00
Andy Wingo
6e317e70dd Merge branch 'fix-literal-pool-reset' into 'master'
Fix zeroing of literal pool entries

See merge request wingo/lightening!5
2020-06-19 14:25:36 +00:00
Andy Wingo
97212e87bd Fix zeroing of literal pool entries
* lightening/lightening.c (reset_literal_pool): Zero before setting size
  to 0.  Thanks to Dale Smith for pointing this out!
2020-06-19 16:23:36 +02:00
Andy Wingo
921f13a03b Merge branch 'fix-rotate-by-zero' into 'master'
Fix undefined behavior in ARMv7 assembler

See merge request wingo/lightening!4
2020-06-19 14:18:14 +00:00
Andy Wingo
ffba9b08c4 Fix undefined behavior in ARMv7 assembler
* lightening/arm-cpu.c (rotate_left): Fix the case of rotating by zero,
  which produced undefined behavior.  Many thanks to Andrew
  Gierth (andrew at tao11 riddles org uk) for the debugging and the
  fix.
2020-06-19 16:14:52 +02:00
Ludovic Courtès
a0b9d86638 Tree-IL-to-CPS compiler delays calls to 'target-most-positive-fixnum'.
Fixes a bug whereby, for example, "guild compile --target=i686-linux-gnu"
running on x86_64 would generate invalid code for 'bytevector-u32-native-set!'
because 'target-most-positive-fixnum' was called from the top-level
when (language tree-il compile-cps) was loaded.

Consequently, the .go files under prebuilt/ would be invalid, leading to
build failures on 32-bit platforms.

This issue became apparent with cb8cabe85f.

* module/language/tree-il/compile-cps.scm (bytevector-ref-converter)[tag]:
Turn into a lambda so that 'target-most-positive-fixnum' is called in
the right context.
(bytevector-set-converter)[integer-unboxer]: Likewise.
2020-06-19 16:00:29 +02:00
Ludovic Courtès
1ab2105339 web: Accept URI host names consisting only of hex digits.
Fixes <https://bugs.gnu.org/40582>.
Reported by Julien Lepiller <julien@lepiller.eu>.

Previously, a host part consisting of hex digits would be mistaken as an
IPv6 address and rejected by 'valid-host?'.

* module/web/uri.scm (ipv6-regexp): Add colon.
* test-suite/tests/web-uri.test ("string->uri")["xyz://abc/x/y/z"]: New
test.
* NEWS: Update.
2020-06-18 17:06:29 +02:00
Arun Isaac
dfca16fd23 doc: Mention (ice-9 time) module path.
* doc/ref/scheme-using.texi (Profile Commands): Mention (ice-9 time)
module path.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:30 +02:00
Arun Isaac
67f5b451b0 doc: Document default delimiter of string-join.
* doc/ref/api-data.texi (String Constructors): Document default
delimiter of the string-join function.
* libguile/srfi-13.c (scm_string_join): Adjust docstring accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:30 +02:00
Arun Isaac
782a5af969 doc: Improve content-range HTTP header documentation.
* doc/ref/web.texi (HTTP Headers): Improve punctuation in content-range
HTTP header documentation.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:30 +02:00
Arun Isaac
3f279562ff doc: Fix minor typo in the HTTP headers documentation.
* doc/ref/web.texi (HTTP Headers): Fix minor typo.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:30 +02:00
Ludovic Courtès
a43aa1bc79 texinfo: Add basic support for @w{...}.
* module/texinfo.scm (texi-command-specs): Add 'w'.
(space-significant?): Add it.
* module/texinfo/html.scm (tag-replacements): Add 'w'.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add test.
2020-06-18 00:30:30 +02:00
Ricardo G. Herdt
5fbf5c10fc doc: Add missing canonicalize-path documentation.
The documentation is copied over from libguile/filesys.c. I just added
"(absolute)" to the text to help users finding it, since this term is
more common in other languages.

* doc/ref/posix.texi (File System): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:30 +02:00
Jan (janneke) Nieuwenhuizen
52809cc630 read: Use "invalid" rather than "illegal".
* libguile/read.c (scm_read_string_like_syntax): All characters are
permitted by law; some aren't valid in certain contexts.
* test-suite/tests/reader.test: Replace occurrences of "illegal" by
"invalid".
* test-suite/tests/strings.test: Likewise.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-06-18 00:30:11 +02:00
Ludovic Courtès
a15acbb828 srfi-1: Rewrite 'assoc' in Scheme.
* libguile/srfi-1.c (scm_srfi1_assoc): Remove.
* libguile/srfi-1.h (scm_srfi1_assoc): Likewise.
* module/srfi/srfi-1.scm (assoc): New procedure.
2020-06-17 17:59:35 +02:00
Ludovic Courtès
cd4c747fb8 srfi-1: Rewrite 'find-tail' in Scheme.
* libguile/srfi-1.c (scm_srfi1_find_tail): Remove.
* libguile/srfi-1.h (scm_srfi1_find_tail): Likewise.
* module/srfi/srfi-1.scm (find-tail): New procedure.
2020-06-17 17:33:28 +02:00
Ludovic Courtès
0360843ace srfi-1: Rewrite 'find' in Scheme.
This halves the wall-clock time of:

  guile -c '(use-modules (srfi srfi-1)) (define lst (make-list 100000000 1)) (find zero? lst)'

and yields an 18% speedup on:

  guile -c '(use-modules (srfi srfi-1)) (define lst (make-list 100000000 1)) (find (lambda (x) (= 2 x)) lst)'

* libguile/srfi-1.c (scm_srfi1_find): Remove.
* libguile/srfi-1.h (scm_srfi1_find): Likewise.
* module/srfi/srfi-1.scm (find): New procedure.
* doc/ref/srfi-modules.texi (SRFI-1 Searching): Adjust docstring.
2020-06-17 17:25:23 +02:00