master: Fix bug in selecting kregister in avx512-insts.lisp

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  5d1babc0ecd4dcc68dfe0cc1e9a7e3a450c7f35d (commit)
      from  cefd608dd953ea85ee40f578e88acad162af0525 (commit)

- Log -----------------------------------------------------------------
commit 5d1babc0ecd4dcc68dfe0cc1e9a7e3a450c7f35d
Author: arthur <[email protected]>
Date:   Thu Aug 13 12:42:23 2026 +0200

    Fix bug in selecting kregister in avx512-insts.lisp
---
 src/compiler/x86-64/avx512-insts.lisp | 2 +-
 src/compiler/x86-64/insts.lisp        | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/compiler/x86-64/avx512-insts.lisp b/src/compiler/x86-64/avx512-insts.lisp
index 4906a1508..f62ae489f 100644
--- a/src/compiler/x86-64/avx512-insts.lisp
+++ b/src/compiler/x86-64/avx512-insts.lisp
@@ -302,7 +302,7 @@
 (macrolet ((def (name prefix opcode-from opcode-to w)
              `(define-instruction ,name (segment dst src)
                 (:emitter
-                 (cond ((xmm-register-p dst)
+                 (cond ((k-register-p dst)
                         ;; k <- k/m or k <- gpr
                         (emit-vex segment nil src dst ,prefix #x0F nil ,w)
                         (emit-bytes segment ,opcode-from)
diff --git a/src/compiler/x86-64/insts.lisp b/src/compiler/x86-64/insts.lisp
index 1302cbe6c..3d517f474 100644
--- a/src/compiler/x86-64/insts.lisp
+++ b/src/compiler/x86-64/insts.lisp
@@ -1038,6 +1038,10 @@
 (defun zmm-register-p (thing)
   (and (register-p thing) (is-zmm-id-p (reg-id thing))))
 
+;;; Return true if THING is a K register (mask reg k0 - k7).
+(defun k-register-p (thing)
+  (and (register-p thing) (is-kreg-id-p (reg-id thing))))
+
 ;;; Return true if THING is AL, AX, EAX, or RAX
 (defun accumulator-p (thing)
   (and (gpr-p thing) (= 0 (reg-id-num (reg-id thing)))))

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


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.