master: Use a memory operand instead of loading into a register

stassats via Sbcl-commits <[email protected]> Sat, 18 Jul 2026 10:34:35 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  88b11e809444329adec84e3a5e82bb4de1957241 (commit)
      from  121f13c48b70c86e017d404124cc9b83d2222241 (commit)

- Log -----------------------------------------------------------------
commit 88b11e809444329adec84e3a5e82bb4de1957241
Author: Stas Boukarev <[email protected]>
Date:   Sat Jul 18 13:31:57 2026 +0300

    Use a memory operand instead of loading into a register
---
 src/code/arm64-simd.lisp  |  2 +-
 src/code/x86-64-simd.lisp | 18 +++++-------------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/src/code/arm64-simd.lisp b/src/code/arm64-simd.lisp
index 5927a3acd..f461b8d09 100644
--- a/src/code/arm64-simd.lisp
+++ b/src/code/arm64-simd.lisp
@@ -2090,7 +2090,7 @@
                      (inst cmp byte-array-length 16)
                      (inst b :lt DONE)
 
-                     ;; Spread the character to all 4 bytes
+                     ;; Remove the low bits for each of the possible 4 resulting bytes
                      (inst ushr f1 bytes 18 :4s)
                      (inst ushr f2 bytes 12 :4s)
                      (inst ushr f3 bytes 6 :4s)
diff --git a/src/code/x86-64-simd.lisp b/src/code/x86-64-simd.lisp
index e062553de..e1c06dcdb 100644
--- a/src/code/x86-64-simd.lisp
+++ b/src/code/x86-64-simd.lisp
@@ -2584,10 +2584,7 @@
                        ((high-bytes complex-double-reg))
                        ((utf8-mask complex-double-reg))
                        ((zero complex-double-reg))
-                       ((ascii complex-double-reg))
-                       ((shuf-mask))
-                       ((and-mask))
-                       ((orr-mask)))
+                       ((ascii complex-double-reg)))
               ((byte-index unsigned-reg positive-fixnum :from :load)
                (char-index unsigned-reg positive-fixnum :from :load))
 
@@ -2740,11 +2737,6 @@
                        (inst shr :dword tmp 24)
                        (inst shl :dword tmp 6)
 
-                       (inst vmovdqu shuf-mask (ea 0 full-table tmp))
-                       (inst vmovdqu and-mask  (ea 16 full-table tmp))
-                       (inst vmovdqu orr-mask  (ea 32 full-table tmp))
-                       (inst movzx '(:byte :dword) tmp (ea 48 full-table tmp)) ;; number of produced bytes
-
                        ;; Spread the character to all 4 bytes
                        (inst vpslld t1 bytes 6)
                        (inst vpslld t2 bytes 4)
@@ -2760,10 +2752,10 @@
                        (inst vpor bytes bytes t2)
 
                        ;; Shuffle the bytes into place
-                       (inst vpshufb bytes bytes shuf-mask)
-
-                       (inst vpand bytes bytes and-mask)
-                       (inst vpor bytes bytes orr-mask)
+                       (inst vpshufb bytes bytes (ea 0 full-table tmp))
+                       (inst vpand bytes bytes (ea 16 full-table tmp))
+                       (inst vpor bytes bytes (ea 32 full-table tmp))
+                       (inst movzx '(:byte :dword) tmp (ea 48 full-table tmp)) ;; number of produced bytes
 
                        (inst vmovdqu (ea byte-index byte-array) bytes)
 

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


hooks/post-receive
-- 
SBCL