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).
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.
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.
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.
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
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
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.
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.
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.
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.
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).
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).
Stephen Adams [Thu, 3 Jul 1997 21:55:23 +0000 (21:55 +0000)]
Performance enhancements:
1. Changed DRAGON4-FIXUP to use fast scaling similar to described in
Burger and Dybvig (reference in file). This makes an order of
magnitude difference for unparsing flonums with large exponents.
2. Changed DRAGON4 to pass exponent to DRAGON4-FIXUP for scaling
estimate.
3. Systematically replaced calls to generic operators with calls to
int: variants (and rat:expt). The vast majority of operations are
on bignums. Gives a gain of about 20%.
Timings (Non-GC runtime) in msec for 1000 calls on 200Mhz Pentium Pro.
Chris Hanson [Thu, 26 Jun 1997 07:05:11 +0000 (07:05 +0000)]
Don't use the external Scheme DLL any more. This is important for the
moment as I have not yet figured out how to make working DLLs with the
new Watcom compiler. However, the Scheme DLL probably doesn't matter
any more as we no longer care about Windows 3.1.
Chris Hanson [Wed, 25 Jun 1997 07:26:48 +0000 (07:26 +0000)]
Change RCS-FIND-DELTA to have an extra argument saying whether or not
to signal an error if there is no such delta. Use this feature to
make VC-NEXT-ACTION do the right thing when it is given a version
number that doesn't exist.
Chris Hanson [Wed, 25 Jun 1997 06:18:30 +0000 (06:18 +0000)]
Allow computed methods to return concrete methods as well as
procedures, provided that the returned method's specializers are
restrictions of the computed method's specializers.
Chris Hanson [Wed, 25 Jun 1997 05:31:31 +0000 (05:31 +0000)]
Delete accessor slot properties after they are used. This prevents
them from holding on to the generic procedures, and from defining
identical methods for each subclass.
Chris Hanson [Thu, 19 Jun 1997 05:17:14 +0000 (05:17 +0000)]
When trying to get information about a file, if we get permission
denied, try again using the directory reader. Some files, e.g.
"\pagefile.sys", cannot be interrogated in the normal fashion, but are
given in a directory listing. (More quality software design.)
In SET-FILE-TIMES!, temporarily disable the read-only bit if it is
enabled, as this prevents the primitive from completing successfully.
Chris Hanson [Mon, 16 Jun 1997 09:00:48 +0000 (09:00 +0000)]
Now that MAKE-METHOD calls INITIALIZE-INSTANCE, it is necessary to
provide a default EMP for INITIALIZE-INSTANCE until the default method
is installed. This is done by means of the runtime system's default
EMP kludge.
Chris Hanson [Mon, 16 Jun 1997 08:59:06 +0000 (08:59 +0000)]
Extensive revamp of INSTANCE-CONSTRUCTOR. Optional argument now
specifies how many additional arguments the constructor accepts; the
additional arguments are passed to INITIALIZE-INSTANCE. By default,
any number of additional arguments are accepted and passed.
Chris Hanson [Sun, 15 Jun 1997 06:41:44 +0000 (06:41 +0000)]
Implement support for INITIAL-VALUE slot keyword. Add new generic
procedure INITIALIZE-INSTANCE, and give INSTANCE-CONSTRUCTOR and
optional boolean argument that, if true, says to call
INITIALIZE-INSTANCE on the instance before it is returned.
Chris Hanson [Tue, 10 Jun 1997 05:58:13 +0000 (05:58 +0000)]
Fix bug: Scheme variable completion was failing in some cases because
the completion code was unable to obtain the correct environment in
which to look up the variables.
Chris Hanson [Fri, 6 Jun 1997 07:00:53 +0000 (07:00 +0000)]
Change regular-expression primitives to treat failure-stack overflow
as equivalent to "no match". Also, increase the maximum size of the
failure stack from 1000 to 20000. This is important because it is far
too easy to overflow the stack, the stack-overflow errors cause Edwin
to bomb out. This is a problem because stack-overflow errors can be
caused by user data -- the proximate example being a News message that
bombed out the News reader because it had a header line was too
complicated to match. Better to fail in these situations than to
error.
Chris Hanson [Fri, 6 Jun 1997 05:06:04 +0000 (05:06 +0000)]
Modify encrypted-file support to allow the ".ky" suffix. This is
desirable because mixed-case filenames cause trouble when mapping
between unix and case-insensitive file systems.
Chris Hanson [Fri, 6 Jun 1997 05:04:57 +0000 (05:04 +0000)]
Modify encrypted-file support to allow the ".ky" suffix. This is
desirable because mixed-case filenames cause trouble when mapping
between unix and case-insensitive file systems.