1 ;;;; type-based constants
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
14 ;;; FIXME: It's clever using :SUFFIX -TYPE for these things, but it's
15 ;;; a pain for people just learning to find their way around the code
16 ;;; who want to use lexical search to figure out where things like
17 ;;; EVEN-FIXNUM-LOWTAG are defined. Remove the :SUFFIXes and just expand
18 ;;; out the full names. Or even define them in DEF EVEN-FIXNUM-LOWTAG
19 ;;; style so searches like 'def.*even-fixnum-lowtag' can find them.
21 ;;; Tags for the main low-level types are stored in the low three
22 ;;; bits to identify the type of a machine word. Certain constraints
24 ;;; * EVEN-FIXNUM-LOWTAG and ODD-FIXNUM-LOWTAG must be 0 and 4: code
25 ;;; which shifts left two places to convert raw integers to tagged
26 ;;; fixnums is ubiquitous.
27 ;;; * LIST-POINTER-LOWTAG + 4 = OTHER-POINTER-LOWTAG: NIL is both a
28 ;;; cons and a symbol (at the same address) and depends on this.
29 ;;; See the definition of SYMBOL in objdef.lisp
30 (eval-when (:compile-toplevel :load-toplevel :execute)
31 ;; The EVAL-WHEN is necessary (at least for Lispworks), because the
32 ;; second DEFENUM uses the value of OTHER-IMMEDIATE-0-LOWTAG, which is
33 ;; defined in the first DEFENUM. -- AL 20000216
34 (defenum (:suffix -lowtag)
36 ;; Note: CMU CL, and SBCL < 0.pre7.39, had FUN-POINTER-LOWTAG
37 ;; here. We swapped FUN-POINTER-LOWTAG and
38 ;; INSTANCE-POINTER-LOWTAG in sbcl-0.pre7.39 in order to help with a
39 ;; low-level pun in the function call sequence on the PPC port.
40 ;; For more information, see the PPC port code. -- WHN 2001-10-03
49 ;;; the heap types, stored in 8 bits of the header of an object on the
50 ;;; heap, to identify the type of the heap object (which'll be at
51 ;;; least two machine words, often more)
52 (defenum (:suffix -widetag
53 :start (+ (ash 1 n-lowtag-bits) other-immediate-0-lowtag)
54 :step (ash 1 (1- n-lowtag-bits)))
59 #!+long-float long-float
63 #!+long-float complex-long-float
69 simple-array-unsigned-byte-2
70 simple-array-unsigned-byte-4
71 simple-array-unsigned-byte-8
72 simple-array-unsigned-byte-16
73 simple-array-unsigned-byte-32
74 simple-array-signed-byte-8
75 simple-array-signed-byte-16
76 simple-array-signed-byte-30
77 simple-array-signed-byte-32
78 simple-array-single-float
79 simple-array-double-float
80 #!+long-float simple-array-long-float
81 simple-array-complex-single-float
82 simple-array-complex-double-float
83 #!+long-float simple-array-complex-long-float
92 funcallable-instance-header
105 ;;; the different vector subtypes
106 (defenum (:prefix vector- :suffix -subtype)