master: Fix logtest on ppc64

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  da85ccc9b4fad0fb8a17d4b52432f8d3c5de9dd8 (commit)
      from  b5150429f79f3a9a8baff3378ed63e20edaa1f84 (commit)

- Log -----------------------------------------------------------------
commit da85ccc9b4fad0fb8a17d4b52432f8d3c5de9dd8
Author: Stas Boukarev <[email protected]>
Date:   Thu Apr 23 00:08:05 2026 +0300

    Fix logtest on ppc64
    
    Where n-fixnum-tag-bits is different from ppc32 (and from everything else)
---
 src/compiler/ppc64/arith.lisp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compiler/ppc64/arith.lisp b/src/compiler/ppc64/arith.lisp
index 7fbf727ed..62031261e 100644
--- a/src/compiler/ppc64/arith.lisp
+++ b/src/compiler/ppc64/arith.lisp
@@ -673,13 +673,13 @@
                           ,@(case suffix
                               (-c/unsigned
                                `((:arg-types unsigned-num
-                                             (:constant (and (unsigned-byte 16) (not (integer 0 0)))))))
+                                             (:constant (and (unsigned-byte 16) (not (eql 0)))))))
                               (-c/signed
                                `((:arg-types signed-num
-                                             (:constant (and (unsigned-byte 16) (not (integer 0 0)))))))
+                                             (:constant (and (unsigned-byte 16) (not (eql 0)))))))
                               (-c/fixnum
                                `((:arg-types tagged-num
-                                             (:constant (and (unsigned-byte 14) (not (integer 0 0))))))))
+                                             (:constant (and (unsigned-byte ,(- 16 n-fixnum-tag-bits)) (not (eql 0))))))))
                          (:generator ,cost
                           ;; We could be a lot more sophisticated here and
                           ;; check for possibilities with ANDIS..
@@ -701,9 +701,9 @@
   (:arg-types (:constant (integer 0 29)) tagged-num)
   (:temporary (:scs (any-reg) :to (:result 0)) test)
   (:generator 4
-    (if (< y 14)
+    (if (< y (- 16 n-fixnum-tag-bits))
         (inst andi. test x (ash 1 (+ y n-fixnum-tag-bits)))
-        (inst andis. test x (ash 1 (- y 14))))
+        (inst andis. test x (ash 1 (- y (- 16 n-fixnum-tag-bits)))))
     (inst b? (if not-p :eq :ne) target)))
 
 #+nil (define-vop (fast-logbitp-c/signed fast-conditional-c/signed)

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


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.