X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Farith.lisp;h=e1929f10d11a6e78516916368acafa5da2c47be6;hb=44fa19275c08a17b9d80d95102c1a8bc0da7a17e;hp=76f3b00eda53536ac9c8e6b9dea490809ca38ac5;hpb=175fc9f1e9ec03b80cbc6e7f84c5295e45c2e52c;p=sbcl.git diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index 76f3b00..e1929f1 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -1632,7 +1632,7 @@ constant shift greater than word length"))) (define-full-reffer bignum-ref * bignum-digits-offset other-pointer-lowtag (unsigned-reg) unsigned-num sb!bignum:%bignum-ref) -(define-full-reffer+offset bignum--ref-with-offset * bignum-digits-offset +(define-full-reffer+offset bignum-ref-with-offset * bignum-digits-offset other-pointer-lowtag (unsigned-reg) unsigned-num sb!bignum:%bignum-ref-with-offset) (define-full-setter bignum-set * bignum-digits-offset other-pointer-lowtag @@ -1891,6 +1891,27 @@ constant shift greater than word length"))) (move ecx count) (inst shl result :cl))) +(define-vop (logand-bignum/c) + (:translate logand) + (:policy :fast-safe) + (:args (x :scs (descriptor-reg))) + (:arg-types bignum (:constant word)) + (:results (r :scs (unsigned-reg))) + (:info mask) + (:result-types unsigned-num) + (:generator 4 + (let ((mask (constantize mask))) + (cond ((or (integerp mask) + (location= x r)) + (loadw r x bignum-digits-offset other-pointer-lowtag) + (unless (eql mask -1) + (inst and r mask))) + (t + (inst mov r mask) + (inst and r (make-ea-for-object-slot x + bignum-digits-offset + other-pointer-lowtag))))))) + ;; Specialised mask-signed-field VOPs. (define-vop (mask-signed-field-word/c) (:translate sb!c::mask-signed-field)