Commit graph

8007 commits

Author SHA1 Message Date
Stas Boukarev 99c5b76053 Remove fast-read-var-u-integer
Unused.
2026-08-29 06:14:44 +03:00
Stas Boukarev a60b90261b Allow (setf (slot-value x 'read-only-struct-slot)) at compile-time
Don't transform it to (setf struct-read-only-struct-slot).
It works when x or read-only-struct-slot are not known at compile
time, no reason to stop it.
2026-08-28 22:38:50 +03:00
Sylvia Harrington e4e628ab84 sb-simd: Fix a bunch of bugs
64-bit integer min/max don't have actual instructions, fake instead
Fix signed lane extraction not sign-extending
Add float abs/neg
Fix fsqrt encoding
Fix u32.4-from-u64.2/s32.4-from-s64.2 family, wrong size
Remove 64-bit integer vector mul, instruction doesn't exist
Add missing exports for integer min/max
Align spilled neon registers properly
Validate more vector instruction forms properly
Fix movi immediates
2026-08-28 22:38:41 +03:00
Stas Boukarev 3d97f782f8 Protect a test with #+ 2026-08-26 08:48:52 +03:00
Stas Boukarev f19ea95f66 Add a test for foldable functions without a runtime function 2026-08-26 08:33:59 +03:00
Stas Boukarev 5c3fe7ae65 Don't save avx512 registers in alloc tramps
Declare the allocation routines with :save-p :avx512, to save only the
live registers around the call (which shouldn't happen in optimized
code).
2026-08-26 02:04:12 +03:00
Stas Boukarev 19040616e7 Fix %make-simd-pack-512-single
Don't overwrite the inputs before they are used.
2026-08-26 01:15:57 +03:00
Stas Boukarev 6fcc8d928b Correctly signal encoding errors from string-to-octets
Fixes lp#2164924
2026-08-24 20:42:27 +03:00
Stas Boukarev 0d87331ec9 Improve utf-8 tests 2026-08-24 01:31:50 +03:00
Douglas Katzman 0383982d88 x86-64: Permute Lisp arg-passing registers
Lisp and C are new identical for #+unix though not #+win32

Co-authored by Gemini
2026-08-22 13:02:13 -04:00
Stas Boukarev bd76fc4481 arm64/character-string-to-utf8: jump to ascii-loop from a better place 2026-08-22 17:31:35 +03:00
Douglas Katzman 0eb8b556ac Apply various micro-optimizations to VECTOR-FILL/T
* use a loopless final pass after the unrolled pass
* use one fewer temp register
* remove a couple of instructions here and there

Also some stylistic changes:
* give better names to registers depending on their usage
* avoid an #ifdef for SB_SAFEPOINT in x86-64-arch

Co-authored with Gemini
2026-08-22 02:00:51 +00: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
arthur f7fe8b09df add infrastructure for EVEX compressed displacement
* Add dstate-disp-n to disassem-state
* Add reg/mem arg types for tuple sizes 1,2,4,8,16,32,64.
* Extend avx512-inst-printer-list to accept :disp-n.
* Scale EVEX disp8 by the instruction-specific tuple size in decode-mod-r/m
* Annotate full-vector EVEX moves and emit compressed displacement for them.
* Add disassembler tests for the functionality in this patch

This covers the full-vector move subset. For other EVEX memory
instructions more work is needed.
2026-08-21 18:48:06 +03:00
arthur e2ff58b302 EVEX: add V' and improve 5-bit register decoding
* Add +evex+ indicator to distinguish EVEX from VEX/legacy
  even for EVEX L'L=00 forms
* Decode ModRM.reg registers 16–31 using R'
* Stop incorrectly applying R' to ModRM.r/m operands
* Decode EVEX ModRM.r/m register-direct 16–31 using X as B'
* Decode EVEX vvvv registers 16–31 using V'
2026-08-21 18:17:34 +03:00
Stas Boukarev 6d159d1fd9 (- a (- a b)) => b
And friends.
2026-08-20 15:51:10 +03:00
Stas Boukarev 2e8fa20cbd decode-universal-time: don't do mod and truncate separately
And some other arithmetic rearrangements.
2026-08-20 14:02:17 +03:00
Stas Boukarev fc1d28224a Remove mappings from float-regs to offsets
They are just sequential integers.
2026-08-20 12:01:55 +03:00
arthur c3bb5b8700 Basic support for AVX512 mask registers
* add simd-pack-512-mask as intrinsic type (widetag)
* add associated book-keeping in VM, compiler and interpreter for simd-pack-512-mask
* add VM support for mask registers (mask-reg SC, SB, defregs, ...)
* add VOPs to compiler backend for construction, extraction
* add VOPs for movement: kregs<->kregs, kregs<->gpr and kregs<->mem
* add support for assembler in insts, avx2-insts and avx512-insts
* rewrite most of evex emitter regarding mask registers
* add print support in evex for mask related instructions
* fix some smaller bugs in previous simd-pack-512 support patch
* add tests for creation, extraction, movements, assembly printing and some internal functions
* refactor zmm-registers-used-p into avx512-state-used-p and update call sites
* add support for mask regs to avx512-state-used-p
2026-08-20 10:55:19 +03:00
Stas Boukarev 49beef5fe4 clos.impure passes on sb-eval too 2026-08-20 10:55:19 +03:00
Douglas Katzman f797952a84 Preemptively adjust a test
If RDX ceases to be the first arg-passing register, then this test will fail
because there is no byte-sized register corresponding to byte index 1 of RDI.
2026-08-20 03:52:53 +00:00
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 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 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 3c314be353 Stop reusing potentially optimized inlined functions
Fixes lp#2163502
2026-08-15 02:02:23 +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
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 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
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
arthur ad0ea010b2 fix movdqu64 in move for avx512 + test warning 2026-08-12 00:07:48 +03:00
Stas Boukarev 06df2ad72b Fix specialized XEPs with ignored parameters, again
Reported by Sylvia Harrington.
2026-08-11 17:53:31 +03:00
Charles Zhang 51e87c2de7 Make some prose less bad.
For some reason gen. ai is still awful at writing comprehensible
prose, so re-do the comments manually. (I actually published the last
set of commits prematurely before getting a chance to fix the writing
and other details, though the code was checked already).
2026-08-11 01:38:53 +02:00
Charles Zhang 6125836b9d Restore test case.
Which got fat-fingered and swallowed up in the last diff.
2026-08-11 01:15:06 +02:00
Charles Zhang b72c50c389 Constrain local call parameters from their arguments.
A loop written as a local call inferred worse types at its references
than the same loop written with an assignment, and everything that
produced the difference was on the local call side.

Constraint propagation knew nothing about a local function's
parameters. For a LET it adds a TYPEP constraint from the argument the
variable is bound to, but for any other local function it had only
LEAF-DEFINED-TYPE to go on, so the parameters reached the body with
nothing said about them. An imperative loop's variable, meanwhile, is
refined a step per round by exactly this machinery: COMPUTE-BLOCK-IN
joins what each predecessor knows, which around a loop peels one value
of the sequence per iteration until
*DERIVED-NUMERIC-UNION-COMPLEXITY-LIMIT* collapses the rest.

So constrain the parameters at the call. Binding one is an assignment
to it and carries the same two obligations a CSET does: the callee
learns the argument's type, and what was known of the parameter stops
holding -- which matters when the call is recursive, since the
parameter is then one the calling block has constraints about.
COMPUTE-BLOCK-IN already joins these across the call sites.

That alone changes nothing, because PROPAGATE-LOCAL-CALL-ARGS was
narrowing the same variables from a union recomputed out of arguments
derived from the variables themselves. Around a loop that sharpens on
every visit and never settles, and being the narrower of the two it
won. Leave a parameter that is being solved for optimistically to
PUBLISH-OPTIMISTIC-TYPES, the way a variable with sets is left to
PROPAGATE-FROM-SETS. The optimistic side reaches the same answer
convergently and constraint propagation sharpens the references from
there.

With the optimistic side now the only thing narrowing these
parameters, the rate at which it publishes is the rate at which they
sharpen, and IR1-OPTIMIZE-UNTIL-DONE was charging each publication to
*MAX-OPTIMIZE-ITERATIONS*. A pass that found nothing itself and only
published no longer counts against that budget: types only narrow, so
there are finitely many such passes, and the budget still bounds the
passes that do work. Without this, DELETED-CALL-TYPE and
LOCAL-CALLS-TO-&REST run out of rounds with types still stale.

All nine step shapes in (:LOCAL-CALL-ARG-TYPE :SPELLING-PARITY) now
derive identically to their imperative spelling. (ASH X 1), which had
no fixpoint before and drifted with *MAX-OPTIMIZE-ITERATIONS*, settles
on the answer DO reaches and stays there at 3, 6 and 12 iterations.

Implementation and test cases written by Claude Opus 5.
2026-08-11 01:12:38 +02:00
Charles Zhang 235a657397 Infer local call argument types from how the arguments step.
A loop variable carried through a local call still got a worse type
than the same loop written imperatively, in two ways.

An argument that steps the parameter through a known function of
itself contributed whatever IR1 derived for it, and IR1 derived that
from the function's ftype applied to a parameter that was still T:

  (do ((x (list 1 2 3) (nreverse x))) (...))              => CONS

  (labels ((rec (i x) (... (rec (1- i) (nreverse x)))))
    (rec n (list 1 2 3)))                                 => SEQUENCE

And a numeric parameter stepped by an increment got no bounds at all,
where an assigned one gets them from the direction of the step:

  (do ((n 0 (1+ n))) (...))                               => UNSIGNED-BYTE

  (labels ((rec (i n) (... (rec (1- i) (1+ n)))))
    (rec k 0))                                            => NUMBER

PROPAGATE-FROM-SETS has both answers already, in
SET-TYPE-OF-COMBINATION and MAYBE-INFER-ITERATION-VAR-TYPE, and
neither was reachable from the local call side.

So recognize an argument that carries a parameter forward from its own
previous value -- a step -- and keep it apart from the arguments that
deliver an unrelated value. What the steps say about the parameter is
then decided by the same means and in the same order as for a variable
with assignments: a loop counter's bounds if the steps are increments,
otherwise a fixpoint derived through the stepping function if there is
a single one, otherwise the plain union as before. A SETQ and an
argument in the parameter's own position are the same thing written two
ways, so the machinery is shared rather than mirrored:
%ANALYZE-SET-USES, SETS-NUMERIC-CONTAGION and
MAYBE-INFER-ITERATION-VAR-TYPE now take the lvars the stepped values
arrive on instead of a list of CSETs, the ({+,-} VAR STEP) test both of
the first two opened with becomes ITERATION-STEP-VALUE, and
CONVERGED-TYPE-OF-COMBINATION is the fixpoint half of
SET-TYPE-OF-COMBINATION.

A step is the only kind of contribution where an optimistic type
reaches a derivation, which is where iterating a union upward would
need widening, since (REC (1- I) (CONS 1 X)) grows X by a level every
round. Neither route iterates: the counter case reads the direction of
the step and keeps only the bound the variable moves away from, and the
fixpoint case derives twice and accepts its answer only if the second
derivation agrees with the first.

This closes the FIXME on the counter case in (:LOCAL-CALL-ARG-TYPE
:CYCLE), which now derives UNSIGNED-BYTE as the imperative loop does.

A step by more than one is still not at parity and is left as a failing
test. Each round of optimization re-derives the step from the
variable's current type and unions one more value in, and the two
spellings get a different number of rounds before they settle: for
(+ X 2) from 1, DO peels 1,3,5,7,9,11 and then takes [13,inf) while the
local call peels 1,3 and then takes [5,inf). Nothing different is
inferred about the loop -- at the variable itself the local call is the
narrower of the two -- and it is only at a reference, where constraint
propagation has had those extra rounds to work with, that DO comes out
ahead.

Implementation and test cases written by Claude Opus 5.
2026-08-11 01:12:38 +02:00
Charles Zhang 30741cecef Have CTU:COMPILER-DERIVED-TYPE return the final dervied type.
By making it an IR2 converter, we get the final type, not some
intermediate type.
2026-08-11 01:12:38 +02:00
Charles Zhang 4189ab7f19 assignment-convert: Handle tail calls and cleanups better (again).
Instead of trying to compare cleanups modulo harmlessness directly as
in the code disabled in 6cbab77cdb,
check for harmlessness of the cleanup nesting from the call node to
the lambda block directly. This allows us to re-enable the Fluet &
Weeks tests.

We also catch another case of assignment conversion where mutually
tail recursive functions are entered by tail calls from different
functions.
2026-08-10 18:22:01 +02:00
Stas Boukarev adcd474725 Don't produce a compile time warning for (setf (char string 0) #\é) 2026-08-09 01:20:46 +03:00
Stas Boukarev 93c205db17 Add a test for character-string-to-utf8 2026-08-09 00:57:39 +03:00
Charles Zhang 6cbab77cdb assignment-convert: Don't try to be so smart with cleanups.
Trying to assignment convert more lambdas whose calls have different
cleanups but not modulo harmfulness only *almost* works. While
conceptually it's fine, it causes problems during cleanup
emission. When we merge lambdas, we anchor to a specific
lexenv/cleanup, not to the messiest common ancestor. Since cleaup
emission itself has no notion of skipping harmless cleanups, it tries
to emit cleanups when it shouldn't, breaking things. I think the
actual correct as in optimal way to do it is to make cleanup emission
also ignore harmless cleanups as well, but that gets a bit hairy with
the existing cleanup sharing code in EMIT-CLEANUPS. So give up and go
back to the slightly dumber cleanup checking code.

No LLM/AI was used to diagnose this issue, so the responsibility for
this rambling is mine.

Unfortunately, a few of the assignment conversion tests (but not all of
the new ones) have to be turned off because the block tag introduced
by labels gets in the way of the optimization. Even for these tests we
still contify more than before though.

Fixes #lp2162990.
2026-08-07 23:05:56 +02:00
Charles Zhang ae55fe6443 Propagate local call argument types optimistically as well.
PROPAGATE-LOCAL-CALL-ARGS computes a local function's parameter types
by unioning the argument types across its call sites, starting each
parameter at T and narrowing. That descends the lattice, and it cannot
converge once the argument flow has a cycle in it: a call that hands a
parameter back to itself contributes the parameter's own current type,
so the union comes out (UNION <whatever> T) = T on every round and
stays there.

This means that a loop written tail recursively often gets less
precise types than its imperative variant:

  (do ((i n (1- i)) (x (list 1) x)) ((zerop i) x))     => CONS

  (labels ((rec (i x) (if (zerop i) x (rec (1- i) x))))
    (rec n (list 1)))                                  => T

We solve this by solving the local call argument type equations from
the bottom of the type lattice (i.e. from the empty type) as well,
only propagating the final optimistic type once the least fixpoint is
hit.

Fixes lp#486416.

Test cases and implementation sketch written by Claude Opus 5, code
and comments heavily simplified and edited by me.
2026-08-07 21:35:57 +02:00
Stas Boukarev 59adbea07c Fix file-position when ansi-stream-in-buffer is used 2026-08-07 22:13:22 +03:00
Stas Boukarev 00034f235f Remove ansi-stream-csize-buffer 2026-08-07 21:22:14 +03:00
Stas Boukarev ac330720f3 Fix a test 2026-08-06 06:58:17 +03:00
Stas Boukarev ffb6f743c0 ppc, ppc64: add %raw-instance-cas/signed-word 2026-08-06 00:44:13 +03:00
Douglas Katzman 341713c776 Add sb-vm:%atomic-exchange 2026-08-05 20:53:48 +00:00
Douglas Katzman 5710e793ff Disable CSE logic 2026-08-04 15:45:52 +00:00
Douglas Katzman 503f9b8a34 Return NIL from ok-to-flush for potentially trapping special refs
Some people will complain if we don't do this at least for safety 3.
2026-08-04 03:18:14 +00:00
Douglas Katzman 9c53205f5f Skip common subexpr elim for lambda enclosed in a let 2026-08-04 02:23:32 +00: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 b541f2f25b Fix a test on windows
"nul" returns NIL for file-position.
2026-08-04 01:35:04 +03:00
Stas Boukarev 588d0d281a Fix a test
lseek on /dev/zero returns zero on linux
2026-08-04 00:34:17 +03: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
Stas Boukarev 8ee5b24141 sb-simd: separate x86-64 and arm64 things 2026-08-02 17:02:43 +03:00
Stas Boukarev 5f1c338ca6 arm64: simd utf8-crlf-to-character-string-sized 2026-07-31 04:38:07 +03:00
Charles Zhang f45092cdcd Assignment convert all the things.
Improve assignment conversion even more with what I believe to be a
maximal contification algorithm, finally closing the loop on the
comments headed by ###. It can now handle transitive tail calls, even
in mutual recursive scenarios. The cleanup limitation was also relaxed
to allow more local functions to get converted. We now have 356
assignment converted lambdas compared to the baseline of 340 in
self-build. State machine code using local functions heavily should
benefit even more (where higher order control flow gets transformed
into first-order TAGBODY/GO-like code, which is beneficial
particularly for dataflow analyses).

Here is the list of functions in self-build where we now assignment
convert more. The codegen can be easily verified to be better by
e.g. disassembling the code component for
DFO-SCAVENGE-DEPENDENCY-GRAPH.

* PROCESS-REF, PROCESS-LVAR in SB-C::NODE-CONSTANT
* FAST-NTHCDR in CL:NTHCDR
* SET-VALUE in SB-KERNEL::RESTART-UNBOUND
* (LAMBDA (K)) in PRINT-FLOAT, FLONUM-TO-DIGITS, FLONUM-EXPONENT
* EMIT-STRING in SB-FORMAT::COMBINE-DIRECTIVES
* CURRENT-FRAME in SB-DEBUG::BACKTRACE-START-FRAME
* TERMINATE-INITS in ATTEMPT-PSEUDO-ATOMIC-STORE-BUNCHING
* SCAVENGE-POSSIBLY-DELETED-LAMBDA in DFO-SCAVENGE-DEPENDENCY-GRAPH
* FAIL in CL:NCONC, FINISH in SB-SEQUENCE:DELETE-IF-NOT,
RETURN-NO-TIMEOUT in DECODE-TIMEOUT, BOUNDS-ERROR in ir1util.lisp,
CALL-NEXT-METHOD-0 in sb-simple-streams

As a side note for those interested in AI benchmarking: I tried to use
Claude Code Opus 4.6 for this task after writing the Fluet and Weeks
5.1 and 5.2 test cases manually. It completely failed and did nothing
useful after several days of grinding and even tripped over mismatched
close parentheses several times. The task was too difficult.

Opus 5 essentially one-shotted the task. The code from it is used here
almost verbatim with some minor changes, though the comments were
heavily edited to be more concise and understandable. It was checked
thoroughly to be close to something I would write myself and it even
came up with some more test cases here that exercise additional cases
that need to be considered while fixing them immediately after
prompting. So, color me impressed.
2026-07-30 22:28:04 +02:00
Stas Boukarev 87357677a4 arm64: full unicode decoding in utf8-crlf-to-character-string 2026-07-30 05:52:58 +03:00
Stas Boukarev ff3913b277 Fix a test for :interpreter 2026-07-30 01:02:18 +03:00
Charles Zhang a56065fe38 Fix test. 2026-07-29 23:01:48 +02: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
Charles Zhang b8eb8dc486 Add some failing contification test cases from Fluet and Weeks.
Which can and should be optimized eventually.
2026-07-29 20:10:17 +02:00
Stas Boukarev 4331687bb8 Don't delete blocks during constraint propagation
When deleting SETs.

Fixes lp#2161789
2026-07-25 18:40:13 +03:00
Stas Boukarev 27e9e4b0ca Fix a test
[skip ci]
2026-07-24 00:35:31 +03:00
Stas Boukarev 392382ba0b Add a test for utf8-to-character-string 2026-07-23 23:50:10 +03:00
Stas Boukarev 2f717abb9c Mark a test as broken
[skip ci]
2026-07-22 04:55:55 +03:00
Stas Boukarev cead2bb637 Remove "simd-copy-" prefixes from functions 2026-07-21 07:00:38 +03:00
Douglas Katzman 83ec17c0a0 Implement sparse sets having greater storage density than SSET
Not compiled in yet but potentially part of the adaptive CONSET which
dynamically chooses between simple-bit-vector or sparse set of integers.
(Since constraints are indexed by small integers, CONSETs don't need SSETs
that store the constraints themselves - integers will do just fine.)
2026-07-21 03:12:46 +00:00
Stas Boukarev f55213a95b Move instructions around in simd-copy-utf8-sap-to-character-string 2026-07-20 08:46:22 +03:00
Douglas Katzman da7d90ca9a Optimize SSET-INTERSECTION
Impose a stricter upper bound on consing as explained in the comments.
Test cases by Gemini
2026-07-19 11:33:20 -04:00
Douglas Katzman 26a27bc8d8 Optimize SSET-DIFFERENCE
Iterating over the second set is preferred as it avoids an intermediate list,
and is worse only if the second set is much larger than the first.

Test cases by Gemini
2026-07-18 23:06:28 -04:00
Stas Boukarev 094a492c82 Add utf8 strlen test 2026-07-18 05:28:05 +03:00
Stas Boukarev d6129e1920 Add tests for simd-copy-ascii 2026-07-18 05:28:05 +03:00
Douglas Katzman 8796281182 Fix arena-related crash 2026-07-16 15:46:05 +00:00
Stas Boukarev ba08d271de source-transform-union-typep: eql complexes are not numeric-types
Some checks failed
CL-host / ecl (push) Has been cancelled
CL-host / clisp (push) Has been cancelled
CL-host / ccl (push) Has been cancelled
CL-host / cmucl (push) Has been cancelled
CL-host / sbcl (push) Has been cancelled
Linux arm / build (push) Has been cancelled
Linux arm64 / build () (push) Has been cancelled
Mac / build (arm64, --with-sb-thread --with-nonstop-foreign-call) (push) Has been cancelled
Linux qemu / build (ppc64le) (push) Has been cancelled
Linux qemu / build (riscv64) (push) Has been cancelled
Mac / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Has been cancelled
Linux / build (x86, --with-sb-thread, ) (push) Has been cancelled
Linux / build (x86, --without-sb-thread, ) (push) Has been cancelled
Linux / build (x86, --without-sb-unicode, ) (push) Has been cancelled
Linux / build (x86-64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Has been cancelled
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval --with-nonstop-foreign-call, fasteval) (push) Has been cancelled
Linux / build (x86-64, --with-sb-thread --with-nonstop-foreign-call, sse4) (push) Has been cancelled
Linux / build (x86-64, --with-sb-thread, ) (push) Has been cancelled
Linux / build (x86-64, --without-sb-thread, ) (push) Has been cancelled
Linux / build (x86-64, --without-sb-unicode, ) (push) Has been cancelled
Mac / build (arm64, --with-mark-region-gc --with-nonstop-foreign-call) (push) Has been cancelled
Mac / build (x86-64, --with-sb-thread --with-nonstop-foreign-call) (push) Has been cancelled
Windows arm64 / build (arm64, clang-aarch64, clangarm64) (push) Has been cancelled
Windows / build (x86-64, ucrt-x86_64, ucrt64) (push) Has been cancelled
CL-host / compare-xc-host-fasls (cmucl, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (ccl, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (clisp, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (self, false) (push) Has been cancelled
Fixes lp#2160429
2026-07-11 21:18:44 +03:00
Douglas Katzman 173185836f Improve SSET capacity tracking and SSET-ADJOIN
Some checks are pending
Linux / build (x86-64, --without-sb-unicode, ) (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 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
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
* Since tombstones do not exist, there is no reason to separately
  record the available cell count and in-use element count.
* SSET-ADJOIN need not eagerly grow the SSET except when the vector
  length is 0. Only if it discovers that it must insert and the
  capacity is reached should it call SSET-GROW.
* SSET-GROW can avoid some conditional branching now that it won't
  be called with a vector length of 0.

Test cases and some assistance by Gemini
2026-07-10 21:11:40 +00:00
Douglas Katzman eba8865cfd Add test manifest entry
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 / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, 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
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
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
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
2026-07-10 15:23:54 +00:00
Douglas Katzman 1ce38f9567 Change SSET to not use tombstones
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
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
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
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
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
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
Avoids 1 comparison and branch in the probe loop
2026-07-10 01:15:48 +00:00
Stas Boukarev 9f7e4928b8 arm64: simd encoding of the whole unicode range for C strings
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-07-10 02:25:55 +03:00
Stas Boukarev 7cd3645c34 Adjust a test for windows 2026-07-09 21:10:01 +03:00
Stas Boukarev acf8f1e893 t 2026-07-09 20:31:17 +03:00
Stas Boukarev 77215fb2f3 mv-bind-unused-p: skip preceding mv-call arguments
Fixes lp#2160207
2026-07-09 20:02:05 +03:00
Douglas Katzman c5c0dba535 Possibly eliminate 1 or 2 instructions from DEREF of integer arrays 2026-07-09 17:01:07 +00:00
Stas Boukarev 117122e16d Skip an unreliable test
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-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
Mac / build (arm64, --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
2026-07-09 05:36:52 +03:00
Stas Boukarev 6ae12b7cd8 Out of bounds in simd-copy-character-string-to-utf8-byte-array too 2026-07-09 04:46:32 +03:00
Douglas Katzman 0f19605f3d Get rid of a redundant sign-extend in SB-ALIEN:DEREF
Some checks are pending
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
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
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 --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
2026-07-08 02:22:23 +00:00
Stas Boukarev a238aa5c91 Adjust a test.
Some checks are pending
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
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
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 (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
2026-07-04 00:04:37 +03:00
Stas Boukarev a3e000bbd4 arm64: decode 1/2-byte utf8 C strings using SIMD 2026-07-03 23:22:02 +03:00
arthur bdc8c073cf Basic support for avx512 2026-07-01 04:31:38 +03:00
Sylvia Harrington cb716e24d6 sb-simd: arm64 support 2026-07-01 01:15:08 +03:00
Gabor Melis 3dc327b828 Silence "<internal-feature> no longer present on *FEATURES*"
... warnings when *READ-SUPPRESS*.
2026-06-29 14:01:31 +02:00
Stas Boukarev b6b1188ebf x86-64, load-fp-immediate: dispatch on the value, not destination
Fixes lp#2158587
2026-06-29 05:35:13 +03:00
Stas Boukarev 8a9a573add x86-64: fix complex float VOP macros after changing to fp-immediate
Fixes lp#2158580
2026-06-29 02:46:57 +03:00
Stas Boukarev 225e9c1f80 Don't cons constant complexes for local calls
If they end up in descriptor registers.
2026-06-28 16:02:13 +03:00
Stas Boukarev b81fef15a6 x86-64: remove fp-...-zero-scs
No different from fp-immedaite-scs, frees up four SC numbers.
2026-06-28 16:02:13 +03:00
Stas Boukarev f03e003693 Add a test for output-to-c-string/utf-8/lf 2026-06-24 23:20:36 +03:00