Commit graph

28724 commits

Author SHA1 Message Date
Stas Boukarev 974e29da3b arm64/return: don't put descriptors into tmp-tn 2026-09-02 12:44:56 +03:00
Stas Boukarev 0b7c732828 arm64/return: store to (thread-mv-count) first 2026-09-02 10:48:00 +03:00
Stas Boukarev c8d0ca77a9 Use CMP instead of SUBS when possible 2026-09-02 10:41:59 +03:00
Douglas Katzman 4ab4654f68 arm64: implement tls-based-mv-return
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 (x86-64, --with-sb-thread --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-mark-region-gc --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
Authored by Antigravity
2026-09-01 22:06:41 +00:00
Douglas Katzman 78e706bf96 Generalize the number of MV return regs in gc-common
And treat the values as movable roots, not pinned roots
2026-09-01 21:37:55 +00:00
Stas Boukarev 1c95a90c3f arm64: fix passing empty alien structs 2026-09-02 00:30:03 +03:00
Stas Boukarev ce99730828 x86-64: fix passing packed structs by value
Reported by Andrew Wolven.
2026-09-02 00:24:05 +03:00
Stas Boukarev b746310040 Skip tests on #+interpreter 2026-09-01 18:01:23 +03:00
Douglas Katzman 9daea02bac win32: disable agressive stack scrub
Some checks are pending
Linux arm / build (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 / 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 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
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --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
Linux arm64 / build () (push) Waiting to run
Linux qemu / build (ppc64le) (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) (push) Waiting to run
2026-09-01 09:59:48 -04:00
Stas Boukarev 303db288a5 Correctly not check ftypes of unused optionals
Fixes lp#2165974
2026-09-01 16:53:10 +03:00
Charles Zhang 9685c98e78 Auto-stack-allocate self and mutually-referential functions as well.
Teach environment analysis how to detect when functions which have
references in other functions (potentially itself) are automatically
stack allocatable. This is done by marrying the closure environment
analysis with some of the existing escape analysis utilities, and by
combining those analysis with a step to annotate the correct derived
dynamic extent lifetime, which further required some IR1 flow-graph
hacking utilities to revoke tail call semantics when
necessary. Additionally, the escape analysis performed for functions
is also now somewhat unified with how values are handled, so such
functions are now also stack allocated when all their references
deliver values to e.g. dx-safe functions. In fact, dx-safe as an
ir1-info annotation should probably just be removed in favor of
user-defined dx declarations.

We have thus deleted the arbitrary restriction on auto-dxification of
functions that made us just give up the moment a reference to a
potentially dxable function was in a different environment.

This fixes the existing expected test failures we had regarding being
able to auto stack allocate self-referential functions. We also add a
bunch of new tests to exercise stack-allocatability and correctness of
mutually referential functions which close over each other as well.

We can now remove some explicit dynamic extent declarations in the
system that are now automatically inferred by the compiler, since it
is safer that way in case the functions are changed. It may work to
remove more declarations but these are clearly the instances that the
compiler now handles.

Some test cases provided by Gemini. Everything else written by me.
2026-09-01 13:09:51 +02:00
Charles Zhang ee1e63f0fb Be even more conservative around cons and non-simple array types.
While it could be argued that

(lambda (x)
  (declare (optimize speed))
  (declare (type (array * (4 4)) x))
  (adjust-array x '(3 5))
  (array-dimension (the (array t) x) 0))

should be able to return 4 (I think this is rather dubious though),
clearly it is not correct for the attached test case to be able to do
so. Because declared types do not know anything about variable
subsitution, do not try and squeeze more type information from a
declared type if there is more than one reference to the variable.

While it is unfortunate that a test had to be disabled as a worse type
is derived, I don't see how to safely derive a better type without
making other cases incorrect. This could be fixed as a follow-up.

Notably

(lambda (x)
  (declare (type (or null (cons fixnum)) x))
  (setf (car x) 'foo)
  (if x
      (+ (car x) 4)
      0))

simply crashes without this fix and is not safe, which is not good
even if it's undefined behavior. The corresponding test case with a
variable substitution is not only unsafe but incorrect despite being
defined behavior.

Fixes lp#2165835.
2026-09-01 13:09:51 +02:00
Charles Zhang 2ca5d27079 Delete random macrolet. 2026-09-01 13:09:51 +02:00
Charles Zhang b69b11cc26 stack: Fix preservation of intervening stack lifetimes, again^n.
We were sometimes merging dynamic extent lifetimes in such a way that
the stack lvar of a dynamic extent later in the flowgraph was used
instead of the earliest one. Fix this by checking the state of the
stack and making sure that dynamic extents always end up taking on the
stack lvars of dynamic extents that happen before them in the
flowgraph when merging their lifetimes.

Fix found with assistance from Gemini Pro after much heavy hinting
from me. Extended commentary and test case reduction by me.

Fixes lp#2156347.
2026-09-01 13:01:00 +02:00
Charles Zhang 2f5e20b7af Endow DX semantics to SET values at IR1tran time.
Instead of waiting for environment analysis to scan set nodes for
dxable values, we can just create a dynamic extent per lambda and
associate it with the value of a SET during IR1
translation. Environment analysis can then run as normal and only
needs to worry about checking whether the environments of the value
and the dynamic extent are the same.

Doing so provides the following benefits (notably fixing a bug):

* We make handling of DX and sets more uniform, so that we no longer
need to handle a case where let conversion has happened or not. This
has the following benefits:
** Assignment lambdas don't confuse DX anymore. This fixes
lp#2163043.
** Flushed initial values don't cause pessimization anymore, fixing a
FIXME.

* It is now straightforward/more clear how to make the compiler
handle free dynamic-extent declarations.

* We can optimize or transform away SET nodes (think copy propagation
or SSA type optimizations) during IR1 optimization without worrying about additional DX
bookkeeping.

Also, revise some commentary about dynamic extent handling across
locall and envanal.
2026-09-01 13:00:58 +02:00
Stas Boukarev 8e964fd583 Add shortcuts for bignum * and /
Some checks are pending
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 / 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 / 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) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --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
2026-09-01 07:08:06 +03:00
Stas Boukarev 695553ac46 Improve intexp around ratios and bignums
Avoiding unnecessary negations.
2026-09-01 07:08:06 +03:00
Douglas Katzman 310019ac0e Add a hack to make GC weak-hash-table tests reliable
The optimization of not scrubbing the part of the control stack that you
think you don't have to scrub is contrary to the requirement of some tests.
Real use would not often care. As mentioned in the prior commit, the
scrubbing logic was actually deficient going back nearly 15 years,
so the new logic is merely differently deficient but geared toward avoiding
touching all memory of all stacks of all threads on every GC.
2026-09-01 00:04:57 -04:00
Douglas Katzman c0ab42f560 Add a fallback path for arch_scrub_control_stack 2026-08-31 22:59:19 -04:00
Douglas Katzman ba8cedba53 Simplify and speed up arch_scrub_control_stack
It now uses a heuristic to decide where to stop clearing memory, which is
less technically accurate than before, but the key observation is that this
code was wrong for 15 years and therefore it's hard to say it takes less time
to do more work. i.e. because it never cleared enough, it stands to reason
that it might take more CPU time, though algorithmically it's better.
Hopefully this is also in practice better at reducing floating garbage.

Reviewed by Gemini
2026-08-31 21:53:35 -04:00
Stas Boukarev 774ad4de28 Speed up gmp-intexp
Faster dispatch to orig-intexp.
Faster (expt ratio -power)
2026-09-01 03:03:25 +03:00
Ilia Gradina c998d48297 sb-gmp: hand a non-rational base back to the original INTEXP
EXPT dispatches to INTEXP for a (COMPLEX RATIONAL) base as well as for
fixnums, bignums and ratios:

  (((foreach fixnum (or bignum ratio) (complex rational)) integer)
   (intexp base power))

GMP-INTEXP handles integers, ratios and 0/+-1, then sends everything else to
MPZ-POW, which only takes an integer. So merely loading the contrib - LOAD-GMP
calls INSTALL-GMP-FUNS itself, and again from an init hook - turns a working
EXPT into a type error:

  * (expt #c(1/5 1) 1)
  ; Evaluation aborted on #<TYPE-ERROR expected-type: INTEGER
  ;                                    datum: #C(1/5 1)>

Constant folding hides it from a toplevel REPL form, so it only shows up in
compiled code with a computed base. Maxima hits it through bernstein_poly,
where it fails one of the regression tests on any build linked against sb-gmp.

Send non-rational bases to ORIG-INTEXP, which handles them by repeated
squaring; GMP keeps the integer and ratio paths it was installed for.
2026-09-01 03:03:25 +03:00
Stas Boukarev 39303703db with-interrupt-bindings: mv-count is a fixnum
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) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --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
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
2026-09-01 00:53:12 +03:00
Stas Boukarev de01b60ddb Try more values in mv-return.impure
Some backends use 4 or 6 registers
2026-09-01 00:36:13 +03:00
Stas Boukarev 1dc3d56d15 Redo a test without using threads 2026-09-01 00:23:12 +03:00
Douglas Katzman 17d379157f Forgot a DX 2026-08-31 16:45:30 -04:00
Douglas Katzman 3a3d112d7e Fix interrupt-thread for #+tls-based-mv-return 2026-08-31 16:35:26 -04:00
Gabor Melis 9c2cbbd7d1 sb-manual: don't use version controlled symlinks
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
Mac / build (x86-64, --with-mark-region-gc --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
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) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
They are a hassle on Windows.
2026-08-31 10:20:39 +02:00
Stas Boukarev ce95b400c9 Resolve a GC issue with #+tls-based-mv-return
Write the high water mark before storing things on the return stack.
2026-08-31 10:34:45 +03:00
Stas Boukarev 66e972ebc0 #+tls-based-mv-return return: don't write RCX before it's needed
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) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --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
2026-08-31 03:13:58 +03:00
Stas Boukarev 2a3976842d Better return value tn movement with #+tls-based-mv-return
E.g.
(values 1 2 3 4 5 7 8 9 10 11 12 13) doesn't move into stack locations
before moving into its passing place.
2026-08-31 03:02:22 +03:00
Stas Boukarev 565e932d70 Reduce DISPATCH-RATIO expansion size
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, 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) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --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
Don't check for fixnum ratio components if the integer it'll be added
to is a bignum.
2026-08-31 01:00:58 +03:00
Stas Boukarev 8b499bda00 More ratio arithmetic shortcuts
Like dividing by -1 adding 0, etc.
2026-08-31 00:45:27 +03:00
Douglas Katzman c5d1a5ce8e Enable a crossbuild test of :tls-based-mv-return 2026-08-30 16:57:03 -04:00
Douglas Katzman 4abf6ef5f7 x86-64: Implement "possible win" cited in calling-convention.texinfo
Create a dedicated area of 'struct thread' to return multiple-values in excess
of the arg-passing registers. Gating feature is :TLS-BASED-MV-RETURN and not
enabled by default. The limit of 64 (inclusive) values is the minimum to get
most existing tests to pass unchanged.  After the optimizations outlined below
are done, the feature will be more compelling, and we can see about making it
opt-out rather than opt-in, or making MULTIPLE-VALUES-LIMIT configurable.
(I'm sure that some user will claim to need 1000 values.)

The benefit will be fully realized in some subsequent changes, namely:
freeing a DX alloc, unbinding a special var, and breaking up a catch block
will all return from their frame without invoking RETURN-MULTIPLE. Similarly,
some "simple" unwind-protect forms such as release-mutex could too- anything
that does not clobber the thread-local area during a cleanup.
Also this alleviates a big impediment to creating an LLVM-based backend
which could explore performance differences among the call conventions
offered, since micro-management of the stack becomes less critical.

Co-authored with Antigravity
2026-08-30 15:51:25 -04:00
Stas Boukarev b36bdc5855 More compact fop-simd-pack 2026-08-30 21:19:41 +03: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 e60afcbe4e arm64: use a flagged :conditional %digit-0-or-plusp VOP 2026-08-30 12:44:12 +03:00
Stas Boukarev ba19daa024 Don't define a no-op splat as a VOP
It creates non-transparent moves.
2026-08-30 12:38:11 +03:00
Stas Boukarev 01bd7882b1 More partial result modification false positives 2026-08-30 12:06:55 +03:00
Stas Boukarev 2e9abed30d arm64: more optimizable integer-length
arm64 has leading sign/zeros instructions, to get integer-length they
need to be subtracted from 63/64.
Doing it in VOPs is opaque, move to a lisp transform and two cls/clz VOPs.
That way (- 63 (integer-length x)) is just one instruction.
2026-08-30 09:57:09 +03:00
Stas Boukarev 94b6820242 expt: use (= (ftruncate n) n) to check for integers
It's no slower, and can be faster if #+round-float is available.
It's certainly simpler and more compact.
2026-08-30 08:59:42 +03:00
Stas Boukarev c33aaa910b arm64: better complex-float-=
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, 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) (push) Waiting to run
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc --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
2026-08-30 08:06:30 +03:00
Stas Boukarev 5b897710fc arm64: use zip1 for creating complex floats 2026-08-30 08:06:30 +03:00
Douglas Katzman 69ad1e7908 De-obfuscate a loop
It avoided emitting a load of NIL more than once, but not relevant now.
2026-08-30 00:47:13 -04:00
Stas Boukarev 5a5ce63459 Disable a test
[skip ci]
2026-08-30 05:21:37 +03:00
Stas Boukarev 1899deda6a Distinguish between full and partial constant pass-through 2026-08-30 04:47:33 +03:00
Stas Boukarev 5bfa2103ec More thorough tracking of macro argument modifications 2026-08-30 04:17:15 +03:00
Stas Boukarev c338940576 More constant tracking for destructive modification detection 2026-08-30 04:00:50 +03:00