From: Nathan Froyd Date: Fri, 13 Apr 2012 17:25:31 +0000 (-0400) Subject: micro-optimize FIXNUMP on known (signed-byte 64) quantities on x86-64 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=579098879e1a40f81a92db8491acd1d51124bd1b;p=sbcl.git micro-optimize FIXNUMP on known (signed-byte 64) quantities on x86-64 Also attempt to keep things working for those who want smaller fixnums. --- diff --git a/src/compiler/x86-64/type-vops.lisp b/src/compiler/x86-64/type-vops.lisp index 58e8854..0e8c9c4 100644 --- a/src/compiler/x86-64/type-vops.lisp +++ b/src/compiler/x86-64/type-vops.lisp @@ -209,7 +209,7 @@ (define-vop (fixnump/signed-byte-64 type-predicate) (:args (value :scs (signed-reg))) (:info) - (:conditional :z) + (:conditional #.(if (= sb!vm:n-fixnum-tag-bits 1) :ns :z)) (:arg-types signed-num) (:translate fixnump) (:generator 5 @@ -219,8 +219,8 @@ ;; ((x-a) >> n) = 0 (inst mov rax-tn #.(- sb!xc:most-negative-fixnum)) (inst add rax-tn value) - (inst shr rax-tn #.(integer-length (- sb!xc:most-positive-fixnum - sb!xc:most-negative-fixnum))))) + (unless (= n-fixnum-tag-bits 1) + (inst shr rax-tn n-fixnum-bits)))) ;;; A (SIGNED-BYTE 64) can be represented with either fixnum or a bignum with ;;; exactly one digit.