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

25 commits

Author SHA1 Message Date
Andy Wingo
b077e807c0 Add nullary intmap and intset folders
* module/language/cps/intmap.scm (intmap-fold, intmap-fold-right):
* module/language/cps/intset.scm (intset-fold, intset-fold-right): Add
  nullary folders.
2017-11-29 19:57:11 +01:00
Andy Wingo
d74e0fed0d Move thread bindings to (ice-9 threads)
* libguile/init.c (scm_i_init_guile): Don't call scm_init_thread_procs.
* libguile/threads.c (scm_init_ice_9_threads): Rename from
  scm_init_thread_procs, make static.
  (scm_init_threads): Register scm_init_thread_procs extension.
* libguile/threads.h (scm_init_thread_procs): Remove decl.
* module/ice-9/boot-9.scm: Load (ice-9 threads), so that related side
  effects occur early.
* module/ice-9/deprecated.scm (define-deprecated): Fix to allow
  deprecated bindings to appear in operator position.  Export deprecated
  bindings.
  (define-deprecated/threads, define-deprecated/threads*): Trampoline
  thread bindings to (ice-9 threads).
* module/ice-9/futures.scm: Use ice-9 threads.
* module/ice-9/threads.scm: Load scm_init_ice_9_threads extension.
  Reorder definitions and imports so that the module circularity
  with (ice-9 futures) continues to work.
* module/language/cps/intmap.scm:
* module/language/cps/intset.scm:
* module/language/tree-il/primitives.scm: Use (ice-9 threads).
* module/language/cps/reify-primitives.scm: Reify current-thread
  in (ice-9 threads) module.
* module/srfi/srfi-18.scm: Use ice-9 threads with a module prefix, and
  adapt all users.  Use proper keywords in module definition form.
* test-suite/tests/filesys.test (test-suite):
* test-suite/tests/fluids.test (test-suite):
* test-suite/tests/srfi-18.test: Use ice-9 threads.
* NEWS: Add entry.
* doc/ref/api-scheduling.texi (Threads): Update.
* doc/ref/posix.texi (Processes): Move current-processor-count and
  total-processor-count docs to Threads.
2016-10-23 22:29:44 +02:00
Andy Wingo
f56f580a4a Inline some helpers in intset.scm.
* module/language/cps/intset.scm (round-down): Inline.
  (clone-branch-and-set): Inline, and inline the vector-move-left!.
2016-01-04 22:48:30 +01:00
Andy Wingo
2df454b95b intset-intersect bugfix
* module/language/cps/intset.scm (intset-intersect): Remove new-leaf
  procedure, inlining to single call site.  An empty intersection
  properly produces #f so that the set can be pruned.
2015-07-22 16:59:47 +02:00
Andy Wingo
3b1d316383 Add intset-prev and intset-fold-right
* module/language/cps/intset.scm (intset-prev): New function.
  (make-intset-folder): Add forward? argument like make-intmap-folder.
  (intset-fold-right): New function.
2015-07-19 12:21:02 +02:00
Andy Wingo
363d6498e5 Tweak intset printing
* module/language/cps/intset.scm: Print members of set as absolute
  values, not diffs from set minumum.
2015-07-14 16:14:09 +02:00
Andy Wingo
dc27708f0b Fix intset-subtract to reliably produce empty-intset
* module/language/cps/intset.scm (intset-subtract): Reliably produce
  empty-intset if the result is empty.
2015-07-13 11:03:00 +02:00
Andy Wingo
47a4727b78 intset-union fast paths
* module/language/cps/intset.scm (intset-union): Add fast paths for
  union with empty intset.
2015-07-13 11:02:29 +02:00
Andy Wingo
d78e5a260c Add "intset" syntax to construct intsets.
* module/language/cps/intset.scm (intset): New syntax.
2015-06-02 10:05:10 +02:00
Andy Wingo
6a42ac74ce intset-next starting point is optional
* module/language/cps/intset.scm (intset-remove): Remove incorrect comment.
  (intset-next): "i" is optional.
2015-06-02 10:05:09 +02:00
Andy Wingo
102e677b98 intmaps and intsets print with abbreviated key ranges
* module/language/cps/intset.scm (intset-key-ranges, range-string):
  (print-helper, print-intset, print-transient-intset): New helpers.
  Install as intset printers.
* module/language/cps/intmap.scm (intmap-key-ranges, range-string):
  (print-helper): New helpers.
  (print-intmap, print-transient-intmap): Call the new helpers.
2015-05-20 19:18:45 +02:00
Andy Wingo
5f7c8e5cb3 Variadic intset-fold, intmap-fold
* module/language/cps/intmap.scm (intmap-fold): Add two-seeded arity.
* module/language/cps/intset.scm (intset-fold): Merge intset-fold2
  into this function, as a two-seeded arity.

* module/language/cps2/simplify.scm (compute-eta-reductions):
  (compute-singly-referenced-labels, compute-beta-reductions): Adapt
  intset-fold2 callers.
2015-05-20 19:18:45 +02:00
Andy Wingo
7fedd7b7ad Fix another intset transient bug
* module/language/cps/intset.scm (intset-add!): If the root is a
  branch but isn't editable, be sure to actually update the transient
  intset's root to store the writable root.
2015-05-09 14:52:47 +02:00
Andy Wingo
f95a794a3d Fix intset-add! transient bug
* module/language/cps/intset.scm (intset-add!): Fix as in
  0f082bd3f7.
2015-05-09 13:46:18 +02:00
Andy Wingo
49cc76ab75 Transient intsets
* module/language/cps/intset.scm (make-atomic-reference)
  (get-atomic-reference, set-atomic-reference!): New functions.
  (*branch-size-with-edit*, *edit-index*): New constants.
  (<transient-intset>): New data type.
  (new-branch, clone-branch-and-set): Adapt to set edit field.
  (transient-intset, persistent-intset): New exports.
  (intset-add!): New interface, supporting "transient" intsets.
  (intset-ref, intset-next, intset-prev, intset-fold, intset-fold2):
  Work with transients.
2015-04-08 17:18:04 +02:00
Andy Wingo
048d5d340e Intset-next micro-optimizations
* module/language/cps/intset.scm (intset-next): Micro-optimizations.
2015-04-01 10:53:23 +02:00
Andy Wingo
9c8d2b85e8 Add intset-fold, intset-fold2
* module/language/cps/intset.scm (intset-fold, intset-fold2): New
  functions.
2015-04-01 10:53:23 +02:00
Andy Wingo
7f6aafa5ae Add bitvector->intset.
* module/language/cps/intset.scm (bitvector->intset): New interface.
2014-07-03 10:37:20 +02:00
Andy Wingo
4296c36ec8 Restrict intsets and maps to non-negative integers
* module/language/cps/intmap.scm (intmap-add):
* module/language/cps/intset.scm (intset-add): Restrict to only hold
  non-negative integers.
2014-07-03 09:37:30 +02:00
Andy Wingo
41296769c7 Add intset-subtract.
* module/language/cps/intset.scm (intset-subtract): New interface.
2014-07-03 09:03:12 +02:00
Andy Wingo
93e838423c Fix intset on 32-bit machines
* module/language/cps/intset.scm (*leaf-bits*): Define to 4 on 32-bit
  machines, to stay in fixnum range.
2014-07-01 11:30:29 +02:00
Andy Wingo
793ca4c433 Result of intsect-intersect will share structure with A if it can
* module/language/cps/intset.scm (intset-intersect): Ensure that the
  result shares structure with A if possible, as intmaps do.
2014-06-29 19:47:38 +02:00
Andy Wingo
257db78b6b Fix an intset-intersect corner case
* module/language/cps/intset.scm (intset-intersect): Avoid creating
  invalid intsets when lowering an intset with a higher shift.
2014-06-29 19:41:16 +02:00
Andy Wingo
b5cb1c77ff Fix intset pruning for empty intsets
* module/language/cps/intset.scm (make-intset/prune): Fix empty intset
  case.
2014-06-29 19:31:41 +02:00
Andy Wingo
b1103eb980 New module: (language cps intset)
* module/Makefile.am: Add to build.
* module/language/cps/intset.scm: New file.
2014-06-29 14:19:03 +02:00