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

1586 commits

Author SHA1 Message Date
Andy Wingo
b331ea3193 Convert "ash" to "lsh"/"rsh" when lowering to CPS
* module/language/cps/effects-analysis.scm: Remove case for "ash".
* module/language/cps/types.scm (ash): Remove.
* module/language/tree-il/compile-cps.scm (convert, canonicalize):
  Convert "ash" to "lsh"/"rsh" early on.
* module/system/base/target.scm (target-fixnum?): New procedure.
2017-11-11 22:08:14 +01:00
Andy Wingo
a268c02fa0 Compiler uses target fixnum range
* module/system/base/target.scm (target-most-negative-fixnum):
  (target-most-positive-fixnum): New definitions.
* module/language/cps/types.scm (constant-type, define-exact-integer!)
  (&min/fixnum, &max/fixnum): Use new definitions.
  (&max/vector): Use target-max-vector-length.
2017-11-11 22:08:14 +01:00
Andy Wingo
8b5f9648ff Add tag-fixnum instruction
* libguile/vm-engine.c (tag-fixnum): New instruction.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
* module/language/cps/effects-analysis.scm:
* module/language/cps/types.scm (&min/fixnum, &max/fixnum, tag-fixnum):
* module/system/vm/assembler.scm: Add support for the new instruction.
2017-11-11 22:08:14 +01:00
Andy Wingo
7bfdd46ea5 Use immediate primcalls when unfolding constructors
* module/language/cps/constructors.scm (inline-vector): Use immediate
  primcalls.
2017-11-11 22:08:14 +01:00
Andy Wingo
b27065fdf2 Closure conversion uses immediate variants of vector instructions
* module/language/cps/closure-conversion.scm (convert-one): Use
  immediate variants of vector instructions.
2017-11-11 22:08:14 +01:00
Andy Wingo
9da03136e5 Specialize comparisons to SCM as s64
* module/language/cps/specialize-numbers.scm (specialize-s64-comparison)
  (specialize-s64-scm-comparison, specialize-scm-s64-comparison): New
  helpers.
  (specialize-scm-u64-comparison, specialize-u64-scm-comparison):
  Remove.  Comparing SCM as s64 is better as fixnums are a subset of
  s64, not u64.
  (specialize-operations): Prefer s64 comparisons when we can't
  specialize both arguments; this at least inlines the fixnum case.
2017-11-11 22:08:14 +01:00
Andy Wingo
7a7f71de5c Canonicalize <=, >=, and > primcalls to <
* module/language/tree-il/compile-cps.scm (canonicalize): Convert <=,
  >=, and > primcalls to <.
* module/language/cps/primitives.scm (*comparisons*):
* module/language/cps/effects-analysis.scm: Remove superfluous
  primcalls.
* module/language/cps/specialize-numbers.scm
  (specialize-u64-scm-comparison): Only emit < primcalls for ordered
  comparisons.
  (specialize-scm-u64-comparison): New helper.
* module/language/cps/specialize-numbers.scm (specialize-operations):
  Remove support for >=, <=, and the like.
* module/language/cps/type-fold.scm: Remove folders for <= and so on.
* module/language/cps/types.scm (define-=-inferrer, define-<-inferrer):
  New helpers; use them for all = and < variants.  Remove checkers and
  inferrers for <= and the like.
* module/language/cps/compile-bytecode.scm (compile-function): Remove
  unnecessary cases.
2017-11-11 22:08:14 +01:00
Andy Wingo
8b3258716c Refactor numeric comparison bytecode emission
* module/language/cps/compile-bytecode.scm (compile-function): Refactor.
2017-11-11 22:08:14 +01:00
Andy Wingo
375eab5610 Fix effects analysis bug introduced with primcall param
* module/language/cps/effects-analysis.scm (primitive-effects): Fix
  swapped name and param.  Embarrassing!
2017-11-11 22:08:14 +01:00
Andy Wingo
f96a670332 Add new "throw" VM ops
* libguile/throw.h (scm_ithrow, scm_throw): Mark as SCM_NORETURN.
* libguile/throw.c (scm_throw, scm_ithrow): Adapt to not return.
* libguile/vm-engine.c (throw, throw/value, throw/value+data): New
  instructions.
* libguile/vm.c (vm_throw, vm_throw_with_value)
  (vm_throw_with_value_and_data): New helpers.
* module/language/cps/compile-bytecode.scm (compile-function): Add cases
  for new instructions.
* module/language/cps/prune-bailouts.scm (prune-bailouts): More simple,
  now that there are no $kreceives in play.
* module/language/cps/reify-primitives.scm (reify-clause): Update
  reification of no-clause functions to use new throw op.
* module/language/tree-il/compile-cps.scm (convert): Convert invocations
  of the variable-arity 'throw primitive from Tree-IL to the new
  fixed-arity CPS instructions.
* module/system/vm/assembler.scm (emit-throw/value*)
  (emit-throw/value+data*, emit-throw): Export new instructions.
* module/system/vm/disassembler.scm (code-annotation): Add annotation.
2017-11-05 15:00:16 +01:00
Andy Wingo
cf486700b7 error, scm-error primcalls expand to `throw'
* module/language/tree-il/primitives.scm (scm-error, error): Expand
  into `throw'.
* module/language/tree-il/peval.scm (peval): Reify "throw" for dynwind
  error.
* module/language/tree-il/compile-cps.scm (canonicalize): Reify "throw"
  for call-with-prompt error.
* module/language/cps/prune-bailouts.scm (prune-bailouts): Don't expect
  "error" or "scm-error" here.
2017-11-05 15:00:16 +01:00
Andy Wingo
17bd5a8938 Add lsh, rsh instructions
* libguile/vm-engine.c (lsh, rsh, lsh/immediate, rsh/immediate): New
  instructions taking unboxed bit counts.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm:
* module/language/cps/specialize-numbers.scm (specialize-f64-unop):
  (specialize-u64-unop): Add ability to specialize add/immediate, etc,
  and add lsh/immediate as well.
  (specialize-u64-binop, specialize-u64-shift): Move rsh/lsh
  specialization to its own procedure, given that the bit count is
  already unboxed.
  (specialize-operations): Adapt to support more /immediate
  instructions.
* module/language/cps/type-fold.scm (mul): Reify an lsh/immediate
  instead of an ash.
* module/language/cps/types.scm (compute-ash-range): Add type inferrers
  for lsh, rsh, and their immediate variants.
* module/system/vm/assembler.scm: Export emit-lsh and so on.
* module/language/tree-il/compile-cps.scm (convert): Convert "ash" on
  immediates to rsh/immediate or lsh/immediate.
2017-11-05 15:00:16 +01:00
Andy Wingo
dea84a46b4 Earlier conversion to /imm primcalls
* module/language/tree-il/compile-cps.scm (convert): Convert to /imm
  variants of primcalls early on, to decrease complexity of later
  passes.
2017-11-05 15:00:16 +01:00
Andy Wingo
5457f28af9 Specialize primcalls more aggressively
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
  Don't restrict /imm params to encodeable immediates; specialize any
  imm.  Rely on reify-primitives to undo the transformation if needed.
2017-11-05 15:00:16 +01:00
Andy Wingo
ecff426b89 (system base types) uses target's idea of max size_t
* module/system/base/target.scm (target-max-size-t):
  (target-max-size-t/scm, target-max-vector-length): New public
  functions.
* module/language/cps/types.scm (type-entry-saturating-union): Remove
  restriction of polymorphic types to be within max-size-t; this could
  incorrectly apply constraints on numeric values.
  (&max/size, &max/scm-size): Use target-max-size-t.
  (*max-size-t*): Remove; replace uses with (target-max-size-t).
2017-11-05 15:00:16 +01:00
Andy Wingo
e8b883035d Tweak optimization order
* module/language/cps/optimize.scm (optimize-first-order-cps): Move up
  the simplify-primcalls pass, to allow DCE to take away unneeded
  constants.  An incremental step
2017-11-05 15:00:16 +01:00
Andy Wingo
1160690fde reify-primitives reifies constants for out-of-range imm params
* module/language/cps/reify-primitives.scm (reify-primitives): Add pass
  to re-reify constant arguments for primcalls with immediate parameters
  that can't be encoded as bytecode.
2017-11-05 15:00:16 +01:00
Andy Wingo
cc1b23ffe8 Remaining /immediate instructions take primcall imm param
* module/language/cps/compile-bytecode.scm (compile-function): Update
  add/immediate, etc.
* module/language/cps/slot-allocation.scm (compute-needs-slot):
  Simplify.
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
  Rework for add/immediate, etc.
* module/language/cps/types.scm (define-unary-result!)
  (define-binary-result!): Take types as params instead of variables, so
  we can share this code with /imm variants.
  (add/immediate, sub/immediate, uadd/immediate, usub/immediate)
  (umul/immediate, ulsh/immediate, ursh/immediate): Update type
  inferrers.
2017-11-05 15:00:16 +01:00
Andy Wingo
56d639bfe5 builtin-ref takes immediate parameter
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/reify-primitives.scm (builtin-ref):
* module/language/cps/slot-allocation.scm (compute-needs-slot):
  Builtin-ref uses immediate parameter.
2017-11-05 15:00:16 +01:00
Andy Wingo
d7ecf35d70 Immediate parameter for struct-ref et al
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
* module/language/cps/effects-analysis.scm:
* module/language/cps/slot-allocation.scm (compute-needs-slot):
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
* module/language/cps/types.scm (allocate-struct/immediate)
  (struct-ref/immediate, struct-set!/immediate): Immediate struct
  constructor and accessor use immediate primcall parameters.
2017-11-05 15:00:16 +01:00
Andy Wingo
f9b8763921 Immediate variants of vector-ref, etc use immediate param
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
* module/language/cps/effects-analysis.scm:
* module/language/cps/slot-allocation.scm (compute-needs-slot):
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
* module/language/cps/types.scm (make-vector/immediate):
  (vector-ref/immediate, vector-set!/immediate): Use immediate primcall
  param.
2017-11-05 15:00:16 +01:00
Andy Wingo
2f45cfcb9c free-ref, free-set take immediate parameters
* module/language/cps/closure-conversion.scm (convert-one):
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm (define-primitive-effects*)
  (expression-effects, primitive-effects): Only fall back to passing
  constant table if the immediate parameter is false.  Adapt closure
  effects analysis.
* module/language/cps/slot-allocation.scm (compute-needs-slot): Remove
  special cases for free-ref/free-set!.
2017-11-05 15:00:16 +01:00
Andy Wingo
6be04684e6 load-f64, etc take immediate parameters
* module/language/cps/compile-bytecode.scm (compile-function): Make
  load-f64, load-s64, and load-u64 take an immediate parameter instead
  of a CPS value.
* module/language/cps/effects-analysis.scm: Remove CPS argument from
  immediate load instructions.
* module/language/cps/slot-allocation.scm (compute-needs-slot): Remove
  special case for load-64 etc.
* module/language/cps/specialize-numbers.scm
  (specialize-u64-scm-comparison): Adapt.
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
  Adapt.
* module/language/cps/types.scm (define-type-inferrer*): Also take param
  argument.
  (define-type-inferrer, define-predicate-inferrer): Adapt.
  (define-type-inferrer/param): New helper.
  (load-f64, load-s64, load-u64): Adapt inferrers to pass on value from
  param.
* module/language/cps/utils.scm (compute-constant-values): Adapt.
2017-11-05 15:00:16 +01:00
Andy Wingo
4fb538e90e cache-current-module, etc use immediate primcall parameters
* module/language/bytecode.scm (*macro-instruction-arities*):
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm (current-module):
* module/language/cps/primitives.scm (*macro-instruction-arities*):
* module/language/cps/prune-top-level-scopes.scm (compute-used-scopes):
  (prune-top-level-scopes):
* module/language/cps/reify-primitives.scm (module-box):
* module/language/cps/slot-allocation.scm (compute-needs-slot):
* module/language/tree-il/compile-cps.scm (toplevel-box):
  (module-box, capture-toplevel-scope): Move the primcalls that deal
  with top-level references to use immediate parameters.
2017-11-05 15:00:16 +01:00
Andy Wingo
c54c151eb6 $primcall has a "param" member
* module/language/cps.scm ($primcall): Add "param" member, which will be
  a constant parameter to the primcall.  The idea is that constants used
  by primcalls as immediates don't need to participate in optimizations
  in any way -- they should not participate in CSE, have the same
  lifetime as the primcall so not part of DCE either, and don't need
  slot allocation.  Indirecting them through a named $const binding is
  complication for no benefit.  This change should eventually improve
  compilation time and memory usage, once we fully take advantage of it,
  as the number of labels and variables will go down.
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/handle-interrupts.scm:
* module/language/cps/licm.scm:
* module/language/cps/peel-loops.scm:
* module/language/cps/prune-bailouts.scm:
* module/language/cps/prune-top-level-scopes.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/renumber.scm:
* module/language/cps/rotate-loops.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/specialize-numbers.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/split-rec.scm:
* module/language/cps/type-checks.scm:
* module/language/cps/type-fold.scm:
* module/language/cps/types.scm:
* module/language/cps/utils.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Adapt all users.
2017-11-05 15:00:16 +01:00
Andy Wingo
9ceab9962a Simplify special immediate predicate inferrer.
* module/language/cps/types.scm
  (define-special-immediate-predicate-inferrer): Simplify.
2017-10-30 12:06:11 +01:00
Andy Wingo
0d42f5467f Lower logtest branches to instead be 'zero? logand'
* module/language/cps/compile-bytecode.scm (compile-function): Rename
  the binary* helper back to binary, update uses, and remove logtest
  branch as we no longer put logtest in test context.
* module/language/cps/primitives.scm (*comparisons*): Remove logtest.
* module/language/cps/type-fold.scm: Remove logtest folder.
  (logbit?): Fold to logand.
* module/language/cps/types.scm (logtest): Update to be a type inferrer
  and not a predicate inferrer.
* module/language/tree-il/peval.scm (peval): Transform logtest and
  logbit? to (zero? (logand _ _)).
2017-10-30 11:50:45 +01:00
Andy Wingo
d1c69b5c95 Remove compiler support for u64-scm comparisons
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm:
* module/language/cps/primitives.scm (*comparisons*):
* module/language/cps/type-fold.scm:
* module/language/cps/types.scm: Remove compiler support for u64-scm
  comparisons, as this is now inlined.
2017-10-29 21:02:56 +01:00
Andy Wingo
6bb0a96fa1 Inline u64/scm comparisons
* module/language/cps/specialize-numbers.scm
  (specialize-u64-scm-comparison): Inline comparisons against fixnums.
2017-10-29 20:35:30 +01:00
Andy Wingo
f34abbc396 Add hacks around lack of allocation sinking
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
* module/language/cps/effects-analysis.scm:
* module/language/cps/primitives.scm (*macro-instruction-arities*):
* module/language/cps/specialize-numbers.scm (compute-specializable-vars):
* module/language/cps/types.scm: Add new variants of u64->scm and
  s64->scm that can't be replaced by CSE's auxiliary definitions, so we
  can sink unlikely allocations to side branches.  This is a hack until
  we can get allocation sinking working
2017-10-29 20:33:35 +01:00
Andy Wingo
c9ec866ef9 Add untag-fixnum instruction
* libguile/vm-engine.c (untag-fixnum): New instruction.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/system/vm/assembler.scm (untag-fixnum):
* module/language/cps/slot-allocation.scm (compute-var-representations):
* module/language/cps/types.scm (untag-fixnum): Add compiler support for
  untag-fixnum.
2017-10-29 19:56:51 +01:00
Andy Wingo
31e7f44340 Add compiler support for fixnum? primcall predicate
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/type-fold.scm (fixnum?):
* module/language/cps/types.scm (fixnum?):
* module/system/vm/assembler.scm (system): Add cases for fixnum?
  primcall predicate.
2017-10-29 19:42:50 +01:00
Andy Wingo
79a2748f83 Add compiler support for s64 comparisons.
* module/language/cps/compile-bytecode.scm (compile-function): Add
  emitters for s64 comparisons.
* module/language/cps/effects-analysis.scm: Add entries.
* module/language/cps/primitives.scm (*comparisons*):
* module/language/cps/type-fold.scm (s64-<, s64-<=, s64-=, s64->=)
  (s64->): Add folders.
* module/language/cps/types.scm (s64-<, s64-<=, s64-=, s64->=, s64->):
  Add type checkers and inferrers.
2017-10-29 19:42:14 +01:00
Andy Wingo
73d1502630 Lower eqv? and equal? to new instructions.
* libguile/numbers.h:
* libguile/eq.c (scm_i_heap_numbers_equal_p): New helper, factored out
  of scm_eqv_p.
  (scm_eqv_p): Use new helper.
* libguile/vm-engine.c (heap-numbers-equal?): New op.
* module/language/cps/compile-bytecode.scm (compile-function): Add
  support for heap-number? and heap-numbers-equal?.  Remove case for
  eqv?.
* module/language/cps/effects-analysis.scm: Add heap-numbers-equal?.
* module/language/cps/primitives.scm (*comparisons*): Add
  heap-numbers-equal?.
* module/language/cps/type-fold.scm (heap-numbers-equal?): Update.
* module/language/cps/types.scm (heap-numbers-equal?): Update.
* module/language/tree-il/compile-cps.scm (canonicalize): Completely
  inline eqv?, and partially inline equal?.
* module/system/vm/assembler.scm (system): Export emit-heap-numbers-equal?.
2017-10-29 15:47:25 +01:00
Andy Wingo
c2fa345093 Add missing compiler support for heap-object? primcall et al.
* module/language/cps/effects-analysis.scm: Reorder effect-free
  primitives.  Add immediate predicates and heap-number?.
* module/language/cps/primitives.scm (*heap-type-predicates*): Add
  heap-number?.
* module/language/cps/type-fold.scm (heap-number?): New folder.
* module/language/cps/types.scm (heap-number?): New inferrer.
2017-10-29 14:35:19 +01:00
Andy Wingo
587842d874 Simplify lowering of branching primcalls to CPS
* module/language/tree-il/compile-cps.scm (canonicalize, convert):
  Simplify handling of branching primcalls so that `convert' only ever
  sees branching primcalls in a test context.
2017-10-29 14:31:36 +01:00
Andy Wingo
3ae245bc98 Minor optimization compiling 'and'
* module/language/tree-il/compile-cps.scm (convert): Fold test of
  constants directly to their branches without reifying booleans, to
  simplify "and" chains early.
2017-10-29 14:07:23 +01:00
Andy Wingo
9d1235af96 Use new instructions for f64 comparisons
* module/language/cps/compile-bytecode.scm (compile-function): Use new
  instructions for f64 comparisons.
2017-10-29 10:05:24 +01:00
Andy Wingo
8a96b5d085 Use new instructions for u64 comparisons.
* module/language/cps/compile-bytecode.scm (compile-function): Compile
  new instructions for u64 comparisons.
2017-10-29 10:05:24 +01:00
Andy Wingo
f8ac680965 Use new instructions for less-than, etc
* module/language/cps/compile-bytecode.scm (compile-function): Use new
  instructions for generic numeric comparisons (< <= = >= >).
2017-10-29 10:05:24 +01:00
Andy Wingo
056914b555 Emit new eq? instruction
* module/language/cps/compile-bytecode.scm (compile-function): Emit
  new-style eq? instruction.
2017-10-29 10:05:24 +01:00
Andy Wingo
c119623e45 Simplify $branch to always take a $primcall
* module/language/tree-il/compile-cps.scm (convert): Lower (if foo A B)
  to (if (false? foo) B A).
* module/language/cps/specialize-numbers.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/peel-loops.scm:
* module/language/cps/rotate-loops.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/split-rec.scm:
* module/language/cps/type-fold.scm:
* module/language/cps/types.scm:
* module/language/cps/verify.scm: Adapt.
* module/language/cps/compile-bytecode.scm: Add support for new-style
  false? instruction for false? primcall.
2017-10-29 10:05:24 +01:00
Andy Wingo
c74b2257c7 Use new instructions for null?, nil?
* module/language/cps/compile-bytecode.scm (compile-function): Use new
  instructions for branches on null? and nil?.
2017-10-29 10:05:24 +01:00
Andy Wingo
e3c062dce6 Emit char? instead of br-if-char
* module/language/cps/compile-bytecode.scm (compile-function): Use new
  instructions for char? test.
2017-10-29 10:05:24 +01:00
Andy Wingo
29b8e32ffe Emit new instructions for heap object type tests
* module/language/cps/compile-bytecode.scm (compile-function): Compile
  heap object tests to use the new instructions.
2017-10-29 10:05:24 +01:00
Andy Wingo
1139c10e09 Heap type predicates preceded by heap-object?
* module/language/cps/compile-bytecode.scm (compile-function): Add
  support for heap-object? in test context.
* module/language/cps/primitives.scm (*immediate-predicates*):
  (*heap-type-predicates*, *comparisons*): New sets of predicates for
  which the VM has branching operations.
  (heap-type-predicate?): New predicate.
  (*branching-primcall-arities*): Make a hash table.
  (branching-primitive?, prim-arity): Adapt
  to *branching-primcall-arities* being a hash table.
* module/language/cps/type-fold.scm (heap-object?): Add folder.
* module/language/tree-il/compile-cps.scm (convert): Precede heap type
  checks with a heap-object? guard.
2017-10-29 10:05:24 +01:00
Andy Wingo
cd947a1161 Model all special immediates under one type bit (with range)
* module/language/cps/types.scm (&special-immediate): Model all special
  immediates (iflags) under this type bit.  This makes type analysis
  less precise on these values as we have to use ranges instead of sets
  to represent the values, but it frees up bits for other purposes,
  allowing us to totally model all types in Guile.
  (&eof): New &special-immediate value.
  (&other-heap-object): New type bit.
  Adapt inferrers.
* module/language/cps/type-fold.scm
  (define-special-immediate-predicate-folder): New helper, used for
  iflag comparisons.
  (local-type-fold): Adapt scalar-value for &special-immediate change.
  Delegate branch on $values to a primcall to `false?'.
2017-10-26 15:51:28 +02:00
Andy Wingo
2ca88789b1 Type inference distinguishes &fixnum and &bignum types
This will allow heap-object? / inum? predicates to do something useful.

* module/language/cps/types.scm (&fixnum, &bignum): Split &exact-integer
  into these types.  Keep &exact-integer as a union type.
  (type<=?): New helper.
  (constant-type): Return &fixnum or &bignum as appropriate.
  (define-exact-integer!): New helper, tries to make exact integer
  results be &fixnum if they are within range.  Adapt users.
  (restricted-comparison-ranges, define-binary-result!): Use type<=?
  instead of = for &exact-integer.
* module/language/cps/type-fold.scm (logtest, mul, logbit?): Use
  type<=?.
* module/language/cps/specialize-numbers.scm (inferred-sigbits):
  (specialize-operations): Use type<=?.
2017-10-26 15:23:16 +02:00
Andy Wingo
3d848f22f8 First step towards emitting new instructions: "j" instead of "br"
* module/language/cps/compile-bytecode.scm (compile-function): Emit "j"
  instructions instead of "br".
2017-10-25 16:53:18 +02:00
Andy Wingo
808000034e Add support for C16_C16 instruction words
* module/language/bytecode.scm (compute-instruction-arity):
* module/system/vm/assembler.scm (pack-u16-u16, expand):
* module/system/vm/disassembler.scm (disassembler):
* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add C16_C16.
2017-10-24 21:11:20 +02:00