mit-scheme.git
27 years agoUse COMSPEC environment variable to determine shell file name if SHELL
Chris Hanson [Wed, 22 Oct 1997 05:10:03 +0000 (05:10 +0000)]
Use COMSPEC environment variable to determine shell file name if SHELL
is not defined.

27 years agoChange test used to decide whether an unreadable file exists. The
Chris Hanson [Wed, 22 Oct 1997 01:21:11 +0000 (01:21 +0000)]
Change test used to decide whether an unreadable file exists.  The
procedure FILE-EXISTS? gives the wrong answer when the file is a
symbolic link that points to a non-existent file.

27 years agoAdd code to synchronize the shutdown of the asyncronous timer thread
Chris Hanson [Sat, 18 Oct 1997 03:51:24 +0000 (03:51 +0000)]
Add code to synchronize the shutdown of the asyncronous timer thread
with the deallocation of the associated state.  Otherwise, the race
condition causes occasional GPFs when exiting Scheme.

27 years agoChanged consing code to compute the tagged pointer after storing the
Stephen Adams [Fri, 17 Oct 1997 20:24:18 +0000 (20:24 +0000)]
Changed consing code to compute the tagged pointer after storing the
elements.  This reduces register pressure across the consing sequence.
Rearranged consing expression to share a common algorithm, eliminating
80 lines of code.

27 years agoAdded some comments.
Stephen Adams [Fri, 17 Oct 1997 01:32:18 +0000 (01:32 +0000)]
Added some comments.

27 years agoChanged the instruction sequence for procedure return (and computed
Stephen Adams [Fri, 17 Oct 1997 01:25:41 +0000 (01:25 +0000)]
Changed the instruction sequence for procedure return (and computed
jump).  The code for clearing the type code from a continuation now
loads the value into a register instead of modifying it in-place on
the stack.

I have left the code using an indirect jump.  An alternative is to
push the value back on the stack and do a RET.  The indirect jump
seems faster, especially when returning to the same address as the
previous jump, but the branch prediction mechanisms for RET and JMP
seem quite different.

Speeds up the modified Gabriel Benchmark Suite (/scheme/8.0/src/bench)
by 10% overall!  I guess this is because the Pentium Pro really
doesn't like the old read-modify-write instruction.

Test       Old    New   Ratio
ctak      11.59  11.54  0.996
conform    0.62   0.50  0.806
traverse   1.57   0.92  0.586
takl       0.23   0.20  0.870
peval      0.40   0.35  0.875
browse     0.59   0.56  0.949
tak        0.28   0.25  0.893
wttree     1.61   1.49  0.925
deriv      0.34   0.29  0.853
boyer      0.47   0.42  0.894
div        0.42   0.39  0.929
dderiv     0.44   0.38  0.864
cpstak     0.42   0.41  0.976
matmul1    0.27   0.27  1.000
fib        0.68   0.55  0.809
fcomp      0.61   0.54  0.885
triangle   2.89   2.36  0.817
puzzle     0.47   0.47  1.000
matmul2    0.66   0.69  1.045
destruct   0.28   0.28  1.000
~a.mean       -      -  0.899
~g.mean       -      -  0.892

27 years agoMoved open-coding of VECTOR?, %RECORD? and CHAR? from SF to
Stephen Adams [Wed, 15 Oct 1997 03:25:55 +0000 (03:25 +0000)]
Moved open-coding of VECTOR?, %RECORD? and CHAR? from SF to
open-coders in compiler.

27 years agoFix typo.
Stephen Adams [Wed, 15 Oct 1997 01:22:00 +0000 (01:22 +0000)]
Fix typo.

27 years agoAdded primitive CHAR?
Stephen Adams [Wed, 15 Oct 1997 01:17:07 +0000 (01:17 +0000)]
Added primitive CHAR?

27 years agoAdded primitives VECTOR? and %RECORD?
Stephen Adams [Wed, 15 Oct 1997 00:52:15 +0000 (00:52 +0000)]
Added primitives VECTOR? and %RECORD?

27 years agoAdded open-coding for MAKE-CELL.
Stephen Adams [Tue, 14 Oct 1997 14:20:05 +0000 (14:20 +0000)]
Added open-coding for MAKE-CELL.

27 years agoImproved disassembly output:
Stephen Adams [Fri, 10 Oct 1997 21:06:19 +0000 (21:06 +0000)]
Improved disassembly output:

 - New comments to the right of LAP code, mostly the address of @pco
   branches so you can see where it is jumping.

 - correctly decodes the word field after a

(call (entry short-primitive-apply))

   rather than trying to disassemble the offset as instructions and
   getting out of sync with the subsequent instructions.

27 years agoUse `cp -p' to preserve file times.
Stephen Adams [Tue, 7 Oct 1997 19:35:48 +0000 (19:35 +0000)]
Use `cp -p' to preserve file times.

27 years agouse `cp -p' to preserve file times.
Stephen Adams [Tue, 7 Oct 1997 19:34:24 +0000 (19:34 +0000)]
use `cp -p' to preserve file times.

27 years agoUse `cp -p' to preserve file times.
Stephen Adams [Tue, 7 Oct 1997 19:33:49 +0000 (19:33 +0000)]
Use `cp -p' to preserve file times.

27 years agoTypo in previous change.
Stephen Adams [Tue, 7 Oct 1997 19:29:13 +0000 (19:29 +0000)]
Typo in previous change.

27 years agoFixed so that "1/pivot" is rejected as a number, rather than dividing
Stephen Adams [Tue, 7 Oct 1997 04:19:46 +0000 (04:19 +0000)]
Fixed so that "1/pivot" is rejected as a number, rather than dividing
by zero.  Change: divide only if there is at least one denominator
digit.

This is not a good fix, but I need it now for some existing code.  The
parser ought to be restructured not to compute the real part until it
is known that the imaginary part is valid, e.g.

(string->number "1/2+3")  => #F
(string->number "1/0+3")  => error
(string->number "1/0-transition")  => error

There is a similar problem with exponent calculation:

(string->number "1e9999e1")  => error
(string->number "1e99999999e1")  => `hangs' in bignum primitives

Of course, the difficulty with these non-numbers is probably the
reason behind R4RS's restriction on valid identifiers.  That is pretty
feeble, since I don't recall R4RS saying that STRING->NUMBER is
allowed to signal an error.  Note that the current code would work
fine in a lazy language, so a few DELAYs and FORCEs might be the most
elegant fix (and OK effciency since FORCE is now compiled.)

27 years agoChanged compuation of pc_in_C: with dynamically loaded libraries,
Stephen Adams [Sun, 5 Oct 1997 05:44:37 +0000 (05:44 +0000)]
Changed compuation of pc_in_C: with dynamically loaded libraries,
there is no guarantee that valid C addressed are bounded above by
_etext.

27 years agoThinko in replacements for INTEGER-NEGATIVE? and INTEGER-POSITIVE?
Stephen Adams [Fri, 3 Oct 1997 13:43:41 +0000 (13:43 +0000)]
Thinko in replacements for INTEGER-NEGATIVE? and INTEGER-POSITIVE?
(was doing fixnum replacement for known-to-be exact integer arguments
rather than known-to-be fixnum arguments.

27 years agoFix typo.
Chris Hanson [Fri, 3 Oct 1997 07:26:54 +0000 (07:26 +0000)]
Fix typo.

27 years agoFix typo in previous change.
Chris Hanson [Fri, 3 Oct 1997 06:00:26 +0000 (06:00 +0000)]
Fix typo in previous change.

27 years agoFix typo in instructions.
Stephen Adams [Thu, 2 Oct 1997 20:10:10 +0000 (20:10 +0000)]
Fix typo in instructions.

27 years agoAdded -export-dynamic to the LD switches so that SWAT (and other
Stephen Adams [Thu, 2 Oct 1997 19:52:53 +0000 (19:52 +0000)]
Added -export-dynamic to the LD switches so that SWAT (and other
dynamic libraries) can load.

27 years agoChanged %STRING-APPEND to (APPLY STRING-APPEND ...) because someone
Stephen Adams [Thu, 2 Oct 1997 19:19:44 +0000 (19:19 +0000)]
Changed %STRING-APPEND to (APPLY STRING-APPEND ...) because someone
removed %STRING-APPEND from the system.

27 years agoFixed copyright date and Package: comment.
Stephen Adams [Thu, 2 Oct 1997 19:16:40 +0000 (19:16 +0000)]
Fixed copyright date and Package: comment.

27 years agoChange M-A to work better with parameter lists containing uninterned
Chris Hanson [Thu, 2 Oct 1997 04:49:58 +0000 (04:49 +0000)]
Change M-A to work better with parameter lists containing uninterned
symbols.

27 years agoTweak output for RTL and LAP files to include the pretty-printed
Stephen Adams [Thu, 2 Oct 1997 00:11:42 +0000 (00:11 +0000)]
Tweak output for RTL and LAP files to include the pretty-printed
SCode.  In LAP files, make RTL comments more terse by printing them
with ";;" rather than "(comment (rtl"

27 years agoFix bug: marked messages that had been deleted from the server were
Chris Hanson [Tue, 30 Sep 1997 02:21:32 +0000 (02:21 +0000)]
Fix bug: marked messages that had been deleted from the server were
remaining marked after downloading of message bodies.

27 years agoThe following change in how WIN32 graphics devices are flushed gives
Stephen Adams [Fri, 26 Sep 1997 19:53:02 +0000 (19:53 +0000)]
The following change in how WIN32 graphics devices are flushed gives
non-flickering update almost like double-buffering for programs which
have to draw multiple frames from scratch.

If graphics buffering is enabled, then a GRAPHICS-FLUSH operation
comes from the user's program.  The change is to synchronously redraw
the screen in this (i.e. buffered+flush) case.  Subsequent operations
can clear and draw without an asynchronous redraw operation copying
the subsequent partial image to the screen.

This is not quite double-buffering since forced redisplay during the
buffered drawing (for example, uncovering part of the window) will
cause the partly draw backing bitmap to be copied to the screen.

User programs with buffering and frequent explicit flushes are likely
to be slower.

27 years agoAdded hlsim documentation.
Stephen Adams [Tue, 26 Aug 1997 15:20:29 +0000 (15:20 +0000)]
Added hlsim documentation.

27 years agoFix bug: low-level file reading code was occasionally signalling
Chris Hanson [Sun, 24 Aug 1997 04:05:55 +0000 (04:05 +0000)]
Fix bug: low-level file reading code was occasionally signalling
errors for no apparent reason.  The cause: the ReadFile API can return
an error indication when it is called at end-of-file.  However, in
ONLY this case, the returned "bytesRead" value is zero.

27 years agoTrim any trailing end-of-line from system-call error strings.
Chris Hanson [Sun, 24 Aug 1997 04:03:53 +0000 (04:03 +0000)]
Trim any trailing end-of-line from system-call error strings.

27 years agoClip ranges immediately after a group is constructed, in order to
Chris Hanson [Sat, 23 Aug 1997 06:30:37 +0000 (06:30 +0000)]
Clip ranges immediately after a group is constructed, in order to
eliminate old markings.

27 years agoWork around problem in NT: prompting for a directory with a wildcard
Chris Hanson [Sat, 23 Aug 1997 05:20:15 +0000 (05:20 +0000)]
Work around problem in NT: prompting for a directory with a wildcard
was causing an error.  On unix, this works because FILE-DIRECTORY?
accepts such specifications as arguments -- but on NT, it doesn't.

27 years agoInitial revision
Chris Hanson [Sat, 23 Aug 1997 02:52:23 +0000 (02:52 +0000)]
Initial revision

27 years agoEliminate several calls to the C library in favor of native Win32 API
Chris Hanson [Sat, 23 Aug 1997 02:52:10 +0000 (02:52 +0000)]
Eliminate several calls to the C library in favor of native Win32 API
calls.  This was started to work around a bug in the Watcom C library,
but is generally desirable to eliminate unnecessary dependencies on
the C library.

The bug that started this is that FILE-DIRECTORY? returned #F on
directories with the FILE_ATTRIBUTE_ARCHIVE bit set.

27 years agoAdd new file "ntfs.h".
Chris Hanson [Sat, 23 Aug 1997 02:48:18 +0000 (02:48 +0000)]
Add new file "ntfs.h".

27 years agoEliminate conditionalization on OS_open_append_file; this procedure
Chris Hanson [Fri, 22 Aug 1997 16:33:14 +0000 (16:33 +0000)]
Eliminate conditionalization on OS_open_append_file; this procedure
compiles and runs just fine and probably should not have been
conditionalized in the first place.

27 years agoAdjusted indentation to be consistent with 7.4 version.
Stephen Adams [Tue, 12 Aug 1997 19:37:32 +0000 (19:37 +0000)]
Adjusted indentation to be consistent with 7.4 version.

27 years agoAdd switch to disable canonicalization of symbol case by reader.
Chris Hanson [Fri, 8 Aug 1997 21:29:38 +0000 (21:29 +0000)]
Add switch to disable canonicalization of symbol case by reader.

27 years agoFix bug in Scheme mode C-c C-s that could cause already-deleted
Chris Hanson [Sun, 3 Aug 1997 06:44:39 +0000 (06:44 +0000)]
Fix bug in Scheme mode C-c C-s that could cause already-deleted
buffers to be selected.  I don't understand why these buffers are
still in this list because there is code to remove them.

27 years agoDon't lose if directories in info-directory-list are lacking the
Chris Hanson [Sat, 2 Aug 1997 06:49:05 +0000 (06:49 +0000)]
Don't lose if directories in info-directory-list are lacking the
trailing slash.

27 years agoFix bug in last change - apply STRING->SYMBOL to the string, not the
Stephen Adams [Thu, 31 Jul 1997 18:33:07 +0000 (18:33 +0000)]
Fix bug in last change - apply STRING->SYMBOL to the string, not the
`constant' expression containing the string.

27 years ago7.4: Fixed STRING->SYMBOL expansion to test that it's argument is a
Stephen Adams [Thu, 31 Jul 1997 10:40:38 +0000 (10:40 +0000)]
7.4: Fixed STRING->SYMBOL expansion to test that it's argument is a
constant whose value is a string rather than applying STRING?
directly (which has been broken since it was added in 1992.)  Fixed
INTERN likewise.

8.0: treat INTERN similarly to STRING->SYMBOL: Add INTERN as a
integrated to a global reference.  Added type rule and constant
folding rule for intern. (This is better than constant folding at
integration time since it deals with constant propagation.)

27 years agoThe previous change to make the output with '(ABSOLUTE <N> ...)
Stephen Adams [Mon, 28 Jul 1997 18:19:05 +0000 (18:19 +0000)]
The previous change to make the output with '(ABSOLUTE <N> ...)
produce the correct number of digits for numbers with no significant
digits introduced problems with NORMAL rounded and ENGINEERING
formatted output.  All NORMAL rounded output for numbers of the form
ddd.ff were being output as "000.".  Some numbers formatted with
'(ABSOLUTE <N> ENGINEERING) looked like "000e-3".

This has been fixed by

  (1) setting the cutoff for NORMAL rounded numbers to be a value that
      will allow the digit production to run to completion
      (flo:significand-digits - 2).

  (2) adding special cases in the output procedures to deal with empty
      digit strings.

Currently:

Zero still prints as "0." by the initial sign/infinity/NaN dispatch.

Rounded output in NORMAL style for numbers with no significant digits
prints as "0." or "-0.".

Rounded output in SCIENTIFIC / ENGINEERING style for numbers with no
significant digits prints as "0eE" or "-0eE", e.g. "-0e3".

It might be preferable to keep "0." distinguished for zero, but I'm
not sure how for NORMAL formatted output.  (To my eyes, "0.0" looks
more `zero' than "0.", and ".0" implies a small magnitude.)

A small regression test has been appended in a comment to help avoid
problems in future.  Feel free to add tests.

27 years agoProvide the ability for a user to specify how the digits generated by
Chris Hanson [Sat, 26 Jul 1997 07:40:41 +0000 (07:40 +0000)]
Provide the ability for a user to specify how the digits generated by
the flonum printer are converted into a string.

27 years agoFix another bug in the Dragon4 code (the bug exists in the original
Chris Hanson [Sat, 26 Jul 1997 07:14:37 +0000 (07:14 +0000)]
Fix another bug in the Dragon4 code (the bug exists in the original
paper).  The bug caused the following behavior:

    (fluid-let ((flonum-unparser-cutoff '(absolute 2 normal)))
      (number->string 0.005))
    ;Value 3: ".01"

    (fluid-let ((flonum-unparser-cutoff '(absolute 2 normal)))
      (number->string 0.00499))
    ;Value 4: ".005"

The problem is that in the second case the trailing digit "5" should
not be generated.  The fix works by preventing any digits being output
by the digit-generation loop when the first digit to be output would
be to the right of the cutoff point.

27 years agoReimplement encrypt-file and decrypt-file to eliminate the temporary
Chris Hanson [Fri, 25 Jul 1997 07:07:24 +0000 (07:07 +0000)]
Reimplement encrypt-file and decrypt-file to eliminate the temporary
storage of the plaintext in a buffer; this is both a security risk and
an unnecessary limitation on the size of the file.  Also, modify the
commands to provide more flexible handling of filenames.  Previously,
only the input file could be specified; now both the input and the
output can be specified, and the output is defaulted to a useful
value.

27 years agoFix bug in AFTER-FIND-FILE: code was assuming that every buffer had an
Chris Hanson [Mon, 21 Jul 1997 04:38:48 +0000 (04:38 +0000)]
Fix bug in AFTER-FIND-FILE: code was assuming that every buffer had an
AUTO-SAVE-PATHNAME.

Add new commands to encrypt and decrypt files using blowfish.

27 years agoAdd optional argument to KEYBOARD-READ which, if true, says that the
Chris Hanson [Mon, 21 Jul 1997 04:37:33 +0000 (04:37 +0000)]
Add optional argument to KEYBOARD-READ which, if true, says that the
key being read should not be recorded in the keyboard history.  This
option is used to prevent passwords from being stored in the history.

27 years agoFix bug: VC was causing a local binding of vc-mode-line-status to
Chris Hanson [Mon, 21 Jul 1997 04:36:12 +0000 (04:36 +0000)]
Fix bug: VC was causing a local binding of vc-mode-line-status to
appear in every buffer, when it should only be bound in buffers under
version control.

27 years agoFix bug: auto-save initialization was not looking for a local binding
Chris Hanson [Mon, 21 Jul 1997 04:34:58 +0000 (04:34 +0000)]
Fix bug: auto-save initialization was not looking for a local binding
of the variable auto-save-default.

27 years agoDon't use alternate pathnames when writing files; only when reading.
Chris Hanson [Mon, 21 Jul 1997 04:33:28 +0000 (04:33 +0000)]
Don't use alternate pathnames when writing files; only when reading.

27 years agoFix bug: end index in substring is exclusive, not inclusive.
Chris Hanson [Sun, 20 Jul 1997 06:38:55 +0000 (06:38 +0000)]
Fix bug: end index in substring is exclusive, not inclusive.
Repaginate.

27 years agoChanged error for non-root access to a warning, so at least we can get
Stephen Adams [Fri, 18 Jul 1997 04:03:01 +0000 (04:03 +0000)]
Changed error for non-root access to a warning, so at least we can get
a .crf file output.

27 years agoChanged FIXNUM->FLONUM back to using cast.
Stephen Adams [Fri, 18 Jul 1997 03:35:53 +0000 (03:35 +0000)]
Changed FIXNUM->FLONUM back to using cast.

I don't understand why the last change was made -- the cast should
have worked, since arg_fixnum() returns a long.  Perhaps I blew it and
tested it on 8.0 and just happen to have fixed the real problem at
about the same time.

27 years agoConditionalize fixnum dependency for allow single file for 7.4 and 8.0
Stephen Adams [Wed, 16 Jul 1997 02:51:07 +0000 (02:51 +0000)]
Conditionalize fixnum dependency for allow single file for 7.4 and 8.0

27 years agoChanged TC_TRUE to TC_CONSTANT
Stephen Adams [Wed, 16 Jul 1997 02:40:39 +0000 (02:40 +0000)]
Changed TC_TRUE to TC_CONSTANT

27 years agoChanged TC_TRUE to TC_CONSTANT in comment
Stephen Adams [Wed, 16 Jul 1997 02:40:13 +0000 (02:40 +0000)]
Changed TC_TRUE to TC_CONSTANT in comment

27 years agoChanged TC_TRUE to TC_CONSTANT.
Stephen Adams [Wed, 16 Jul 1997 02:38:57 +0000 (02:38 +0000)]
Changed TC_TRUE to TC_CONSTANT.

27 years agoConditionalized EMPTY_LIST_VALUE code.
Stephen Adams [Wed, 16 Jul 1997 02:37:41 +0000 (02:37 +0000)]
Conditionalized EMPTY_LIST_VALUE code.

27 years agoA hack: Introduced macro
Stephen Adams [Wed, 16 Jul 1997 02:36:59 +0000 (02:36 +0000)]
A hack: Introduced macro

case_TC_FIXNUMs

for generating case labels for selecting fixnums, whether there are
one or two typecodes.  This tidies up the support in the 8.0 sources
for eitehr case, and allows more files to be shared between 7.4 and
8.0

27 years agoConditionalized EMPTY_LIST initialization for code sharing between 7.4 and 8.0.
Stephen Adams [Wed, 16 Jul 1997 01:46:32 +0000 (01:46 +0000)]
Conditionalized EMPTY_LIST initialization for code sharing between 7.4 and 8.0.

27 years agoMoved GLOBAL_ENV to sdata.h.
Stephen Adams [Tue, 15 Jul 1997 23:26:32 +0000 (23:26 +0000)]
Moved GLOBAL_ENV to sdata.h.

27 years agoMerged in changes to make 7.4 and 8.0 more alike.
Stephen Adams [Tue, 15 Jul 1997 22:54:57 +0000 (22:54 +0000)]
Merged in changes to make 7.4 and 8.0 more alike.

27 years agoFixed the trap debugging primitive
Stephen Adams [Tue, 15 Jul 1997 22:31:53 +0000 (22:31 +0000)]
Fixed the trap debugging primitive
INSTRUCTION-ADDRESS->COMPILED-CODE-BLOCK to handle integer arguments
correctly.

27 years agoAdd ADDRESS_HEAP_P to match existing predicate ADDRESS_CONSTANT_P
Stephen Adams [Tue, 15 Jul 1997 22:06:24 +0000 (22:06 +0000)]
Add ADDRESS_HEAP_P to match existing predicate ADDRESS_CONSTANT_P

27 years agofile: purify.c
Stephen Adams [Tue, 15 Jul 1997 21:34:36 +0000 (21:34 +0000)]
file: purify.c
file: bchmmg.c
file: memmag.c

Define EMPTY_WEAK_CHAIN for use in terminating the weak chain rather
that EMPTY_LIST.

This allows purify.c, bchmmg.c and memmag.c to be shared by 7.4 and 8.0.

27 years agoEliminate NT compiler warning.
Stephen Adams [Tue, 15 Jul 1997 20:57:06 +0000 (20:57 +0000)]
Eliminate NT compiler warning.

27 years agoDisregard working directory when file is loaded; use directory that
Stephen Adams [Tue, 15 Jul 1997 18:32:04 +0000 (18:32 +0000)]
Disregard working directory when file is loaded; use directory that
file is loaded from instead.

27 years agoUpdate copyright date.
Stephen Adams [Tue, 15 Jul 1997 18:22:21 +0000 (18:22 +0000)]
Update copyright date.

27 years agoSmall changes to allow butils.scm to be shared between 7.4 and 8.0
Stephen Adams [Tue, 15 Jul 1997 17:54:48 +0000 (17:54 +0000)]
Small changes to allow butils.scm to be shared between 7.4 and 8.0

27 years agoMerge 7.4 and 8.0 versions on scomb.scm
Stephen Adams [Tue, 15 Jul 1997 17:29:56 +0000 (17:29 +0000)]
Merge 7.4 and 8.0 versions on scomb.scm

Changed UNDEFINED-CONDITIONAL-BRANCH to be UNSPECIFIC directly, rather
than trying to reconstruct the same machine-dependent bit-pattern.

27 years agoChange to get rid of minor difference between 7.4 and 8.0 versions of
Stephen Adams [Tue, 15 Jul 1997 16:33:38 +0000 (16:33 +0000)]
Change to get rid of minor difference between 7.4 and 8.0 versions of
unpars.scm:

Renamed
  COMPILED-ENTRY/FILENAME -> COMPILED-ENTRY/FILENAME-AND-INDEX
  COMPILED-CODE-BLOCK/FILENAME -> COMPILED-CODE-BLOCK/FILENAME-AND-INDEX

27 years agoMerged 7.4 and 8.0 udata.scm files.
Stephen Adams [Tue, 15 Jul 1997 16:05:24 +0000 (16:05 +0000)]
Merged 7.4 and 8.0 udata.scm files.
(Main benefit is the much faster compiled version of FORCE).

Removed FORCE from integrated primitives.

Added COMPILED-CODE-BLOCK/MARKED-START which returns the index that
COMPILED-CODE-BLOCK/CONSTANTS-START used to.
COMPILED-CODE-BLOCK/CONSTANTS-START now parses over the linkage
section.

Changed i386 disassembler to use COMPILED-CODE-BLOCK/MARKED-START.

27 years agoMerged the 7.4 and 8.0 versions of string.scm now that INDEX-FIXNUM?
Stephen Adams [Tue, 15 Jul 1997 05:16:25 +0000 (05:16 +0000)]
Merged the 7.4 and 8.0 versions of string.scm now that INDEX-FIXNUM?
is open-coded by both compilers.  Moved string.scm into a new package
(runtime string).

27 years agoUse FIXNUM_TO_DOUBLE rather than a cast. Casting a fixnum to a double
Stephen Adams [Tue, 15 Jul 1997 05:09:17 +0000 (05:09 +0000)]
Use FIXNUM_TO_DOUBLE rather than a cast.  Casting a fixnum to a double
fortuitously worked under 8.0 with `native' fixnum tags but didn't
work under 7.4.

27 years agoAdded open-coding for the primitive INDEX-FIXNUM?
Stephen Adams [Tue, 15 Jul 1997 03:01:26 +0000 (03:01 +0000)]
Added open-coding for the primitive INDEX-FIXNUM?

27 years agoAdded INDEX-FIXNUM? as integrated constant.
Stephen Adams [Tue, 15 Jul 1997 00:49:27 +0000 (00:49 +0000)]
Added INDEX-FIXNUM? as integrated constant.

27 years agoMade previos chaneg work under 7.4 and 8.0
Stephen Adams [Mon, 14 Jul 1997 19:38:35 +0000 (19:38 +0000)]
Made previos chaneg work under 7.4 and 8.0

27 years agoUse EMPTY_WEAK_CHAIN for weak pair chain instead of EMPTY_LIST.
Stephen Adams [Mon, 14 Jul 1997 17:59:57 +0000 (17:59 +0000)]
Use EMPTY_WEAK_CHAIN for weak pair chain instead of EMPTY_LIST.

27 years agoInitialize number parser.
Chris Hanson [Sun, 13 Jul 1997 07:24:46 +0000 (07:24 +0000)]
Initialize number parser.

27 years ago8.0 debugging changes.
Stephen Adams [Sat, 12 Jul 1997 04:23:26 +0000 (04:23 +0000)]
8.0 debugging changes.

Added a procedure COMPILED-CODE-BLOCK/NAME to guess the name of the
procedure in the compiled code block.  If the dbg info has only one
top-level procedure then use the name of that procedure, otherwise
return false.  Requires LOAD-DEBUGGING-INFO-ON-DEMAND? to be true to
load the dbg info.

Fixed HARDWARE-TRAP-FRAME/DESCRIBE to use the new 8.0 debugging
information - it was an oversight that it was still trying to use the
old debugging locator to identify the file name for the compiled code
block.  Also use COMPILED-CODE-BLOCK/NAME to identify the procedure.

Together, these changes mean that (with LOAD-DEBUGGING-INFO-ON-DEMAND?
true), SIGSEGVs and SIGFPEs can usually identify the offending
procedure by name.

27 years agoChanged INT:->INEXACT to use INTEGER->FLONUM and FIXNUM->FLONUM, now
Stephen Adams [Fri, 11 Jul 1997 03:24:10 +0000 (03:24 +0000)]
Changed INT:->INEXACT to use INTEGER->FLONUM and FIXNUM->FLONUM, now
that INTEGER->FLONUM has been fixed to work correctly.  Note that the
8.0 compiler can open-code FIXNUM->FLONUM.

27 years agoFIXNUM->FLONUM is open-coded, but only if argument is a known fixnum.
Stephen Adams [Fri, 11 Jul 1997 02:35:04 +0000 (02:35 +0000)]
FIXNUM->FLONUM is open-coded, but only if argument is a known fixnum.

27 years agoBug fixes:
Stephen Adams [Thu, 10 Jul 1997 09:25:06 +0000 (09:25 +0000)]
Bug fixes:

  . "1/"  returns #F instead of signalling divide by zero.

  . "1.2345e-306" and "1e-400" with FLONUM-PARSER-FAST? true no longer
     signal arithmetic errors.

  . STRING->NUMBER and SUBSTRING->NUMBER now check their arguments

Other changes: FINISH-REAL now exploits the fact that some integers
have exact floating point representations and so flonum arithmetic can
be used to compute the correct result.  Note that to maintain
correctness, i*10^-e must be calculated as i/10^e.  The results are a
modest improvement on free-formatted random flonums (typically 16
digit) in the range 1e-7 to 1e35:

Times for 10000 flonums generated by (random range)

range 1e-100 1e-10 1e-5 1. 1e5 1e10 1e35 1e40
old 10180 8200 8210 7490 5610 3970 3990 4030
new 10280 8350 4690 4390 3930 3230 3180 4170

With FLONUM-PARSER-FAST? true, using the division trick gives better
error rates over a larger range.  Number of errors in 10000 random
flonums

range 1e-20 1e-10 1e-6 1. 1e10 1e20 1e35 1e40
old 3573 2400 3309 2798 3025  685  722 2730
new 2594 2778 1907 1010  761  685  772 2730

27 years agoBug fixes:
Stephen Adams [Thu, 10 Jul 1997 09:16:23 +0000 (09:16 +0000)]
Bug fixes:

  . "1/"  returns #F instead of signalling divide by zero.

  . "1.2345e-306" and "1e-400" with FLONUM-PARSER-FAST? true no longer
     signal arithmetic errors.

  . STRING->NUMBER and SUBSTRING->NUMBER now check their arguments

Other changes: FINISH-REAL now exploits the fact that some integers
have exact floating point representations and so flonum arithmetic can
be used to compute the correct result.  Note that to maintain
correctness, i*10^-e must be calculated as i/10^e.  The results are a
modest improvement on free-formatted random flonums (typically 16
digit) in the range 1e-7 to 1e35:

Times for 10000 flonums generated by (random range)

range 1e-100 1e-10 1e-5 1. 1e5 1e10 1e35 1e40
old 10180 8200 8210 7490 5610 3970 3990 4030
new 10280 8350 4690 4390 3930 3230 3180 4170

With FLONUM-PARSER-FAST? true, using the division trick gives better
error rates over a larger range.  Number of errors in 10000 random
flonums

range 1e-20 1e-10 1e-6 1. 1e10 1e20 1e35 1e40
old 3573 2400 3309 2798 3025  685  722 2730
new 2594 2778 1907 1010  761  685  772 2730

27 years agoFix a couple of typos.
Chris Hanson [Thu, 10 Jul 1997 06:35:34 +0000 (06:35 +0000)]
Fix a couple of typos.

27 years agoAdded missing open-coders for:
Stephen Adams [Wed, 9 Jul 1997 15:12:44 +0000 (15:12 +0000)]
Added missing open-coders for:

SYSTEM-PAIR-SET-CAR! SYSTEM-PAIR-SET-CDR!
SYSTEM-HUNK3-SET-CXR0! SYSTEM-HUNK3-SET-CXR1! SYSTEM-HUNK3-SET-CXR2!

27 years agoImplemented FORCE as a compiled procedure. SF no longer integrates
Stephen Adams [Wed, 9 Jul 1997 14:40:07 +0000 (14:40 +0000)]
Implemented FORCE as a compiled procedure.  SF no longer integrates
FORCE as a primitive procedure.

There is a minor bootstrapping problem with the standard build
scripts since any pre-existing version of SF will integrate the
primitive FORCE, and SF is only run on files that have changed.
A solution is:

    1. rebuild the system
    2. remove any .bin files that call FORCE
    3. rebuild the system using bands produced in step 1.

Timings under Scheme 8.0 on plex:

Test Primitive Compiled
 [1]  10370ms   560ms
 [2]    180ms   130ms
 [3]       440ms   270ms

(let ((nums (list->stream (make-initialized-list 100001 identity-procedure)))
      (primes
       ((access make-prime-numbers-stream (->environment '(runtime stream))))))
  (show-time (lambda () (stream-ref nums 100000)))    ; [1]
  (show-time (lambda () (stream-ref nums 100000)))    ; [2]
  (show-time (lambda () (stream-ref primes 1000))))   ; [3]

27 years agoAdded rules for rewriting (INTEGER->FLONUM N <flags>) to (FIXNUM->FLONUM N).
Stephen Adams [Wed, 9 Jul 1997 06:44:01 +0000 (06:44 +0000)]
Added rules for rewriting (INTEGER->FLONUM N <flags>) to (FIXNUM->FLONUM N).

27 years agoImproved range of analysis for REMAINDER & INTEGER-REMAINDER.
Stephen Adams [Wed, 9 Jul 1997 02:25:53 +0000 (02:25 +0000)]
Improved range of analysis for REMAINDER & INTEGER-REMAINDER.
INT:comparisons reduce to FIX: version for suitable arguments.
INTEGER-ZERO? reduced to EQ? for exact integer arguments.

27 years agoChanged bignum_to_double to produce a correctly rounded result. The
Stephen Adams [Tue, 8 Jul 1997 19:12:51 +0000 (19:12 +0000)]
Changed bignum_to_double to produce a correctly rounded result.  The
code is a lot hairier since it implements IEEE style round to even,
but it is not much slower than the old `accumulate' loop since it
rarely has to look at more that two or three words.

The new version no longer signals an floating point overflow error on

(INTEGER->FLONUM (- (EXPT 2 1024) 1) #b10)

This means that (INTEGER->FLONUM N #b10) can again be used for computing
EXACT->INEXACT on exact integers, which should be 5-15x faster.

There were several places which has a loop to find the bit position of
the most significant bit in a word.  This code has been converted into
a macro, and tweaked to be a bit faster.  Presumably some machines
have this operation as an instruction.

27 years agoChange integer_length_in_bits to return a fixnum if possible.
Stephen Adams [Tue, 8 Jul 1997 06:25:59 +0000 (06:25 +0000)]
Change integer_length_in_bits to return a fixnum if possible.

27 years agoSpeed up RATIO->FLONUM and INT:->INEXACT by using (INTEGER->FLONUM N
Stephen Adams [Tue, 8 Jul 1997 06:04:02 +0000 (06:04 +0000)]
Speed up RATIO->FLONUM and INT:->INEXACT by using (INTEGER->FLONUM N
#b11) when N is small enough that it has an `exact' flonum
representation.  A prior log message comments on this, but the code
does not seem to take advantage.

DISCUSSION:

Question:  why is (INT:->INEXACT N) not simply (INTEGER->FLONUM N #b10) ?

(EXACT->INEXACT (expt 2 3000)) used to fail in INTEGER->FLONUM,
but now it returns MAXDOUBLE (due to ldexp), but an Infinity or an error
would seem better.

R4RS says: If an exact argument has no reasonably close inexact
equivalent, the a violation of an implementation restriction may be
reported.

I would read this as NOT returning MAXDOUBLE as, say, 2^3000 is not
`reasonably close' to any FP number.

A previous log entry says INTEGER->FLONUM does not round reliably.
This is because bignum_to_double in "bignum.c" accumulates, which may
cause error due to intermediate rounding.

Perhaps bignum_to_double should be changed to extract the top 53 bits
and explicitly calculate the exponent; another test would be required
in place of bignum_fits_in_word_p, which does not (and should not)
understand rounding carry.  Currently, calling bignum_to_double on

(- (expt 2 1024) 1)

signals a floating point overflow or returns an infinity depending on
which FPU exceptions are enabled.

If bignum_to_double was fixed it could be a lot faster than all the
current bignum arithmetic.

27 years agoFixed thinko in FIXNUM->FLONUM.
Stephen Adams [Tue, 8 Jul 1997 03:07:06 +0000 (03:07 +0000)]
Fixed thinko in FIXNUM->FLONUM.

27 years agoChanges in INT:->STRING to improve performance. 30% faster for huge
Stephen Adams [Tue, 8 Jul 1997 01:22:28 +0000 (01:22 +0000)]
Changes in INT:->STRING to improve performance.  30% faster for huge
bignums (10^1000), up to 2x-3x faster for small bignums (up to
10^100), slightly faster for fixnums.

 . Use a local version of DIGIT->CHAR since we don't need to check the
   radix.

 . PRINT-FIXNUM modified to be useful for generating digits in the
   middle of a number.

 . PRINT-MEDIUM and PRINT-LARGE work in units of several digits, the
   length of a unit pre-computed so that a unit can be printed using
   fixnum arithmetic.

 . PRINT-MEDIUM chops off groups of digits that can be printed by
   PRINT-FIXNUM.  The microcode primitive LISTIFY-BIGNUM is no longer
   used.

 . PRINT-LARGE has a special check to try to avoid the last multiply
   in building the power stack (which is asymptotically 2/3 of the
   cost of building the stack).  The recursion termination check is
   generalized to also catch sequences of digits with enough leading
   zeroes to be formatted by PRINT-FIXNUM (this can double the speed
   of printing numbers with many zeros).

27 years agoRename "c+e" to "all".
Chris Hanson [Mon, 7 Jul 1997 23:27:44 +0000 (23:27 +0000)]
Rename "c+e" to "all".

27 years agoChanges in INT:->STRING to improve performance. 30% faster for huge
Stephen Adams [Mon, 7 Jul 1997 20:24:45 +0000 (20:24 +0000)]
Changes in INT:->STRING to improve performance.  30% faster for huge
bignums (10^1000), up to 2x-3x faster for small bignums (up to
10^100), slightly faster for fixnums.

 . Use a local version of DIGIT->CHAR since we don't need to check the
   radix.

 . PRINT-FIXNUM modified to be useful for generating digits in the
   middle of a number.

 . PRINT-MEDIUM and PRINT-LARGE work in units of several digits, the
   length of a unit pre-computed so that a unit can be printed using
   fixnum arithmetic.

 . PRINT-MEDIUM chops off groups of digits that can be printed by
   PRINT-FIXNUM.  The microcode primitive LISTIFY-BIGNUM is no longer
   used.

 . PRINT-LARGE has a special check to try to avoid the last multiply
   in building the power stack (which is asymptotically 2/3 of the
   cost of building the stack).  The recursion termination check is
   generalized to also catch sequences of digits with enough leading
   zeroes to be formatted by PRINT-FIXNUM (this can double the speed
   of printing numbers with many zeros).

27 years agoIn bignum_remainder, replaced special case for remainder by `1' with a
Stephen Adams [Fri, 4 Jul 1997 16:02:18 +0000 (16:02 +0000)]
In bignum_remainder, replaced special case for remainder by `1' with a
special case for remainder by small power of two.