master: arm64, struct-by-value: don't consume gprs when running out of fprs

stassats via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  cd3e8721e3d90f6ee72a3f1c96a18cd905473d5e (commit)
      from  0cb8e863d1080c96c243428cfe4628f86a63fdfb (commit)

- Log -----------------------------------------------------------------
commit cd3e8721e3d90f6ee72a3f1c96a18cd905473d5e
Author: Stas Boukarev <[email protected]>
Date:   Thu Apr 23 11:27:20 2026 +0300

    arm64, struct-by-value: don't consume gprs when running out of fprs
---
 src/compiler/arm64/c-call.lisp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/compiler/arm64/c-call.lisp b/src/compiler/arm64/c-call.lisp
index 3140eb516..f64e69d28 100644
--- a/src/compiler/arm64/c-call.lisp
+++ b/src/compiler/arm64/c-call.lisp
@@ -96,6 +96,11 @@
                    (t
                     (make-wired-tn* prim-type stack-sc (truncate frame-size size)))))))))
 
+(defun stack-arg (state prim-type stack-sc &optional (size 8))
+  (let ((frame-size (align-up (arg-state-stack-frame-size state) size)))
+    (setf (arg-state-stack-frame-size state) (+ frame-size size))
+    (make-wired-tn* prim-type stack-sc (truncate frame-size size))))
+
 (define-alien-type-method (integer :arg-tn) (type state)
  (let ((size #+darwin (truncate (alien-type-bits type) n-byte-bits)
              #-darwin n-word-bytes))
@@ -391,9 +396,7 @@
                  (let* ((bytes (ceiling (sb-alien::alien-type-bits type) n-byte-bits))
                         (words (ceiling (sb-alien::struct-classification-size classification) n-word-bytes))
                         (arg-tns (loop repeat words
-                                       collect (int-arg state 'unsigned-byte-64
-                                                        unsigned-reg-sc-number
-                                                        unsigned-stack-sc-number))))
+                                       collect (stack-arg state 'unsigned-byte-64 unsigned-stack-sc-number))))
                    (sb-c::make-arg-tn-loader
                     arg-tns
                     (lambda (arg call block nfp)

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.