Commit graph

24110 commits

Author SHA1 Message Date
Douglas Katzman d8befc4545 Add a build test for #+(and arm64 relocatable-static-space) 2024-03-04 15:11:33 -05:00
Stas Boukarev b35ce6636a Update xperfecthash63 2024-03-04 22:59:36 +03:00
Stas Boukarev 3123551937 assemble-sections: remove a mapcar. 2024-03-04 22:34:28 +03:00
Stas Boukarev 6525b7d50f Don't use conses with extra values for transform-function.
Use good old closures.
2024-03-04 21:54:34 +03:00
Douglas Katzman 4d91c15a7f Remove stray line that initialized NIL's name twice 2024-03-04 12:12:43 -05:00
Douglas Katzman 2e06ab5e91 Remove a ppc64 kludge
Change 1c9e8235ac made it so that fdefn of NIL is not physically in NIL.
Granted nothing should invoke (FIND-OR-CREATE-FDEFN NIL),
but it's best to prevent a disaster when we can.
2024-03-04 11:41:36 -05:00
Douglas Katzman b9993b266f Unbreak arm64 2024-03-04 11:05:57 -05:00
Douglas Katzman 04b9a5d973 Make CASE expansion more human-readable
Try to avoid unnecessary QUOTE and OR forms and a random gensym.
2024-03-04 10:55:25 -05:00
Douglas Katzman 74c3889094 Enable #+salted-symbol-hash for 64-bit riscv 2024-03-04 10:42:03 -05:00
Douglas Katzman 755ff1e550 Refine the faily parts of a no-consing test 2024-03-04 09:26:49 -05:00
Douglas Katzman 24953e1763 Give symbol-hash an automatic definition for 32-bit 2024-03-04 08:34:08 -05:00
Stas Boukarev 8d2562292c replace-combination-with-constant: ignore make-load-form errors. 2024-03-04 14:36:44 +03:00
Stas Boukarev 8da9bdcc6a Better AVER reporting. 2024-03-04 14:36:44 +03:00
Douglas Katzman dc8b80d67a ppc64: enable #+salted-symbol-hash 2024-03-03 20:29:45 -05:00
Douglas Katzman 5a23a28ce7 Fix Perfect hash generator failure, lp#2055794
The C code should not fail on these inputs, and there's not much I can do
without thoroughly grokking Bob Jenkins' code, but two things can work better:
(1) the API I made was broken in that it didn't detect the failure
(2) if it does fail on a set of exactly 2^N keys, where minimal-perfect is
    the same as "non-minimal" perfect, try either. It might magically work.
2024-03-03 18:18:32 -05:00
Stas Boukarev 2601f0d126 Reorder for block-compilation. 2024-03-04 00:16:23 +03:00
Stas Boukarev 4a7f4df1cf Simplify *current-path* handling for %funcall.
Call ir1-convert-common-functoid directly. Obviates the need for
simplify-source-path-form which removes leafs.
2024-03-04 00:02:12 +03:00
Douglas Katzman a871e42632 Improve a badly-written test 2024-03-03 12:32:23 -05:00
Douglas Katzman 25eb5adb96 x86-64: store SYMBOL-NAME-HASH in the high 4 bytes of hash slot
So now NIL's name-hash is 0 given that static space is below 4GB
and the SYMBOL-NAME-HASH accessor is simply a 32-bit MOV.
Also put 1 random byte in the hash slot so that SYMBOL-HASH is a
slightly better hash function for EQL,EQUAL,EQUALP tables.
2024-03-03 11:07:21 -05:00
Stas Boukarev bfe7a29fac Don't call perfectly-hashable if it's not going to be used.
Not all backends have multiway-branch-if-eq.
2024-03-03 18:14:51 +03:00
Stas Boukarev c1d7ac3766 transform-call: avoid transforming &key and &optional.
Generating entry points that will be discarded is slow.
2024-03-03 17:28:03 +03:00
Douglas Katzman 5bb2d2ba2d Restrict expand-hash-case to compiled code 2024-03-03 07:10:59 -05:00
Douglas Katzman 91b341ff3c Restrict SYMBOL-NAME-HASH to 32 bits
For 64-bit builds this is the next step toward subdividing the symbol-hash
into several sub-fields. No effect on 32-bit.
2024-03-02 19:55:54 -05:00
Douglas Katzman b821fbd780 Memoize MAKE-PERFECT-HASH-LAMBDA 2024-03-02 17:08:18 -05:00
Douglas Katzman ea5100b9ff Pull together various hashing-related chunks of code
The symbol hashing functions required for cross-compiling entailed too much
use of #+/- and were strewn across too many files. Fix that, and also make
clear distinctions between the flavors of hash you might want: pseudo-random,
or strictly based on chars of the name. SXHASH isn't always the right choice.
See in particular the large comment added to src/compiler/sxhash.
2024-03-02 15:46:22 -05:00
Stas Boukarev 780ec048d0 Go back to returning T from standard-char-p.
The new code-char constraints derive appropriate character types.
2024-03-02 21:09:55 +03:00
Stas Boukarev d25c35753c constraint-back: correctly use conset-add-constraint-to-eql.
Need to find eql vars in the GEN set.
2024-03-02 20:56:34 +03:00
Stas Boukarev 33732db6b7 Propagate that X is base-char after (< (char-code x) 128). 2024-03-02 20:27:23 +03:00
Stas Boukarev c0c615f190 ref-same-refs: use conses instead of integers.
constrain-ref-type calls change-ref-leaf which changes the indexes in
leaf-refs.

Fixes lp#2055772
2024-03-02 19:55:01 +03:00
Douglas Katzman 7f57faf293 Rename %%make-symbol -> %alloc-symbol 2024-03-02 08:59:25 -05:00
Douglas Katzman 8677cac513 Delete pick-best-sxhash-bits 2024-03-01 20:11:06 -05:00
Douglas Katzman 380ecf2a79 Improve CASE expander in various ways
* Get rid of all logic that worked around hash collisions.
  Either find a perfect hash or else expand in the naive if/else way.
  This gives better semantics by not having unused value array elements
  of branches of the resulting COND.
* Allow FIXNUM and CHARACTER as keys, possibly a mixture of them.
* Instead of only recognizing self-evaluating objects in clause consequents
  call CONSTANTP on each.
* Pass unmodified clauses to the macroexpander helper function so that
  it doesn't have to reverse-engineer all the (EQL x 'obj) tests.
2024-03-01 18:19:06 -05:00
Stas Boukarev ffcc742b3b Fix +sb-devel tests. 2024-03-02 01:37:20 +03:00
Stas Boukarev 773386b92f aver: don't save symbols.
Save strings. shake-packages can remove more stuff.
2024-03-02 01:27:59 +03:00
Stas Boukarev 57869a0fde Remove inline expansions in SB-C. 2024-03-02 01:27:59 +03:00
Stas Boukarev ed9563f2df Don't retain -attributes macros in initforms. 2024-03-02 01:27:59 +03:00
Stas Boukarev 6619de1538 Do not export do-nodes, do-blocks.
They prevent other symbols from being removed.
The tests that use them are performance tests, not a big deal to
restrict them to #+sb-devel.
2024-03-02 01:27:59 +03:00
Stas Boukarev c70c47dabf It's often compared to multiple kinds, a single logtest is more
compact.
2024-03-02 01:27:59 +03:00
Douglas Katzman ac9b33aea8 Adjust a test 2024-03-01 17:19:22 -05:00
Charles Zhang 44ee1dad2b arm64: Allow building #+relocatable-static-start on darwin. 2024-03-01 23:00:34 +01:00
Douglas Katzman 3221b3164a Add entries to the perfect hash files in advance of needing them
These are created by an ensuing commit, but it seems like commit emails
get lost when the diff exceeds a certain number of lines, and even if not,
this diff would cause clipping of the body of what is otherwise not
actually a very large change.
2024-03-01 16:07:02 -05:00
Douglas Katzman 821d42b09e Make perfecthash random tester slower
And restore output that went missing due to shape of code changing.
2024-03-01 14:21:24 -05:00
Douglas Katzman d89beb5d64 Do tiny refactor with no behavioral change
If we see a CASE macro with keys 1..39 and 50, the expander would like to
know whether it should remap those into the range 0..39 via perfect hash
(or something), versus whether IR2 would accept the keys set as-is.
So the front- and back-ends have to agree on the limitations.
2024-03-01 13:43:04 -05:00
Douglas Katzman 29950d3b5c Anticipate use of perfect hash for CASE macro
* The :MACROLET-NOT-IMMOBILE-SPACE test asserts that macroexpanders compile only
into dynamic space. No transform thus far has broken the test (because FIND etc
transforms are not macros) and while I look forward to a day when text space is
not such a precious resource, this prevents an impending failure.

* A few new xperfecthash entries will need > 3 temps in the 32-bit-codegen test.
2024-03-01 13:01:33 -05:00
Douglas Katzman 38a8524969 Invert 2024-03-01 11:58:44 -05:00
Stas Boukarev 3031279bf5 Skip interning test symbols on -x86-64. 2024-03-01 19:12:30 +03:00
Douglas Katzman b69ff1be68 Sketch out 32-on-64-bit not-yet-ready modular math vop 2024-03-01 09:14:22 -05:00
Stas Boukarev 656d7037cd reader.impure: don't test defining functions named NIL.
Not testing anything real code would do.
2024-03-01 14:27:27 +03:00
Christophe Rhodes fb6ecb600b Sort the package-use-lists in genesis
CL's PACKAGE-USE-LIST is conceptually a set, and implementations
are (empirically) allowed to return the packages in any order.  Remove
the sensitivity of cold-sbcl.core to this host implementation decision
by sorting the package names in the use list before adding to
our *package-graph*.

After this change, cold-sbcl.core as produced by cmucl and sbcl are
identical.  There remains some non-determinism in the post-cold-init
build.
2024-03-01 10:26:49 +00:00
Douglas Katzman 1c9e8235ac 32-bit: Dissociate SYMBOL-HASH and (CAR NIL)
NIL-as-cons is overlayed with SYMBOL-FDEFN which is better since that's
supposed to be NIL.  Wth newfound freedom, assign NIL a name-based hash
so that the xperfecthash30 file is insensitive to NIL's address.

And every so often you should rearrange primitive object slots anyway
to ascertain that it's not impossible.
2024-02-29 21:24:44 -05:00