master: Remove R/M/W memory operation from alloc-alien-stack-space

snuglas via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  8b6a050b4664d2c6b8242ae185ac77a81e8b0c06 (commit)
      from  33c68e006d3a0a30df0e6e1007743e2a9e58e6d2 (commit)

- Log -----------------------------------------------------------------
commit 8b6a050b4664d2c6b8242ae185ac77a81e8b0c06
Author: Douglas Katzman <[email protected]>
Date:   Fri Aug 28 18:43:33 2026 -0400

    Remove R/M/W memory operation from alloc-alien-stack-space
    
    Do one more instruction but one fewer memory load, because SUB with a
    memory operand counts as both a load and store.
---
 src/compiler/x86-64/c-call.lisp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/x86-64/c-call.lisp b/src/compiler/x86-64/c-call.lisp
index 361e41bed..4b1dd7b9f 100644
--- a/src/compiler/x86-64/c-call.lisp
+++ b/src/compiler/x86-64/c-call.lisp
@@ -829,10 +829,10 @@ Floats are passed in integer registers."
     (:result-types system-area-pointer)
     (:generator 0
       (aver (not (location= result rsp-tn)))
+      (inst mov result (alien-stack-ptr))
       (unless (zerop amount)
-        (let ((delta (align-up amount 8)))
-          (inst sub :qword (alien-stack-ptr) delta)))
-      (inst mov result (alien-stack-ptr)))))
+        (inst sub result (align-up amount 8))
+        (inst mov (alien-stack-ptr) result)))))
 
 ;;; Callbacks
 

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


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.