master: arm64: use the right register in ash-inverted

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  82f008f592c65502379785291c472202596ed8f6 (commit)
      from  97ecfac9da1b0f77fda2898f91385c083a5159b1 (commit)

- Log -----------------------------------------------------------------
commit 82f008f592c65502379785291c472202596ed8f6
Author: Stas Boukarev <[email protected]>
Date:   Mon Apr 20 23:57:16 2026 +0300

    arm64: use the right register in ash-inverted
---
 src/compiler/arm64/arith.lisp | 2 +-
 tests/arith-2.pure.lisp       | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/compiler/arm64/arith.lisp b/src/compiler/arm64/arith.lisp
index c4a2ab06e..a1478648b 100644
--- a/src/compiler/arm64/arith.lisp
+++ b/src/compiler/arm64/arith.lisp
@@ -736,7 +736,7 @@
          (unless positive
            (inst tbz amount 63 done)
            (inst neg temp amount)
-           (inst lsl result number amount)))
+           (inst lsl result number temp)))
         (positive
          (inst cmp amount n-word-bits)
          (ecase variant
diff --git a/tests/arith-2.pure.lisp b/tests/arith-2.pure.lisp
index 76956d874..94763640d 100644
--- a/tests/arith-2.pure.lisp
+++ b/tests/arith-2.pure.lisp
@@ -2532,3 +2532,12 @@
     (ash -2 sb-vm:n-fixnum-tag-bits))
    ((10)
     10)))
+
+(with-test (:name :ash-inverted)
+  (checked-compile-and-assert
+   ()
+   `(lambda (x y)
+      (declare ((integer -5 5) y)
+               ((signed-byte 16) x))
+      (ash x (- y)))
+   ((1 -5) 32)))

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


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.