0.8.12.31:
[sbcl.git] / src / compiler / generic / early-vm.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
9
10 (in-package "SB!VM")
11
12 ;;; the number of bits at the low end of a pointer used for type
13 ;;; information
14 (def!constant n-lowtag-bits
15   (integer-length (1- (/ (* 2 n-word-bits) n-byte-bits))))
16 ;;; a mask to extract the low tag bits from a pointer
17 (def!constant lowtag-mask (1- (ash 1 n-lowtag-bits)))
18 ;;; the exclusive upper bound on the value of the low tag bits from a
19 ;;; pointer
20 (def!constant lowtag-limit (ash 1 n-lowtag-bits))
21 ;;; the number of tag bits used for a fixnum
22 (def!constant n-fixnum-tag-bits (1- n-lowtag-bits))
23 ;;; the fixnum tag mask
24 (def!constant fixnum-tag-mask (1- (ash 1 n-fixnum-tag-bits)))
25 ;;; the bit width of positive fixnums
26 (def!constant n-positive-fixnum-bits (- n-word-bits n-fixnum-tag-bits 1))
27
28 ;;; the number of bits used in the header word of a data block to store
29 ;;; the type
30 (def!constant n-widetag-bits 8)
31 ;;; a mask to extract the type from a data block header word
32 (def!constant widetag-mask (1- (ash 1 n-widetag-bits)))
33
34 (def!constant sb!xc:most-positive-fixnum  
35     (1- (ash 1 (- n-word-bits n-lowtag-bits)))
36   #!+sb-doc
37   "the fixnum closest in value to positive infinity")
38 (def!constant sb!xc:most-negative-fixnum
39     (ash -1 (- n-word-bits n-lowtag-bits))
40   #!+sb-doc
41   "the fixnum closest in value to negative infinity")