Commit graph

28594 commits

Author SHA1 Message Date
Douglas Katzman a3dbf9924e Prefer not to use #+#. in tests 2026-08-19 13:25:20 -04:00
Douglas Katzman f4dc30318b Enable most of clos.impure for --evaluator-mode interpret
Was disabled by rev 278038f2bb but seems to pass nearly all tests
under sb-fasteval. No idea what the situation is with sb-eval.
2026-08-19 13:20:31 -04:00
Stas Boukarev 945dba8de3 read-line: faster return if #\Newline is in the buffer 2026-08-19 08:01:34 +03:00
Stas Boukarev 0b019f26d4 arm64/utf8-to-string: return to the fast path from the full loop
The check is performed for free by utilizing the integer pipeline
using SWAR.
2026-08-19 05:02:42 +03:00
Stas Boukarev b3a61535ef Rearrange branches 2026-08-19 02:04:40 +03:00
Stas Boukarev adb9b23144 arm64/utf8-sap-to-character-string: add a 1/2-byte fast path 2026-08-19 01:54:38 +03:00
Stas Boukarev 4b2be60c8b Don't stop compilation on bad type declarations 2026-08-18 07:41:05 +03:00
Stas Boukarev 09e5b5d14e Never transform ELT to NTH
The initial problem is that elt derives types on constant lists
without adding a NIL, which can be returned by NTH.
Always check bounds instead.
There's no performance advantage in not signaling an error.
2026-08-18 06:44:02 +03:00
Douglas Katzman 8a26a86d76 Assign layout-ids just-in-time as originally intended
This wasn't working right, and the assertion in LAYOUT-ID about assigning
only structures an ID was written incorrectly.

* Layout IDs are assigned only when applying a :layout-id fixup or when storing
  into a descendant type's ID array, whichever occurs first.
* IDs of non-structure instances like STREAM that have nonzero IDs are
  stored at the correct place for their depthoid, and not always at index 0
  so that LAYOUT-ID doesn't have to test +structure-layout-flag+.
* LAYOUT-ID returns NIL instead of 0 if no ID is assigned.
  machine-dependent files will never see the 0.
* The remark that IDs could do type-based dispatch is no longer hypothetical
2026-08-17 19:15:29 -04:00
Stas Boukarev 06151ad1c1 Fix ldb transforms
erase-node-type has to be called with value-types.

Reported by Eric Marsden.
2026-08-17 18:23:13 +03:00
Stas Boukarev 0a1f43ff5d Replace two instructions with one 2026-08-17 07:19:16 +03:00
Stas Boukarev 7f3f7b8ef3 Use a smaller instruction 2026-08-17 06:21:00 +03:00
Douglas Katzman 4f0efb07bc Fix typo 2026-08-17 02:55:35 +00:00
Douglas Katzman b3b9f0efa2 Factor out boilerplate from structure-is-a 2026-08-16 22:19:14 -04:00
Stas Boukarev 65b968f2ac avx2/character-string-to-utf8: optimize newline tracking
And ASCII detection.
Let it work on the bytes packed with saturation.
Use branches.
2026-08-17 04:02:49 +03:00
Douglas Katzman 37d8c020ee Remove some nops for ancient MIPS I support
Due to getting load delays wrong, we have never correctly run on MIPS I afaict
so don't even try. MIPS II has branch delays and also there are some
coprocessor hazards that still need delays, therefore keep those intact.
2026-08-16 20:46:07 -04:00
Douglas Katzman c652d1fb01 Delete 6-year-old TODO
It's better to handle relocation of all spaces like x86-64 does
2026-08-16 15:46:05 -04:00
Stas Boukarev 5f08e87681 Prevent var substitution with lvar-type-annotations
Which might cause type conflicts in new refs.
This might make some things opaque, but type-annotations are used only
in very specific cases, and preserving control flow with casts or
combinations will be just as opaque.
2026-08-16 17:29:38 +03:00
Stas Boukarev e1e0e2df5c avx2/character-string-to-utf8: simplify calculations
Reuse the lower bits of imul to sum utf8 lengths.
2026-08-16 02:36:12 +03:00
Stas Boukarev 4f0383a528 avx2/character-string-to-utf8: don't use a lookup table for sizes
Use a sequence of gpr instructions.
2026-08-15 22:34:25 +03:00
Gabor Melis a797aedf9d fix ffi documentation at the source
The generated texinfo files (e.g. ffi.texinfo) are under version
control only to be able to conveniently track the Markdown-to-Texinfo
output until it's deemed stable enough.
2026-08-15 17:50:15 +02:00
Stas Boukarev f832c8e48e ffi.texinfo: struct by value is supported on Windows
[skip ci]
2026-08-15 17:47:32 +03:00
Stas Boukarev c65240ba13 arm64/character-string-to-utf8: reduce GPR calculations 2026-08-15 08:40:13 +03:00
Stas Boukarev 6efe9cda26 avx2/character-string-to-utf8: reduce a LUT by 4KB
A tag mask can be computed in one instruction from character lengths.
2026-08-15 07:35:52 +03:00
Stas Boukarev 977441e827 arm64/character-string-to-utf8: reduce a LUT by 4KB
A mask that clears the high bits can be generated from the tag bits
with a single right shift.
2026-08-15 06:28:17 +03:00
Stas Boukarev 4c9ebabb78 arm64/character-string-to-utf8: don't use a lookup table for sizes
Use a sequence of gpr instructions. Sits somewhere in the middle
between a lookup table and vector instructions, but doesn't depend on
the L1 cache.
2026-08-15 06:28:15 +03:00
Stas Boukarev 3c314be353 Stop reusing potentially optimized inlined functions
Fixes lp#2163502
2026-08-15 02:02:23 +03:00
Stas Boukarev facbb275e3 arm64: fix fast-logand-c/unsigned=>unsigned
Inherit from the right VOP
2026-08-15 02:02:23 +03:00
Douglas Katzman 524d98588a Use zeroize 2026-08-14 14:46:52 -04:00
Stas Boukarev 27f73d43b2 arm64/character-string-to-utf8: use a lookup table for sizes 2026-08-14 16:57:16 +03:00
Stas Boukarev 55d3b2696e character-string-to-utf8-avx2: shrink the lookup table
The bit clearing masks can be computed cheaply at runtime.
2026-08-14 06:03:53 +03:00
Charles Zhang 6c0c0fdc2c constraint: Inherit EQL var constraints from local calls as well.
(defun f ()
  (declare (optimize speed))
  (labels ((phi (index)
             (declare (type (integer 0) index))
             (if (> index 9)
                 nil
                 (rec 0 index)))
           (rec (zoot gindex)
             (declare (fixnum zoot))
             (if (< zoot 5)
                 (rec (1+ zoot) gindex)
                 (phi (1+ gindex)))))
    (phi 0)))

now no longer produces any notes.

However, we don't have optimistic type propagation in CP itself, so
neither the lower bound nor the integerness of GINDEX or INDEX can be
derived.
2026-08-14 03:19:09 +02:00
Charles Zhang 87608fcd95 Delete unused function. 2026-08-14 03:18:21 +02:00
Douglas Katzman 1faf50d3dc Improve codegen for chain of structure-TYPEP tests
When performing successive tests, if all types have the same depthoid, then
rather than emit an instruction to load instance-layout, and then a series
of instructions to compare the layout-id against various numbers (each
entailing a memory load), instead load the layout-id once up front and
compare that against the various IDs under consideration for equality.

If the depthoids are not all the same, fall back to the slightly suboptimal
code that loads a layout-id every time. (Better would be to try to group
comparisons into sequences of tests that can all use the same loaded ID.)

Test cases by Gemini
2026-08-13 20:13:27 -04:00
Stas Boukarev 0ed5ec0d57 Add some (safety 0)
And some other micro-optimizations.
2026-08-14 02:59:36 +03:00
Douglas Katzman 9c6a402b32 Decrease some repetition 2026-08-13 15:07:45 -04:00
Stas Boukarev 4d580f8f27 utf8-simd: reduce tagging/untagging for arguments/results 2026-08-13 19:39:52 +03:00
Stas Boukarev fee731c7dd character-string-to-utf8-avx2: reduce memory loads 2026-08-13 19:39:46 +03:00
Douglas Katzman 9b59c02a58 Recognize the pattern (if (member x `(,this ,that)) ...)
which is a useful notation for CASE clauses where the symbols to match
are not literals. So you can use a COND without writing an OR over EQL.
2026-08-13 16:19:06 +00:00
arthur 5d1babc0ec Fix bug in selecting kregister in avx512-insts.lisp 2026-08-13 14:38:15 +03:00
Stas Boukarev cefd608dd9 Remove an extra vzeroupper 2026-08-13 06:18:11 +03:00
Stas Boukarev 72da092e11 Appease cmucl 2026-08-13 06:17:27 +03:00
Douglas Katzman ed0f3c56c1 Remove some special vars from DEFCLASS parser 2026-08-12 22:46:06 -04:00
Douglas Katzman d1d85bbaa1 build-all-cores 2026-08-12 22:45:49 -04:00
Stas Boukarev cc40e148a2 x86-64-simd: improve crlf detection 2026-08-13 04:47:32 +03:00
Stas Boukarev 0290cfc968 x86-64: encode lddqu 2026-08-13 02:43:03 +03:00
Stas Boukarev 63e9079dcf character-string-to-utf8-avx2: free up a register 2026-08-13 02:43:03 +03:00
Douglas Katzman f9075a0c2a Ensure that hash-table-index-vector stays with the table
This accidental omission of ALLOCATING-FOR-HASH-TABLE had catastrophic
consequences if any system table was involved. I discovered the problem
in particular on SB-DI::*COMPILED-DEBUG-FUNS* which meant that you were
crashing while crashing, because you couldn't extract cached debug funs.

Test case by Gemini
2026-08-12 18:40:01 -04:00
Douglas Katzman f7d9205bfd Remove effectless case
This looks like a typo from rev 671e23e5 but surprisingly was syntactically ok,
hence no compiler complaint. EQ was parsed as the head of a clause.
2026-08-12 19:31:37 +00:00
Stas Boukarev bc1ea6852e More optimizations in utf8-to-character-string-avx2 2026-08-12 20:27:29 +03:00