Taylor R Campbell [Fri, 14 Dec 2018 16:12:09 +0000 (16:12 +0000)]
Relax expm1 tests; i387 in 53-bit precision won't guarantee 0.5ulp.
Taylor R Campbell [Fri, 14 Dec 2018 15:58:27 +0000 (15:58 +0000)]
Guard against loading any NaN into double here.
The i387 floating-point unit raises an exception if you even load
sNaN into the floating-point stack.
Taylor R Campbell [Fri, 14 Dec 2018 15:43:07 +0000 (15:43 +0000)]
Clear exceptions before enabling traps.
Taylor R Campbell [Fri, 14 Dec 2018 15:18:04 +0000 (15:18 +0000)]
Use integer bit tests in FLONUM-IS-NEGATIVE?.
Otherwise this raises an exception for sNaN on i387.
Taylor R Campbell [Fri, 14 Dec 2018 15:17:47 +0000 (15:17 +0000)]
Provide hokey alternatives if no SSE or i387.
Taylor R Campbell [Fri, 14 Dec 2018 15:11:44 +0000 (15:11 +0000)]
Re-enable the SSE instructions in i386.
We don't generate SSE code in the compiler but we need to maintain
the mxcsr in the floating-point environment.
Taylor R Campbell [Fri, 14 Dec 2018 13:42:18 +0000 (13:42 +0000)]
Disable open-coding of flonum-copysign/abs/negate on i386 for now.
Requires too much work to get these to handle signalling NaN
correctly at the moment.
Taylor R Campbell [Thu, 13 Dec 2018 00:13:09 +0000 (00:13 +0000)]
Rewrite flonum-copysign/abs/negate primitives using integer masks.
Otherwise these spuriously raise exceptions on i387 because merely
loading a signalling NaN onto the fp stack does so.
Taylor R Campbell [Wed, 12 Dec 2018 22:33:34 +0000 (22:33 +0000)]
Make flonum comparison primitives raise exceptions in ucode.
Taylor R Campbell [Wed, 12 Dec 2018 22:33:57 +0000 (22:33 +0000)]
Use FCOM, not FUCOM, for ordered comparisons.
Taylor R Campbell [Wed, 12 Dec 2018 23:46:48 +0000 (23:46 +0000)]
Rewrite NaN primitives in terms of integer data.
On i387, merely loading and storing a double is enough to turn a
signalling NaN into a quiet NaN, so load and store uint64_t instead.
Taylor R Campbell [Wed, 12 Dec 2018 22:07:09 +0000 (22:07 +0000)]
Call the primitives directly.
These are no longer integrated, so we can't make a compound procedure
call if they are interpreted -- the interpreter will stomp all over
Free while we're in the middle of allocating the string, leading to
mayhem. But it is safe to call the primitive, even though it is no
longer open-coded.
Taylor R Campbell [Wed, 12 Dec 2018 20:18:39 +0000 (20:18 +0000)]
Skip constant-folding MD primitives when cross-compiling.
Taylor R Campbell [Wed, 12 Dec 2018 19:33:05 +0000 (19:33 +0000)]
Distinguish bytes-per-object from target-bytes-per-object.
This is a kludge for now until we have a syntactic tower where we can
use distinct environments at each level of syntax expansion.
Taylor R Campbell [Wed, 12 Dec 2018 16:25:59 +0000 (16:25 +0000)]
Missed some .bin spots.
Taylor R Campbell [Wed, 12 Dec 2018 16:19:16 +0000 (16:19 +0000)]
Fix floating-point alignment stuff.
- Allow fasdump-storage of #f for alignment.
- Use only one mechanism for alignment, not two competing ones that
step on each other's toes.
Taylor R Campbell [Tue, 11 Dec 2018 23:50:41 +0000 (23:50 +0000)]
More line breaks for clarity.
Taylor R Campbell [Tue, 11 Dec 2018 23:50:07 +0000 (23:50 +0000)]
Fix environment this test runs in.
Taylor R Campbell [Tue, 11 Dec 2018 22:35:20 +0000 (22:35 +0000)]
Restore separation of syntax-* and compile-* targets.
This gives better parallelism; no need to wait for the runtime .com
files when we just need the .pkd from the .bin files for cref.
Taylor R Campbell [Tue, 11 Dec 2018 22:28:17 +0000 (22:28 +0000)]
Make these tests run on svm1.
Taylor R Campbell [Tue, 11 Dec 2018 22:01:18 +0000 (22:01 +0000)]
Fix fixnum range.
Taylor R Campbell [Tue, 11 Dec 2018 21:58:52 +0000 (21:58 +0000)]
Exercise some more fasdump cases. Fix missing definition.
Small bignums are busted.
Taylor R Campbell [Tue, 11 Dec 2018 15:59:30 +0000 (15:59 +0000)]
Teach `make cross-host' to convert .nib -> .bin &c.
This is more expedient for now than finding all the places in SF/CREF
that fasdump anything to fasdump both the .nib and the .bin file.
Taylor R Campbell [Tue, 11 Dec 2018 15:54:48 +0000 (15:54 +0000)]
New make target install-toolchain just installs the toolchain.
Useful for working on the cross-compiler when we don't need Edwin &c.
Taylor R Campbell [Tue, 11 Dec 2018 15:57:32 +0000 (15:57 +0000)]
Make `make all-toolchain' also build sos, ssp, and xml.
These are needed in the cross-compiler during cross-host.
Taylor R Campbell [Tue, 11 Dec 2018 15:55:42 +0000 (15:55 +0000)]
Do all-compiler/sf/cref only in cross-host, not in cross-target.
In the cross-compiled system when doing cross-target, which depends
on runtime.com and all.com, the dependencies of runtime.com and
all.com were already made by cross-host.
Taylor R Campbell [Tue, 11 Dec 2018 15:52:07 +0000 (15:52 +0000)]
Teach cross-SF/CREF to dump/load in .nib, .txe, .dkp.
These correspond to .bin, .ext, .pkd. LOAD-OPTION still loads from
.bin, .ext, .pkd (and .com) for libraries that are installed and are
not macro definitions of subsystems being cross-compiled.
This backwards suffix business is getting a little out of hand.
Possible partial alternatives:
- .xbin/.xext/.xpkd
- invent a static linker in the toolchain that can run on the cross
host rather than using make.scm and disk-save in the cross target
- devise a portable fasload that sf/cref can use in the cross host
- use a machine-independent file format for .bin/.ext/.pkd
Taylor R Campbell [Tue, 11 Dec 2018 15:48:03 +0000 (15:48 +0000)]
Move fasl version check earlier.
This breaks INHIBIT_FASL_VERSION_CHECK -- but that was already broken
so that Scheme would abort (!) before even getting to the check,
because of the conditional in fasl_object_address which is called by
decode_fasl_header.
If someone wants to revive INHIBIT_FASL_VERSION_CHECK, be my guest,
though it might be easier to do whatever you're trying to do with the
portable fasdumper instead.
Taylor R Campbell [Tue, 11 Dec 2018 15:44:19 +0000 (15:44 +0000)]
Split svm1 into four architectures: svm1 x {32,64} x {be,le}.
--with-cross-target must specify exactly which one to use for now.
--enable-native-code=svm1 or svm1-le or svm1-64 will fill in the
remaining parameters (word size, byte order) from the host system
characteristics.
Taylor R Campbell [Tue, 11 Dec 2018 15:35:34 +0000 (15:35 +0000)]
Make `make cross-target' work in three stages.
1. moc->com in runtime, so the next stages can use a compiled runtime
2. moc->com in the whole tree
3. fni->inf in the whole tree
XXX Maybe the latter stages can be combined; for now this change just
splits the first two apart. Even better, maybe we can nix this step
altogether and teach the cross-fasdumper to do this part itself.
Wouldn't be hard to teach the cross-fasdumper to do the relocation
that currently requires sketchy with-absolutely-no-interrupts crap.
For compile-scode, could maybe just fasdump to a bytevector in memory
and invent a primitive to fasload from that.
Taylor R Campbell [Tue, 11 Dec 2018 15:32:34 +0000 (15:32 +0000)]
Tweak fasdumper to null-terminate bytevectors too.
find_primitive relies on symbol names (which were formerly `strings',
i.e. `vector-8b' or TC_CHARACTER_STRING, and are now `bytevectors')
to be null-terminated.
Rather than try to figure out which ones are primitive names and
which ones are not, we'll just null-terminate all of them.
We can undo this if we change find_primitive. (We need to change the
compile-time tool findprim.c anyway because its strcmp_ci misuses
islower/toupper.)
Taylor R Campbell [Tue, 11 Dec 2018 15:17:33 +0000 (15:17 +0000)]
Merge remote-tracking branch 'origin/master' into cross-fasdump-v2
Chris Hanson [Tue, 11 Dec 2018 07:31:15 +0000 (23:31 -0800)]
Generate char sets for each UCD general category and numeric type.
And use these to avoid expensive computations in ucd-glue.
Chris Hanson [Tue, 11 Dec 2018 07:30:37 +0000 (23:30 -0800)]
Fix bug in inverting empty character set.
Chris Hanson [Mon, 10 Dec 2018 07:00:55 +0000 (23:00 -0800)]
Fix bug in string-copy!.
Chris Hanson [Mon, 10 Dec 2018 07:00:18 +0000 (23:00 -0800)]
Add tests for string-copy!, which has a bug.
Chris Hanson [Mon, 10 Dec 2018 06:58:55 +0000 (22:58 -0800)]
Add support for 'expect-failure? property on assertions.
This allows an individual assertion to be marked as broken. When the problem is
fixed, the property can be removed.
Chris Hanson [Mon, 10 Dec 2018 04:39:37 +0000 (20:39 -0800)]
Eliminate use of TC_LEGACY_STRING for symbol names.
Chris Hanson [Sun, 9 Dec 2018 05:02:07 +0000 (21:02 -0800)]
Change all string operations that accept chars to work for any char.
They dump the bucky bits as needed to make this work.
Chris Hanson [Sun, 9 Dec 2018 02:26:45 +0000 (18:26 -0800)]
Implement char->bitless-char.
Taylor R Campbell [Sun, 9 Dec 2018 00:28:53 +0000 (00:28 +0000)]
Merge remote-tracking branch 'origin/master' into cross-fasdump-v2
Taylor R Campbell [Sun, 9 Dec 2018 00:12:56 +0000 (00:12 +0000)]
Use binary-port-position directly, not via kludgey indirection.
Taylor R Campbell [Sun, 9 Dec 2018 00:06:10 +0000 (00:06 +0000)]
Rename fasdump-format -> fasl-format.
Only the fasdump side is implemented portably, but no reason the
concept need be different.
Fix up compiler package exports while here.
Taylor R Campbell [Sat, 8 Dec 2018 23:57:59 +0000 (23:57 +0000)]
Automatically determine host fasl format.
Taylor R Campbell [Sat, 8 Dec 2018 23:54:30 +0000 (23:54 +0000)]
Fasdump weak false.
(Maybe this should just not be constant-folded?)
Taylor R Campbell [Sat, 8 Dec 2018 23:54:15 +0000 (23:54 +0000)]
Define more arm variants: {le,be} x {32,64}.
Matt Birkholz [Sat, 8 Dec 2018 19:57:24 +0000 (12:57 -0700)]
x11/Makefile.am: Fix packaging, TAGS.
(Re)define c_sources so they appear in TAGS. Include compile.scm in
EXTRA_DIST. Punt empty un/install hooks and unnecessary overrides.
Matt Birkholz [Sat, 8 Dec 2018 20:07:32 +0000 (13:07 -0700)]
runtime/rfc2822-headers: Watch out for eof-object.
And leave parse-error calls in tail position, so as not to frustrate a
debugger expecting to return the correct answer.
Matt Birkholz [Sat, 8 Dec 2018 19:21:06 +0000 (12:21 -0700)]
ffi/build: Mixing strings and pathnames is problematic.
In this case rewrite-compressed-file expected a string. It probably
should expect a pathname, but it is just going to get weird with it.
Taylor R Campbell [Sat, 8 Dec 2018 16:37:04 +0000 (16:37 +0000)]
Handle reference traps and interpreter return addresses.
Taylor R Campbell [Sat, 8 Dec 2018 15:16:58 +0000 (15:16 +0000)]
Dust off portable fasdumper.
Write some trivial tests. Missing a few still.
Taylor R Campbell [Sat, 8 Dec 2018 14:19:46 +0000 (14:19 +0000)]
Fix binary-port-position for output ports.
Not sure if it'll DTRT for combined i/o ports; need more tests!
Taylor R Campbell [Sat, 8 Dec 2018 14:10:14 +0000 (14:10 +0000)]
Export binary-port-position and set-binary-port-position!.
Currently busted for output ports.
Taylor R Campbell [Sat, 8 Dec 2018 14:09:33 +0000 (14:09 +0000)]
Supply the new primitives with arities so release-10 can build this.
Chris Hanson [Sat, 8 Dec 2018 08:23:06 +0000 (00:23 -0800)]
Update test-syntax-rename to work with syntax changes.
Chris Hanson [Sat, 8 Dec 2018 08:19:31 +0000 (00:19 -0800)]
Add param:trace-syntax? to help debugging syntax expansion.
Chris Hanson [Sat, 8 Dec 2018 06:24:59 +0000 (22:24 -0800)]
Add print method to quoted-identifier.
Chris Hanson [Thu, 6 Dec 2018 15:04:35 +0000 (07:04 -0800)]
Fix: allow compiler to be compiled with current release.
Chris Hanson [Thu, 6 Dec 2018 07:48:31 +0000 (23:48 -0800)]
Tweak all the syntax tests now that they are fixed.
Chris Hanson [Thu, 6 Dec 2018 07:47:01 +0000 (23:47 -0800)]
Add assertion that does pattern matching; useful for syntax testing.
Chris Hanson [Thu, 6 Dec 2018 07:46:45 +0000 (23:46 -0800)]
Eliminate now-unnecessary exports.
Chris Hanson [Thu, 6 Dec 2018 07:46:03 +0000 (23:46 -0800)]
Rewrite environment implementation to clear up ambiguities.
See the extensive note at the beginning for details.
Chris Hanson [Thu, 6 Dec 2018 07:43:41 +0000 (23:43 -0800)]
Implement spar-funcall to call a procedure and ignore its value.
Chris Hanson [Thu, 6 Dec 2018 07:43:05 +0000 (23:43 -0800)]
Eliminate unnecessary use of strip-syntactic-closures.
Chris Hanson [Thu, 6 Dec 2018 07:42:49 +0000 (23:42 -0800)]
Fix some minor bugs in syntax renaming.
Chris Hanson [Thu, 6 Dec 2018 07:41:37 +0000 (23:41 -0800)]
In er-macro-transformer, guarantee that two renames of a symbol are eq?.
Chris Hanson [Thu, 6 Dec 2018 07:40:36 +0000 (23:40 -0800)]
Syntax renaming now handles declarations correctly.
Chris Hanson [Tue, 4 Dec 2018 04:47:55 +0000 (20:47 -0800)]
Eliminate inaccurate comment.
Chris Hanson [Fri, 30 Nov 2018 06:45:50 +0000 (22:45 -0800)]
syntax-rules: eliminate use of rename for creating new identifiers.
This confusion is one of several that has resulted from long-term muddy thinking
on my part, and is a contributor to the bug that was filed.
Also, clean up the code a bit in preparation for further changes required by
R7RS.
Taylor R Campbell [Tue, 13 Nov 2018 06:33:48 +0000 (06:33 +0000)]
Manually merge cross-fasdump branch.
Draft portable fasdumper for cross-compilation. Likely doesn't work
right now.
Taylor R Campbell [Sat, 8 Dec 2018 06:12:18 +0000 (06:12 +0000)]
Add cross-compilation test.
Taylor R Campbell [Sat, 8 Dec 2018 05:48:43 +0000 (05:48 +0000)]
Add trivial compiler test with floating-point literals.
Taylor R Campbell [Fri, 7 Dec 2018 17:11:07 +0000 (17:11 +0000)]
Use the parser state, not the value produced, to determine success.
Taylor R Campbell [Fri, 7 Dec 2018 17:10:38 +0000 (17:10 +0000)]
More polar screw cases.
Taylor R Campbell [Fri, 7 Dec 2018 17:03:02 +0000 (17:03 +0000)]
Pass the _type_ of complex component through the parser.
Restores polar notation.
Taylor R Campbell [Fri, 7 Dec 2018 16:57:01 +0000 (16:57 +0000)]
Oops, this broke polar notation.
Taylor R Campbell [Fri, 7 Dec 2018 16:51:48 +0000 (16:51 +0000)]
Reject multiple zero real components by parse states.
Rejecting on a zero real part of parsing an imaginary suffix was cute
but leads to wacky quirks in accepted notation.
Taylor R Campbell [Fri, 7 Dec 2018 16:42:30 +0000 (16:42 +0000)]
Add some more screw cases.
Taylor R Campbell [Fri, 7 Dec 2018 16:00:07 +0000 (16:00 +0000)]
Reject inf and NaN with #e notation.
There is no exact infinity or exact NaN.
Taylor R Campbell [Fri, 7 Dec 2018 15:51:28 +0000 (15:51 +0000)]
Provide notation for NaN payload and signalling NaN.
Reader has various edge cases we fail to make errors still.
Taylor R Campbell [Fri, 7 Dec 2018 15:45:43 +0000 (15:45 +0000)]
string->number returns false on error.
Taylor R Campbell [Fri, 7 Dec 2018 04:48:47 +0000 (04:48 +0000)]
Make this unreachable case an error.
Taylor R Campbell [Fri, 7 Dec 2018 04:48:34 +0000 (04:48 +0000)]
Fix printing NaN sign.
Taylor R Campbell [Fri, 7 Dec 2018 04:45:33 +0000 (04:45 +0000)]
More tests for signed NaN notation.
Only the positive quiet NaN with payload 0 is read/write invariant so
far.
Taylor R Campbell [Fri, 7 Dec 2018 04:42:29 +0000 (04:42 +0000)]
Fix sign of NaN in reader.
Taylor R Campbell [Fri, 7 Dec 2018 04:38:20 +0000 (04:38 +0000)]
Expand test-numpar.scm a little with some bugs.
Taylor R Campbell [Fri, 7 Dec 2018 04:16:41 +0000 (04:16 +0000)]
Make flo:nan.0 reliably return a `positive' quiet NaN with payload 0.
Taylor R Campbell [Fri, 7 Dec 2018 04:12:03 +0000 (04:12 +0000)]
Fix bug in flo:make-nan error reporting.
error_bad_range_arg takes argument number, not argument value.
Taylor R Campbell [Fri, 7 Dec 2018 04:11:01 +0000 (04:11 +0000)]
flo:make-nan error reporting is busted.
Taylor R Campbell [Fri, 7 Dec 2018 03:55:05 +0000 (03:55 +0000)]
Confirm #i works with inf and nan.
Taylor R Campbell [Fri, 7 Dec 2018 03:54:00 +0000 (03:54 +0000)]
There is no exact infinity or NaN, so #e should reject them.
But we produce them anyway.
Taylor R Campbell [Wed, 5 Dec 2018 05:56:55 +0000 (05:56 +0000)]
x86 push can take a memory reference operand.
Conveniently, it evaluates rsp before modifying it too.
Shaves about 1% off the runtime.
Taylor R Campbell [Wed, 5 Dec 2018 05:58:07 +0000 (05:58 +0000)]
Print newline in debugging-printer primitive.
Taylor R Campbell [Tue, 4 Dec 2018 06:15:17 +0000 (06:15 +0000)]
Disable allocator open coders.
These don't actually do anything useful. What they do is open-code a
type check -- and then branch to the same primitive call whether the
type check passed or failed. So they serve only to expand the code.
This appears to have been an aborted experiment in the HP PA-RISC back
end from 1993.
Taylor R Campbell [Mon, 3 Dec 2018 09:19:01 +0000 (09:19 +0000)]
Add missing type checks to some bit string operations.
Taylor R Campbell [Mon, 3 Dec 2018 09:18:13 +0000 (09:18 +0000)]
Bit string primitives are missing type checks.
Taylor R Campbell [Sun, 2 Dec 2018 03:32:42 +0000 (03:32 +0000)]
Teach pp to respect custom print methods for tagged vectors.
Taylor R Campbell [Sun, 2 Dec 2018 03:29:16 +0000 (03:29 +0000)]
pp doesn't respect custom print methods for tagged vectors.
Taylor R Campbell [Sun, 2 Dec 2018 02:45:35 +0000 (02:45 +0000)]
Rework vector tag printer methods so they work again.
XXX Needs tests, but these are a pain to construct...
Taylor R Campbell [Sun, 2 Dec 2018 02:08:58 +0000 (02:08 +0000)]
pp _is_ busted after all but it takes a hairier example.