Commit graph

216 commits

Author SHA1 Message Date
Douglas Katzman 3d4fe67e29 build-all-cores 2026-09-09 16:14:36 -04:00
Stas Boukarev 248bbb1fff (concatenate (string (code-char i))) splice the character directly
As is already done with (concatenate 'string (list (code-char i)))
2026-09-09 06:34:22 +03:00
Stas Boukarev 3ce92c6341 Better &rest and cast handling in combination-match
Some checks are pending
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux arm / build (push) Waiting to run
Linux arm64 / build () (push) Waiting to run
Linux qemu / build (ppc64le) (push) Waiting to run
Linux qemu / build (riscv64) (push) Waiting to run
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval --with-nonstop-foreign-call, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return, sse4) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Windows arm64 / build (arm64, clang-aarch64, clangarm64) (push) Waiting to run
Windows / build (x86-64, ucrt-x86_64, ucrt64) (push) Waiting to run
2026-09-07 20:21:36 +03:00
Stas Boukarev 53d0b3c4ff Invent a new combination matching macro to do it all 2026-09-07 03:28:02 +03:00
Stas Boukarev 790814f16e Transform (< (abs rational) c) before abs is transformed
Some checks are pending
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux arm / build (push) Waiting to run
Linux arm64 / build () (push) Waiting to run
Linux qemu / build (ppc64le) (push) Waiting to run
Linux qemu / build (riscv64) (push) Waiting to run
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval --with-nonstop-foreign-call, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return, sse4) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Windows arm64 / build (arm64, clang-aarch64, clangarm64) (push) Waiting to run
Windows / build (x86-64, ucrt-x86_64, ucrt64) (push) Waiting to run
2026-09-05 23:40:09 +03:00
Stas Boukarev 6e8c214ff1 Use word-sized-lvar-p more
Addresses an issue reported by Qiantan Hong.

Tests by Qiantan Hong.
2026-09-05 14:38:26 +03:00
Douglas Katzman f2e1794438 x86-64: Pass-through multiple values across harmless cleanups
Some checks are pending
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux arm / build (push) Waiting to run
Linux arm64 / build () (push) Waiting to run
Linux qemu / build (ppc64le) (push) Waiting to run
Linux qemu / build (riscv64) (push) Waiting to run
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval --with-nonstop-foreign-call, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return, sse4) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread --with-nonstop-foreign-call --with-tls-based-mv-return) (push) Waiting to run
Windows arm64 / build (arm64, clang-aarch64, clangarm64) (push) Waiting to run
Windows / build (x86-64, ucrt-x86_64, ucrt64) (push) Waiting to run
Optimize non-tail full calls followed by "easy" cleanups that do not execute
arbitrary forms. "Easy" includes DX allocations, special var unbinding, popping
the CATCH block stack. Then the unknown values can be directly returned as if
by tail call, bypassing the RETURN-MULTIPLE helper routine.

We annotate return LVAR as :pass-through, suppress register restoration
after the call (:save-p :compute-only), and emit return as LEAVE+RET.
Cleanup VOPs (unbind-n, %catch-breakup) must preserve the carry flag, and use
only clobberable temporary registers.

For CATCH, decouple the normal return path from the NLX path. The normal path
eliminates use of the stack for buffering the mv-save area and then restoring
it from the stack.
2026-09-04 04:44:09 +00:00
Douglas Katzman e5daa56dc3 build-all-cores 2026-08-30 12:28:02 -04:00
Stas Boukarev 71c43e5aa0 Don't define very large simd-pack functions for printing
Some checks are pending
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
Linux arm64 / build () (push) Waiting to run
Linux qemu / build (ppc64le) (push) Waiting to run
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval --with-nonstop-foreign-call, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread --with-nonstop-foreign-call, sse4) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux arm / build (push) Waiting to run
Linux qemu / build (riscv64) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Windows arm64 / build (arm64, clang-aarch64, clangarm64) (push) Waiting to run
Windows / build (x86-64, ucrt-x86_64, ucrt64) (push) Waiting to run
Just use sap-refs from memory.
Saves 1.1MB of core space.
2026-08-30 16:41:43 +03:00
Stas Boukarev 01bd7882b1 More partial result modification false positives 2026-08-30 12:06:55 +03:00
Douglas Katzman 210ad59740 build-all-cores 2026-08-29 13:25:17 +00:00
Stas Boukarev 99c5b76053 Remove fast-read-var-u-integer
Unused.
2026-08-29 06:14:44 +03:00
Douglas Katzman add94c4538 build-all-cores 2026-08-26 16:03:02 -04:00
Stas Boukarev bded621c00 arm64/character-string-to-utf8: add a fast-path for 1-2 bytes 2026-08-22 03:21:22 +03:00
Douglas Katzman b5c1bfad94 Make EMIT-EA more complicated
because it wasn't bad^H^H^Hflexible enough
2026-08-21 22:35:29 +00:00
Douglas Katzman 18f8a0c8ea build-all-cores 2026-08-21 22:19:29 +00:00
Stas Boukarev 0a1f43ff5d Replace two instructions with one 2026-08-17 07:19:16 +03:00
Stas Boukarev 4d580f8f27 utf8-simd: reduce tagging/untagging for arguments/results 2026-08-13 19:39:52 +03:00
Douglas Katzman d1d85bbaa1 build-all-cores 2026-08-12 22:45:49 -04:00
Stas Boukarev 17e1f2a4cc arm64/character-string-to-utf8: do not exit early on surrogates
Proceed encoding and return later as if nothing was encoded if
surrogates were encountered.
2026-08-11 20:36:02 +03:00
Stas Boukarev 22288ec186 character-string-utf8-length: speed up surrogates tests
Delay the range check to the end by collecting unsigned minimal values
of char-#xd800
2026-08-11 08:56:11 +03:00
Stas Boukarev 00034f235f Remove ansi-stream-csize-buffer 2026-08-07 21:22:14 +03:00
Stas Boukarev b74f5c4ef4 Change how file-position works on variable encodings
Don't maintain a vector with character sizes.
Calculate the size from the byte buffer up to the current character
buffer position.
Reduces code duplication, reduces work if no file-position is needed.
2026-08-07 02:59:43 +03:00
Douglas Katzman 100c9c2bdc Perform local common subexpression elimination for some memory loads
The technique is to find "equivalent" loads in between which there is no
computation that affects the result of the load. Also it needs a surrounding
LET, which is augmented with a new temp variable as if the user did that.
This is slightly deficient for various reasons:
1. it won't do anything without the LET
2. the more kinds of common subexpressions we allow (such as math),
   the slower IR1-OPTIMIZE-COMBINATION is going to run
3. there are possibly other node types that should be allowed to intervene

On the plus side, it's not all that hard to extend the logic to accept
other functions as participants in common subexpressions.

All test cases plus a little bit of assistance from Gemini
2026-08-04 00:58:21 +00:00
Stas Boukarev bf87e9ab2c Fix file-position on copmosite streams
concatenated-stream wasn't processing buffered input correctly.
two-way-stream and echo-stream should just return NIL, as
file-position can't apply to both streams.
2026-08-04 00:12:14 +03:00
Douglas Katzman 629a0df182 Fix failure to choose a jump table for a key type of (MOD 4)
Ironically it was working when the key's derived type was _not_ known
to be exactly (MOD 4) with a CASE over 4 keys.
2026-07-29 20:56:46 +00:00
Stas Boukarev 246af00412 Don't signal errors for (log qnan)
Fixes lp#2160268
2026-07-19 02:10:15 +03:00
Douglas Katzman 9c82bf8bdc Add missing feature to arm64 crossbuild test 2026-07-17 22:18:51 +00:00
Douglas Katzman 940bb873d1 build-all-cores 2026-07-17 21:06:42 +00:00
Stas Boukarev 4d6772fd1b arm64: support byte-array inline constants
Fewer instructions to load.
Saves registers on not having to pin in a descriptor register.
2026-07-15 00:32:12 +03:00
Stas Boukarev 719c1bceb0 Slightly faster generic simd-copy-character-string-to-utf8-byte-array
Using sap-ref-8/16/32
2026-07-07 16:53:35 +03:00
Douglas Katzman 74f07eb8f4 Fix crossbuild-runner
It doesn't work to omit avx512 from the darwin config which may have been
inadvertent. It's suspicious that a new non-working Makefile was checked in.
And I'm not sure why there are 5 features keywords to do one thing
if all of them are in fact mandatory as of now.
2026-07-04 20:42:56 +00:00
Stas Boukarev 8b5a25e7cd count transforms: accept :key and :test 2026-07-01 22:11:52 +03:00
Sylvia Harrington cb716e24d6 sb-simd: arm64 support 2026-07-01 01:15:08 +03:00
Stas Boukarev 7e81a161c7 arm64: add stX simd multiple structure instructions
Based on a patch by Sylvia Harrington.
2026-06-28 23:39:28 +03:00
Stas Boukarev cd361d1a4d arm64: use fmov to move complex immediates 2026-06-28 16:02:13 +03:00
Stas Boukarev a549f8c135 arm64: unify all float immediates 2026-06-28 16:02:13 +03:00
Stas Boukarev ff7e3a1ca6 Don't cons SAPs for sb-alien::c-string-to-string for :utf-8 2026-06-17 17:27:17 +03:00
Charles Zhang 1f5238fe0b Allow the compile-evaluator to evaluate forms directly.
This change has the overall effect of having the evaluator properly
separate out top level code from any defined functions. See the new
test :EVAL-TOP-LEVEL-CODE-SEPARATE-COMPONENT and the existing tests
:STRUCTURE-SLOT-VALUE-IN-METHOD-NO-CALLEES and
:STRUCTURE-MISSING-SLOT-VALUE-IN-METHOD-SINGLE-CALLEE. As a bonus,
self call recognition works for COMPILE now. As a side effect,
we (correctly) get more redefinition warnings as well (for example for
WARN during bootstrap), which were missing before for some reason.

In order to achieve this, the following needs to be done:

* COMPILE does not have its own special way of doing ir1 conversion
for lambdas anymore, instead relying on the top level lambda machinery
to separate out the actual compiled code. This gives the correct
semantics for policy and compilation etc. for free without special or
duplicate logic, and removes all the stuff around
HAS-EXTERNAL-REFERENCES-P, which was an idea that was never really
finished. This allows us to extend COMPILE-IN-LEXENV to evaluate forms
directly and hence allow %SIMPLE-EVAL to not have to manually wrap the
lambdas either, so evaluation-via-compilation behaves like top-level
evaluation by the file compiler (of course without file compilation
semantics). LTV processing and fasteval also can just evaluate forms
directly with EVAL-WITH-COMPILE-IN-LEXENV.
* Storing source forms should always be off for PCL generated
functions, revealed by the clos-arena test. This was probably not
detected before because the policy inheritance was subtly wrong.
* Fix some tests to not rely on questionable behavior of how named
COMPILE interacts with global type information. Such behavior should
only work in compile file mode.
* The TL-XEP debug name had nothing to do with the actual TL-XEP
functional kind, which was confusing.
* TIME now counts all lambda conversions. Just ignoring the entry
points produced by COMPILE for the top level lambda didn't make much
sense since all other kinds of entry points get counted. It's there
purely to give a hint to the user how much work the compiler is doing,
not to count anything in the source being compiled.
* Core components need to have patch tables again. The fact that they
are exercised in warm bootstrap now means that we are likely actually
using the load time code stripping functionality not just in theory,
vut in practice as well.
* Add post ir1-toplevel processing smashing of names onto compiled
functions again to get names right. As an added bonus, this allows us
to get recognize self calls working for COMPILE functions.
* core debug source infos never actually used the function slot, and
it's not clear what function to give it when evaluating top level
forms, so delete it.
* Also fix > 3 decade old bug in MAKE-LISP-SOURCE-INFO in which a
plain vector was used when one with a fill pointer was expected. I
guess this code path hadn't been exercised in a long time.
2026-05-18 12:50:29 +02:00
Stas Boukarev 0c21989ac5 Simplify numeric type construction
Add a new function, make-numeric-type, which looks like
(make-numeric-type 'integer low high), not needing to construct a
list as for (specifier-type `(integer ,low ,high))
2026-05-04 00:46:23 +03:00
Stas Boukarev 526a0b98fb Don't redefine a macro 2026-03-30 14:59:11 +03:00
Douglas Katzman 35332792be build-all-cores 2026-03-29 23:59:15 -04:00
Stas Boukarev 7737c06142 Look through MOVEs in stack-consed-p 2026-03-14 01:32:09 +03:00
Stas Boukarev f72384c2c7 Fix function call source location on ppc64 2026-03-12 21:23:17 +03:00
Douglas Katzman 223369311a build-all-cores 2026-03-11 22:55:23 -04:00
Stas Boukarev 0df24a96cf Don't add finalizers to streams opened via with-open-file
They are going to be closed in unwind-protect.

Suggested by John Mallery.
2026-03-11 19:40:59 +03:00
Douglas Katzman 1e8316ef19 Fix Haiku build (for x86-64 only) 2026-03-08 13:55:55 -04:00
Stas Boukarev c1cded70e5 Derive (map `(vector ,p)) => (simple-array * (*)) 2026-03-06 22:53:10 +03:00
Douglas Katzman 57ce36ce66 build-all-cores 2026-03-06 11:11:58 -05:00
Stas Boukarev 2cfca0fa32 ppc32, ppc64: remove LRA
TODO:
put return-pc-passing-location into the LR special register.
flag-based multiple value returns.
2026-02-28 02:22:29 +03:00