Commit graph

190 commits

Author SHA1 Message Date
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
Douglas Katzman 2baf0b0a27 build-all-cores 2026-02-24 22:09:02 -05:00
Stas Boukarev 86c8512751 Restore leaving RA in a register on riscv/loongarch
Make it a wired-tn but unwire into its stack location on any
conflicts.
2026-02-24 04:54:33 +03:00
Stas Boukarev 9e403e2954 Fix floating-point-modes on arm64
Unlike arm32, arm64 has two float control registers. Setting them to
the same value used to work fine, but recent CPUs gave new meaning to
the previously reserved bits.
2026-02-23 19:47:36 +03:00
Douglas Katzman d71bb5f2ba build-all-cores 2026-02-21 12:11:01 -05:00
Stas Boukarev 8087d079ce Retry optimizing %member-eq 2026-02-17 07:41:00 +03:00
Stas Boukarev 7d6a35c01d Faster out of line coerce for some common types 2026-02-12 08:43:30 +03:00
Stas Boukarev 5f33217cad source-transform-union-typep: remove bounds from known numeric types 2026-02-11 19:58:36 +03:00
Douglas Katzman 51aa6af904 build-all-cores 2026-02-11 08:48:39 -05:00
Stas Boukarev 03264868df Can't turn (truncate (/ a complex)) into (truncate b complex)
(/ a complex) can produce a rational result, a valid argument for
truncate.
2026-02-02 05:54:33 +03:00
Stas Boukarev b4db9c85b9 Use multiplication to signal overflow in bignum-to-float
That way it can easily return infinities based on the current floating
point modes.
2026-01-29 02:15:18 +03:00
Douglas Katzman 9ffabf0a4d build-all-cores 2026-01-20 14:14:37 -05:00
Stas Boukarev 731df9caa9 Fix LOG type derivation.
The result can be a real zero even if NUMBER is negative, since base
zero returns zero.
And BASE has been proclaimed REAL since at least 1990. It can be
complex (the function itself accepts that).
2026-01-20 11:46:16 +03:00
Stas Boukarev 2002b5adbc (* (+ (* a 3) 3) 5) => (+ (* a 15) 15) 2026-01-17 06:32:05 +03:00
Stas Boukarev 957b0a5ba8 arm64: reuse existing VOPs for load-struct-arg 2026-01-15 05:17:03 +03:00
Douglas Katzman b6f186ac9b build-all-cores 2026-01-14 11:09:15 -05:00
Jesse Bouwman e9baa62bff Support struct-by-value for x86-64 and ARM64 foreign calls
Add the ability to pass and return C structs by value in alien
function calls and callbacks on x86-64 linux and ARM64 darwin. Note

- x86-64: eightbyte classification with INTEGER/SSE register classes
- ARM64: HFA detection for float aggregates, GPR pairs for small structs

Large structs (>16 bytes) use hidden pointer passing. Small structs
are unpacked from registers into heap on return.

Callbacks preserve the hidden return pointer across the Lisp call and
copy results to the caller-provided destination.
2026-01-14 09:53:37 +03:00
Stas Boukarev a4d44b2dc1 Fix floor+floor transforms
The outer divisor has to be positive.
2026-01-14 04:11:23 +03:00
Stas Boukarev dafb3a0201 (floor (floor a 10) 20) => (floor a 200) 2026-01-13 23:12:56 +03:00
Stas Boukarev 4aea9bc3f0 (truncate (truncate a 10) 20) => (truncate a 200) 2026-01-13 18:26:51 +03:00
Douglas Katzman 91d76e968a build-all-cores 2026-01-02 21:01:13 -05:00
Douglas Katzman d23d8006ba Remove the :no-constructor-defun defstruct option
Weaken function names in defstruct-descriptions before tree-shaking
and restore them after. This deletes more constructors than the option.
2025-12-28 11:34:57 -05:00
Stas Boukarev fabfa3960f (- (lognot x)) => (1+ x) 2025-12-20 02:42:17 +03:00
Stas Boukarev 35567aa155 (- (floor (- x) y)) => (ceiling x y) 2025-12-19 21:01:01 +03:00
Stas Boukarev 0918aa5f9f negate-lvar: correctly handle float-producing operations
Like ftruncate or sin.
2025-12-19 01:46:25 +03:00
Stas Boukarev 583a84d3d8 Remove - on any branch when going to ABS. 2025-12-18 23:59:13 +03:00
Stas Boukarev b49e28bda3 Handle round, ftruncate, sin, cos when removing -, abs 2025-12-18 23:46:02 +03:00