Commit Graph

15 Commits

Author SHA1 Message Date
Matthew Flatt
995e53ca71 Merge github.com:cisco/ChezScheme
original commit: 8cf52012e2a7b5928cb2602bb17e0128ae0f2776
2020-02-22 15:18:47 -07:00
dybvig
d0b405ac8b library-manager, numeric, and bytevector-compres improvements
- added invoke-library
    syntax.ss, primdata.ss,
    8.ms, root-experr*,
    libraries.stex, release_notes.stex
- updated the date
    release_notes.stex
- libraries contained within a whole program or library are now
  marked pending before their invoke code is run so that invoke
  cycles are reported as such rather than as attempts to invoke
  while still loading.
    compile.ss, syntax.ss, primdata.ss,
    7.ms, root-experr*
- the library manager now protects against unbound references
  from separately compiled libraries or programs to identifiers
  ostensibly but not actually exported by (invisible) libraries
  that exist only locally within a whole program.  this is done by
  marking the invisibility of the library in the library-info and
  propagating it to libdesc records; the latter is checked upon
  library import, visit, and invoke as well as by verify-loadability.
  the import and visit code of each invisible no longer complains
  about invisibility since it shouldn't be reachable.
    syntax.ss, compile.ss, expand-lang.ss,
    7.ms, 8.ms, root-experr*, patch*
- documented that compile-whole-xxx's linearization of the
  library initialization code based on static dependencies might
  not work for dynamic dependencies.
    system.stex
- optimized bignum right shifts so the code (1) doesn't look at
  shifted-off bigits if the bignum is positive, since it doesn't
  need to know in that case if any bits are set; (2) doesn't look
  at shifted-off bigits if the bignum is negative if it determines
  that at least one bit is set in the bits shifted off the low-order
  partially retained bigit; (3) quits looking, if it must look, for
  one bits as soon as it finds one; (4) looks from both ends under
  the assumption that set bits, if any, are most likely to be found
  toward the high or low end of the bignum rather than just in the
  middle; and (5) doesn't copy the retained bigits and then shift;
  rather shifts as it copies.  This leads to dramatic improvements
  when the shift count is large and often significant improvements
  otherwise.
    number.c,
    5_3.ms,
    release_notes.stex
- threaded tc argument through to all calls to S_bignum and
  S_trunc_rem so they don't have to call get_thread_context()
  when it might already have been called.
    alloc.c, number.c, fasl.c, print.c, prim5.c, externs.h
- added an expand-primitive handler to partially inline integer?.
    cpnanopass.ss
- added some special cases for basic arithmetic operations (+, -, *,
  /, quotient, remainder, and the div/div0/mod/mod0 operations) to
  avoid doing unnecessary work for large bignums when the result
  will be zero (e.g,. multiplying by 0), the same as one of the
  inputs (e.g., adding 0 or multiplying by 1), or the additive
  inverse of one of the inputs (e.g., subtracting from 0, dividing
  by -1).  This can have a major beneficial affect when operating
  on large bignums in the cases handled.  also converted some uses
  of / into integer/ where going through the former would just add
  overhead without the possibility of optimization.
    5_3.ss,
    number.c, externs.h, prim5.c,
    5_3.ms, root-experr, patch*,
    release_notes.stex
- added a queue to hold pending signals for which handlers have
  been registered via register-signal-handler so up to 63 (configurable
  in the source code) unhandled signals are buffered before the
  handler has to start dropping them.
    cmacros.ss, library.ss, prims.ss, primdata.ss,
    schsig.c, externs.h, prim5.c, thread.c, gc.c,
    unix.ms,
    system.stex, release_notes.stex
- bytevector-compress now selects the level of compression based
  on the compress-level parameter.  Prior to this it always used a
  default setting for compression.  the compress-level parameter
  can now take on the new minimum in addition to low, medium, high,
  and maximum.  minimum is presently treated the same as low
  except in the case of lz4 bytevector compression, where it
  results in the use of LZ4_compress_default rather than the
  slower but more effective LZ4_compress_HC.
    cmacros,ss, back.ss,
    compress_io.c, new_io.c, externs.h,
    bytevector.ms, mats/Mf-base, root-experr*
    io.stex, objects.stex, release_notes.stex

original commit: 72d90e4c67849908da900d0b6249a1dedb5f8c7f
2020-02-21 13:48:47 -08:00
Matthew Flatt
69444da5a0 clear temporary bignum registers
After a bignum computation using temporary thread registers W, U, or V
is complete, clear ther register. (The X and Y registers hold only
small bignums, so clearing them doesn't matter in the same way.)

original commit: a9e11fcf9e86aee5d149764476e1fabfeee12f84
2019-12-30 07:03:19 -07:00
Paulo Matos
af63b73bad Update shift left that might cause ub
A few shift lefts cause ub because of `(1 << n)` where `n` is 31. 
The constant 1 is signed causing ub. Initially my fix was to do `(1U << n)` however, I have seen the pattern `((U32)1 << n)` elsewhere in the file so decided to follow this.

Caught by ubsan racketcs.
original commit: a902c9ab67010f521f786e2027d4e197d78975a4
2019-06-06 08:57:25 -06:00
Matthew Flatt
2cf27c4727 Merge github.com:cisco/ChezScheme
original commit: 8118200e237d756f83be54e8bf3eabb4af2388ed
2019-05-22 10:46:59 -06:00
Bob Burger
62907754b4 fix multiply of -2^30 to itself on 64-bit platforms
original commit: 566c7a98ec4e070a26450781ffc2b9054860e4ed
2019-05-02 15:19:58 -04:00
Matthew Flatt
40ced8629e repair multiply of (- (expt 2 30)) to itself
On a 64-bit platform, the test for "short" arguments to
avoid overflow was incorrect, because `(- (expt 2 30))`
counted as short.

original commit: 6d05b70e86987c0e7a07f221ba5def492300aaaf
2019-05-01 09:20:35 -06:00
Matthew Flatt
3e297e025e adjust make-arity-wrapper to enforce the supplied arity mask
original commit: a9ec7da3ea3b8edc665b060bcba675248119d260
2019-01-15 11:56:03 -07:00
Bob Burger
831ea8ad18 changed copyright year to 2017
7.ss, scheme.1.in, comments of many files

original commit: 06f858f9a505b9d6fb6ca1ac97234927cb2dc641
2017-04-06 11:41:33 -04:00
Bob Burger
39410c8447 - Cygwin is now used on Windows, updated mats, eliminated unused killme
- added a cast to eliminate warnings in c/number.c
- fixed bug in Windows version of directory-separator-predicate in s/6.ss when path-* procedures are passed a path that is not a string.
- fixed bug in s/cp0.ss on Windows with $foreign-wchar?.
- fixed spelling of non-existent

original commit: dd1b741f7572cb0d5a6210c7c796aee7c4026040
2016-06-10 10:07:07 -04:00
dybvig
e7852b36e5 - updated newrelease to produce the correct log-entry format and
fixed the existing 9.4.1 log entry
    newrelease, LOG
- replaced a couple of tabs
    number.c

original commit: 0f0468ffd26fcd08c052df484e651ac042d93b74
2016-05-18 23:48:37 -04:00
Bob Burger
4750828c26 fixed misspellings in comments
original commit: 44370695fbfe86fbf1cd5dd115a2289626604796
2016-05-13 08:49:00 -04:00
dybvig
bf38db8ed9 - modified floatify_normalize to properly round denormalized results and
obviated scale_float in the process.
    number.c,
    ieee.ms
- fixed 0eNNNN for large NNNN to produce 0.0 rather than infinity
    strnum.ss,
    5_3.ms
- the reader now raises an exception with condition type implementation
  restriction (among the other usual lexical condition types), and
  string->number now raises #f, for #e<m>@<a>, where <m> and <a> are
  nonzero integers, since Chez Scheme can't represent polar numbers other
  than 0@<a> and <m>@0 exactly.  <m>@<a> still produces an inexact result,
  i.e., we're still extending the set of inexact numeric constants beyond
  what R6RS dictates.  doing this required a rework of $str->num, which
  turned into a fairly extensive rewrite that fixed up a few other minor
  issues (like r6rs:string->number improperly allowing 1/2e10) and
  eliminated the need for consumers to call $str->num twice in cases
  where it actually produces a number.  added some related new tests,
  including several found lacking by profiling.  added a couple of
  checks to number->string whose absence was causing argument errors to
  be reported by other routines.
    strnum.ss, exceptions.ss, read.ss
    5_3.ms, 6.ms, root-experr*, patch*
- added pdtml flag, which if set to t causes profile-dump-html to be
  called at the end of a mat run.
    mats/Mf-base

original commit: 03f2fe86171b0fd096238280b351ce365c701450
2016-05-01 16:05:40 -04:00
Kent Dybvig
6765641be0 - The scheme.h definition of Sfixnum(x) now uses multiply rather than
left shift to avoid counting on the behavior of << on negative numbers,
  which is undefined in C.
    mkheader.ss
- Fixed a couple of casts, one harmless and the other causing
  Sinteger64_value to return 0 for the most-negative I64 on 32-bit
  builds.
    number.c
- The configure-generated Makefile distclean target no longer removes
  zlib and nanopass, since they are logically part of the git clone.
  It does run make distclean in zlib.
    makefiles/Makefile.in

original commit: 42e6fed96d69fa17cfcd9cdcec101aaa36ba4512
2016-04-26 17:16:02 -04:00
dyb
1356af91b3 initial upload of open-source release
original commit: 47a210c15c63ba9677852269447bd2f2598b51fe
2016-04-26 10:04:54 -04:00