master: arm64, utf8-sap-to-character-string: reduce instruction dependencies

stassats via Sbcl-commits <[email protected]> Fri, 17 Jul 2026 01:32:01 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  0c48a0eec151962c3c3f69341eb0925ec9db526e (commit)
      from  a6183f3c0d5a11a00c23e816b5e1d06c58ca481c (commit)

- Log -----------------------------------------------------------------
commit 0c48a0eec151962c3c3f69341eb0925ec9db526e
Author: Stas Boukarev <[email protected]>
Date:   Fri Jul 17 01:35:13 2026 +0300

    arm64, utf8-sap-to-character-string: reduce instruction dependencies
---
 src/code/arm64-simd.lisp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/code/arm64-simd.lisp b/src/code/arm64-simd.lisp
index 8af0827be..b2cc9af8a 100644
--- a/src/code/arm64-simd.lisp
+++ b/src/code/arm64-simd.lisp
@@ -1672,7 +1672,7 @@
                      ((temp3 complex-double-reg t :offset 12))
                      ((c-c0 complex-double-reg))
                      ((c-bf complex-double-reg))
-                     ((powers complex-double-reg))
+                     ((powers double-reg))
                      ((c-ff complex-double-reg))
                      ((c-4 complex-double-reg))
                      ((shuf-low complex-double-reg t :offset 1))
@@ -1696,7 +1696,7 @@
             (move byte-array byte-array*)
             (inst mov byte-index 0)
             (inst mov char-index 0)
-            (load-inline-constant powers :oword #xFFFFFFFFFFFFFFFF8040201008040201)
+            (load-inline-constant powers :qword #x8040201008040201)
             (inst movi c-bf #xBF :8h)
             (load-inline-constant table
                                   (let ((table (make-array (* #b10101011 16) :element-type '(unsigned-byte 8)
@@ -1814,13 +1814,12 @@
                 (inst cmge temp bytes c-c0 :16b)
 
                 ;; Turn them into an 8 bit index
-                (inst and temp2 temp powers :16b)
+                (inst and temp2 temp powers :8b)
                 (inst addv temp3 temp2 :8b)
                 (inst umov index temp3 0 :b)
 
                 ;; Need to know where the last leading byte ends
-                ;; the high 8 bytes of temp2 is the unchanged result of CMGE
-                (inst umov suffix temp2 1 :d)
+                (inst umov suffix temp 1 :d)
                 ;; Count the number of bytes to the next leading byte, turning it into a 2 bit suffix
                 (inst rbit suffix suffix)
                 (inst clz suffix suffix)

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


hooks/post-receive
-- 
SBCL