1 ;;;; This file contains some parameterizations of various VM
2 ;;;; attributes for the PPC. This file is separate from other stuff so
3 ;;;; that it can be compiled and loaded earlier.
8 (def!constant n-word-bits 32
9 "Number of bits per word where a word holds one lisp descriptor.")
11 ;;; the natural width of a machine word (as seen in e.g. register width,
13 (def!constant n-machine-word-bits 32)
15 (def!constant n-byte-bits 8
16 "Number of bits per byte where a byte is the smallest addressable object.")
18 (def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
19 "Number of bits to shift between word addresses and byte addresses.")
21 (def!constant n-word-bytes (/ n-word-bits n-byte-bits)
22 "Number of bytes in a word.")
25 (def!constant float-sign-shift 31)
27 (def!constant single-float-bias 126)
28 (defconstant-eqx single-float-exponent-byte (byte 8 23) #'equalp)
29 (defconstant-eqx single-float-significand-byte (byte 23 0) #'equalp)
30 (def!constant single-float-normal-exponent-min 1)
31 (def!constant single-float-normal-exponent-max 254)
32 (def!constant single-float-hidden-bit (ash 1 23))
33 (def!constant single-float-trapping-nan-bit (ash 1 22))
35 (def!constant double-float-bias 1022)
36 (defconstant-eqx double-float-exponent-byte (byte 11 20) #'equalp)
37 (defconstant-eqx double-float-significand-byte (byte 20 0) #'equalp)
38 (def!constant double-float-normal-exponent-min 1)
39 (def!constant double-float-normal-exponent-max #x7FE)
40 (def!constant double-float-hidden-bit (ash 1 20))
41 (def!constant double-float-trapping-nan-bit (ash 1 19))
43 (def!constant single-float-digits
44 (+ (byte-size single-float-significand-byte) 1))
46 (def!constant double-float-digits
47 (+ (byte-size double-float-significand-byte) n-word-bits 1))
50 (def!constant float-inexact-trap-bit (ash 1 0))
51 (def!constant float-divide-by-zero-trap-bit (ash 1 1))
52 (def!constant float-underflow-trap-bit (ash 1 2))
53 (def!constant float-overflow-trap-bit (ash 1 3))
54 (def!constant float-invalid-trap-bit (ash 1 4))
56 (def!constant float-round-to-nearest 0)
57 (def!constant float-round-to-zero 1)
58 (def!constant float-round-to-positive 2)
59 (def!constant float-round-to-negative 3)
61 (defconstant-eqx float-rounding-mode (byte 2 0) #'equalp) ; RD
62 ;;; FIXME I: Beware, all ye who trespass here. Despite its name,
63 ;;; FLOAT-STICKY-BITS is not the byte specifier for sticky bits in the
64 ;;; floating point control word. It is more like "accrued exceptions"
65 ;;; where FLOAT-EXCEPTIONS-BYTE is "current exceptions". Consequently,
66 ;;; on architectures where there is no "current exceptions"
67 ;;; FLOAT-EXCEPTIONS-BYTE and FLOAT-STICKY-BITS had better be the
70 ;;; FIXME II: So, I've now documented this in comments in the PowerPC
71 ;;; tree. This may not make it easy to find for when new architectures
72 ;;; get backends written...
75 (defconstant-eqx float-sticky-bits (byte 5 25) #'equalp)
76 (defconstant-eqx float-traps-byte (byte 5 3) #'equalp)
77 (defconstant-eqx float-exceptions-byte (byte 5 25) #'equalp) ; cexc
79 (def!constant float-fast-bit 2) ; Non-IEEE mode
82 ;;; NUMBER-STACK-DISPLACEMENT
84 ;;; The number of bytes reserved above the number stack pointer. These
85 ;;; slots are required by architecture, mostly (?) to make C backtrace
88 (def!constant number-stack-displacement
89 (* 2 sb!vm:n-word-bytes))
94 ;;; Where to put the different spaces.
97 (def!constant read-only-space-start #x01000000)
98 (def!constant read-only-space-end #x04ff8000)
100 (def!constant static-space-start #x08000000)
101 (def!constant static-space-end #x097fff00)
103 ;;; FIXME: this is a gross violation of OAOO, done purely to support
104 ;;; the #define of DYNAMIC_SPACE_SIZE in validate.c -- CSR, 2002-02-25
105 ;;; (these numbers should match dynamic-0-*)
106 (def!constant dynamic-space-start #x40000000)
107 (def!constant dynamic-space-end #x47fff000)
109 ;;; nothing _seems_ to be using these addresses
110 (def!constant dynamic-0-space-start #x40000000)
111 (def!constant dynamic-0-space-end #x47fff000)
112 (def!constant dynamic-1-space-start #x48000000)
113 (def!constant dynamic-1-space-end #x4ffff000)
118 ;;;; Other random constants.
120 (defenum (:suffix -trap :start 8)
128 fixnum-additive-overflow)
130 (defenum (:prefix object-not- :suffix -trap :start 16)
134 (defenum (:prefix trace-table-)
144 ;;; These symbols are loaded into static space directly after NIL so
145 ;;; that the system can compute their address by adding a constant
148 ;;; The fdefn objects for the static functions are loaded into static
149 ;;; space directly after the static symbols. That way, the raw-addr
150 ;;; can be loaded directly out of them by indirecting relative to NIL.
152 (defparameter *static-symbols*
155 ;; The C startup code must fill these in.
158 ;; functions that the C code needs to call
160 sb!kernel::internal-error
161 sb!kernel::control-stack-exhausted-error
162 sb!di::handle-breakpoint
163 sb!impl::fdefinition-object
166 *read-only-space-free-pointer*
167 *static-space-free-pointer*
168 *initial-dynamic-space-free-pointer*
170 ;; things needed for non-local exit
171 *current-catch-block*
172 *current-unwind-protect-block*
174 *binding-stack-start*
175 *control-stack-start*
178 ;; interrupt handling
179 *free-interrupt-context-index*
180 sb!unix::*interrupts-enabled*
181 sb!unix::*interrupt-pending*
186 (defparameter *static-funs*
200 sb!kernel:two-arg-and
201 sb!kernel:two-arg-ior
202 sb!kernel:two-arg-xor
203 sb!kernel:two-arg-gcd
204 sb!kernel:two-arg-lcm))
207 ;;;; Assembler parameters:
209 ;;; The number of bits per element in the assemblers code vector.
211 (defparameter *assembly-unit-length* 8)