0.9.4.65:
[sbcl.git] / src / compiler / mips / parms.lisp
1 (in-package "SB!VM")
2
3 ;;; number of bits per word where a word holds one lisp descriptor
4 (def!constant n-word-bits 32)
5
6 ;;; the natural width of a machine word (as seen in e.g. register width,
7 ;;; address space)
8 (def!constant n-machine-word-bits 32)
9
10 ;;; number of bits per byte where a byte is the smallest addressable
11 ;;; object
12 (def!constant n-byte-bits 8)
13
14
15 (def!constant float-sign-shift 31)
16
17 (def!constant single-float-bias 126)
18 (defconstant-eqx single-float-exponent-byte (byte 8 23) #'equalp)
19 (defconstant-eqx single-float-significand-byte (byte 23 0) #'equalp)
20 (def!constant single-float-normal-exponent-min 1)
21 (def!constant single-float-normal-exponent-max 254)
22 (def!constant single-float-hidden-bit (ash 1 23))
23 (def!constant single-float-trapping-nan-bit (ash 1 22))
24
25 (def!constant double-float-bias 1022)
26 (defconstant-eqx double-float-exponent-byte (byte 11 20) #'equalp)
27 (defconstant-eqx double-float-significand-byte (byte 20 0) #'equalp)
28 (def!constant double-float-normal-exponent-min 1)
29 (def!constant double-float-normal-exponent-max #x7FE)
30 (def!constant double-float-hidden-bit (ash 1 20))
31 (def!constant double-float-trapping-nan-bit (ash 1 19))
32
33 (def!constant single-float-digits
34   (+ (byte-size single-float-significand-byte) 1))
35
36 (def!constant double-float-digits
37   (+ (byte-size double-float-significand-byte) n-word-bits 1))
38
39 (def!constant float-inexact-trap-bit (ash 1 0))
40 (def!constant float-underflow-trap-bit (ash 1 1))
41 (def!constant float-overflow-trap-bit (ash 1 2))
42 (def!constant float-divide-by-zero-trap-bit (ash 1 3))
43 (def!constant float-invalid-trap-bit (ash 1 4))
44
45 (def!constant float-round-to-nearest 0)
46 (def!constant float-round-to-zero 1)
47 (def!constant float-round-to-positive 2)
48 (def!constant float-round-to-negative 3)
49
50 (defconstant-eqx float-rounding-mode (byte 2 0) #'equalp)
51 (defconstant-eqx float-sticky-bits (byte 5 2) #'equalp)
52 (defconstant-eqx float-traps-byte (byte 5 7) #'equalp)
53 (defconstant-eqx float-exceptions-byte (byte 5 12) #'equalp)
54 (defconstant-eqx float-condition-bit (ash 1 23) #'equalp)
55 (def!constant float-fast-bit 0)                   ; No fast mode on PMAX.
56
57 \f
58 ;;;; Description of the target address space.
59
60 #!+irix
61 (progn
62   ;; Where to put the different spaces.
63   ;; Old definitions, might be still relevant for an IRIX port.
64   ;;
65   (def!constant read-only-space-start #x01000000)
66   (def!constant read-only-space-end   #x05000000)
67
68   (def!constant static-space-start    #x06000000)
69   (def!constant static-space-end      #x08000000)
70
71   (def!constant dynamic-0-space-start #x08000000)
72   (def!constant dynamic-0-space-end   #x0c000000)
73   (def!constant dynamic-1-space-start #x0c000000)
74   (def!constant dynamic-1-space-end   #x10000000))
75
76 #!+linux
77 (progn
78   ;; Where to put the address spaces on Linux.
79   ;;
80   ;; C runtime executable segment starts at 0x00400000
81   (def!constant read-only-space-start #x01000000)
82   (def!constant read-only-space-end   #x08000000)
83
84   (def!constant static-space-start    #x08000000)
85   (def!constant static-space-end      #x10000000)
86   ;; C runtime read/write segment starts at 0x10000000, heap and DSOs
87   ;; start at 0x2a000000
88   (def!constant dynamic-0-space-start #x30000000)
89   (def!constant dynamic-0-space-end   #x50000000)
90   (def!constant dynamic-1-space-start #x50000000)
91   (def!constant dynamic-1-space-end   #x70000000)
92   ;; C stack grows downward from 0x80000000
93   )
94
95
96 \f
97 ;;;; Other non-type constants.
98
99 (defenum (:suffix -flag)
100   atomic
101   interrupted)
102
103 (defenum (:suffix -trap :start 8)
104   halt
105   pending-interrupt
106   error
107   cerror
108   breakpoint
109   fun-end-breakpoint
110   after-breakpoint
111   unused
112   pseudo-atomic
113   object-not-list
114   object-not-instance)
115
116 (defenum (:prefix trace-table-)
117   normal
118   call-site
119   fun-prologue
120   fun-epilogue)
121 \f
122 ;;;; Static symbols.
123
124 ;;; Static symbols are loaded into static space directly after NIL so
125 ;;; that the system can compute their address by adding a constant
126 ;;; amount to NIL.
127 ;;;
128 ;;; The fdefn objects for the static functions are loaded into static
129 ;;; space directly after the static symbols.  That way, the raw-addr
130 ;;; can be loaded directly out of them by indirecting relative to NIL.
131 ;;;
132 (defparameter *static-symbols*
133   '(t
134
135     *posix-argv*
136
137     sb!impl::sub-gc
138     sb!kernel::internal-error
139     sb!kernel::control-stack-exhausted-error
140     sb!kernel::undefined-alien-variable-error
141     sb!kernel::undefined-alien-function-error
142     sb!di::handle-breakpoint
143     sb!impl::fdefinition-object
144
145     ;; Free Pointers
146     *read-only-space-free-pointer*
147     *static-space-free-pointer*
148     *initial-dynamic-space-free-pointer*
149
150     ;; Things needed for non-local-exit.
151     *current-catch-block*
152     *current-unwind-protect-block*
153
154     *binding-stack-start*
155     *control-stack-start*
156     *control-stack-end*
157
158     ;; Interrupt Handling
159     *free-interrupt-context-index*
160     sb!unix::*interrupts-enabled*
161     sb!unix::*interrupt-pending*
162     *gc-inhibit*
163     *gc-pending*))
164
165 (defparameter *static-funs*
166   '(sb!kernel:two-arg-+
167     sb!kernel:two-arg--
168     sb!kernel:two-arg-*
169     sb!kernel:two-arg-/
170     sb!kernel:two-arg-<
171     sb!kernel:two-arg->
172     sb!kernel:two-arg-=
173     sb!kernel:two-arg-<=
174     sb!kernel:two-arg->=
175     sb!kernel:two-arg-/=
176     eql
177     sb!kernel:%negate
178     sb!kernel:two-arg-and
179     sb!kernel:two-arg-ior
180     sb!kernel:two-arg-xor
181     length
182     sb!kernel:two-arg-gcd
183     sb!kernel:two-arg-lcm))