Merge PPC port
[sbcl/lichteblau.git] / src / compiler / ppc / parms.lisp
bloba8246fcc66c6cd64914ca950ac47f90796947a98
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.
6 (in-package "SB!VM")
8 (defconstant n-word-bits 32
9 "Number of bits per word where a word holds one lisp descriptor.")
11 (defconstant n-byte-bits 8
12 "Number of bits per byte where a byte is the smallest addressable object.")
14 (defconstant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
15 "Number of bits to shift between word addresses and byte addresses.")
17 (defconstant n-word-bytes (/ n-word-bits n-byte-bits)
18 "Number of bytes in a word.")
21 (defconstant float-sign-shift 31)
23 (defconstant single-float-bias 126)
24 (defconstant-eqx single-float-exponent-byte (byte 8 23) #'equalp)
25 (defconstant-eqx single-float-significand-byte (byte 23 0) #'equalp)
26 (defconstant single-float-normal-exponent-min 1)
27 (defconstant single-float-normal-exponent-max 254)
28 (defconstant single-float-hidden-bit (ash 1 23))
29 (defconstant single-float-trapping-nan-bit (ash 1 22))
31 (defconstant double-float-bias 1022)
32 (defconstant-eqx double-float-exponent-byte (byte 11 20) #'equalp)
33 (defconstant-eqx double-float-significand-byte (byte 20 0) #'equalp)
34 (defconstant double-float-normal-exponent-min 1)
35 (defconstant double-float-normal-exponent-max #x7FE)
36 (defconstant double-float-hidden-bit (ash 1 20))
37 (defconstant double-float-trapping-nan-bit (ash 1 19))
39 (defconstant single-float-digits
40 (+ (byte-size single-float-significand-byte) 1))
42 (defconstant double-float-digits
43 (+ (byte-size double-float-significand-byte) n-word-bits 1))
46 (defconstant float-inexact-trap-bit (ash 1 0))
47 (defconstant float-divide-by-zero-trap-bit (ash 1 1))
48 (defconstant float-underflow-trap-bit (ash 1 2))
49 (defconstant float-overflow-trap-bit (ash 1 3))
50 (defconstant float-invalid-trap-bit (ash 1 4))
52 (defconstant float-round-to-nearest 0)
53 (defconstant float-round-to-zero 1)
54 (defconstant float-round-to-positive 2)
55 (defconstant float-round-to-negative 3)
57 (defconstant-eqx float-rounding-mode (byte 2 0) #'equalp) ; RD
58 (defconstant-eqx float-sticky-bits (byte 10 19) #'equalp)
59 (defconstant-eqx float-traps-byte (byte 6 3) #'equalp)
60 (defconstant-eqx float-exceptions-byte (byte 5 0) #'equalp) ; cexc
62 (defconstant float-fast-bit 2) ; Non-IEEE mode
65 ;;; NUMBER-STACK-DISPLACEMENT
66 ;;;
67 ;;; The number of bytes reserved above the number stack pointer. These
68 ;;; slots are required by architecture, mostly (?) to make C backtrace
69 ;;; work.
70 ;;;
71 (defconstant number-stack-displacement
72 (* 2 sb!vm:n-word-bytes))
77 ;;; Where to put the different spaces.
78 ;;;
80 (defconstant read-only-space-start #x01000000)
81 (defconstant read-only-space-end #x04ff8000)
83 (defconstant binding-stack-start #x06000000)
84 (defconstant binding-stack-end #x06ff0000)
86 (defconstant control-stack-start #x07000000)
87 (defconstant control-stack-end #x07ff0000)
89 (defconstant static-space-start #x08000000)
90 (defconstant static-space-end #x097fff00)
92 ;;; FIXME: this is a gross violation of OAOO, done purely to support
93 ;;; the #define of DYNAMIC_SPACE_SIZE in validate.c -- CSR, 2002-02-25
94 ;;; (these numbers should match dynamic-0-*)
95 (defconstant dynamic-space-start #x40000000)
96 (defconstant dynamic-space-end #x47fff000)
98 ;;; nothing _seems_ to be using these addresses
99 (defconstant dynamic-0-space-start #x40000000)
100 (defconstant dynamic-0-space-end #x47fff000)
101 (defconstant dynamic-1-space-start #x48000000)
102 (defconstant dynamic-1-space-end #x4ffff000)
107 ;;;; Other random constants.
109 (defenum (:suffix -trap :start 8)
110 halt
111 pending-interrupt
112 error
113 cerror
114 breakpoint
115 fun-end-breakpoint
116 after-breakpoint
117 fixnum-additive-overflow)
119 (defenum (:prefix object-not- :suffix -trap :start 16)
120 list
121 instance)
123 (defenum (:prefix trace-table-)
124 normal
125 call-site
126 fun-prologue
127 fun-epilogue)
130 ;;;; Static symbols.
133 ;;; These symbols are loaded into static space directly after NIL so
134 ;;; that the system can compute their address by adding a constant
135 ;;; amount to NIL.
137 ;;; The fdefn objects for the static functions are loaded into static
138 ;;; space directly after the static symbols. That way, the raw-addr
139 ;;; can be loaded directly out of them by indirecting relative to NIL.
141 (defparameter *static-symbols*
144 ;; The C startup code must fill these in.
145 *posix-argv*
146 sb!impl::*initial-fdefn-objects*
148 ;; Functions that the C code needs to call
149 ;; sb!impl::%initial-fun
150 sb!impl::maybe-gc
151 sb!kernel::internal-error
152 sb!di::handle-breakpoint
153 sb!impl::fdefinition-object
155 ;; Free Pointers.
156 *read-only-space-free-pointer*
157 *static-space-free-pointer*
158 *initial-dynamic-space-free-pointer*
160 ;; Things needed for non-local-exit.
161 *current-catch-block*
162 *current-unwind-protect-block*
163 *eval-stack-top*
165 ;; Interrupt Handling
166 *free-interrupt-context-index*
167 sb!unix::*interrupts-enabled*
168 sb!unix::*interrupt-pending*
170 #|sb!kernel::*current-thread*|#
173 (defparameter *static-funs*
174 '(length
175 sb!kernel:two-arg-+
176 sb!kernel:two-arg--
177 sb!kernel:two-arg-*
178 sb!kernel:two-arg-/
179 sb!kernel:two-arg-<
180 sb!kernel:two-arg->
181 sb!kernel:two-arg-=
182 sb!kernel:two-arg-<=
183 sb!kernel:two-arg->=
184 sb!kernel:two-arg-/=
186 sb!kernel:%negate
187 sb!kernel:two-arg-and
188 sb!kernel:two-arg-ior
189 sb!kernel:two-arg-xor
190 sb!kernel:two-arg-gcd
191 sb!kernel:two-arg-lcm))
194 ;;;; Assembler parameters:
196 ;;; The number of bits per element in the assemblers code vector.
198 (defparameter *assembly-unit-length* 8)