X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fgeneric%2Fearly-vm.lisp;h=1e7ec1c1d9835f378bc6abb9146da055f3683cf3;hb=bf5a814edd504f1497ef1c04966d44310e54ef28;hp=79321a65b851def22a54d50c7dcac0b273b237dc;hpb=8731c1a7c1a585d190151fa881050fb5e14c0616;p=sbcl.git diff --git a/src/compiler/generic/early-vm.lisp b/src/compiler/generic/early-vm.lisp index 79321a6..1e7ec1c 100644 --- a/src/compiler/generic/early-vm.lisp +++ b/src/compiler/generic/early-vm.lisp @@ -11,12 +11,19 @@ ;;; the number of bits at the low end of a pointer used for type ;;; information -(def!constant n-lowtag-bits 3) +(def!constant n-lowtag-bits + (integer-length (1- (/ (* 2 n-word-bits) n-byte-bits)))) ;;; a mask to extract the low tag bits from a pointer (def!constant lowtag-mask (1- (ash 1 n-lowtag-bits))) ;;; the exclusive upper bound on the value of the low tag bits from a ;;; pointer (def!constant lowtag-limit (ash 1 n-lowtag-bits)) +;;; the number of tag bits used for a fixnum +(def!constant n-fixnum-tag-bits (1- n-lowtag-bits)) +;;; the fixnum tag mask +(def!constant fixnum-tag-mask (1- (ash 1 n-fixnum-tag-bits))) +;;; the bit width of positive fixnums +(def!constant n-positive-fixnum-bits (- n-word-bits n-fixnum-tag-bits 1)) ;;; the number of bits used in the header word of a data block to store ;;; the type @@ -24,9 +31,11 @@ ;;; a mask to extract the type from a data block header word (def!constant widetag-mask (1- (ash 1 n-widetag-bits))) -(def!constant sb!xc:most-positive-fixnum (1- (ash 1 29)) +(def!constant sb!xc:most-positive-fixnum + (1- (ash 1 (- n-word-bits n-lowtag-bits))) #!+sb-doc "the fixnum closest in value to positive infinity") -(def!constant sb!xc:most-negative-fixnum (ash -1 29) +(def!constant sb!xc:most-negative-fixnum + (ash -1 (- n-word-bits n-lowtag-bits)) #!+sb-doc "the fixnum closest in value to negative infinity")