0.7.8.7:
[sbcl.git] / src / compiler / hppa / parms.lisp
1 (in-package "SB!VM")
2
3 \f
4 ;;;; Machine Architecture parameters:
5
6 (def!constant n-word-bits 32
7   "Number of bits per word where a word holds one lisp descriptor.")
8
9 (def!constant n-byte-bits 8
10   "Number of bits per byte where a byte is the smallest addressable object.")
11
12 (def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
13   "Number of bits to shift between word addresses and byte addresses.")
14
15 (def!constant n-word-bytes (/ n-word-bits n-byte-bits)
16   "Number of bytes in a word.")
17
18 (def!constant float-sign-shift 31)
19
20 (def!constant single-float-bias 126)
21 (defconstant-eqx single-float-exponent-byte (byte 8 23) #'equal)
22 (defconstant-eqx single-float-significand-byte (byte 23 0) #'equal)
23 (def!constant single-float-normal-exponent-min 1)
24 (def!constant single-float-normal-exponent-max 254)
25 (def!constant single-float-hidden-bit (ash 1 23))
26 (def!constant single-float-trapping-nan-bit (ash 1 22))
27
28 (def!constant double-float-bias 1022)
29 (defconstant-eqx double-float-exponent-byte (byte 11 20) #'equal)
30 (defconstant-eqx double-float-significand-byte (byte 20 0) #'equal)
31 (def!constant double-float-normal-exponent-min 1)
32 (def!constant double-float-normal-exponent-max #x7FE)
33 (def!constant double-float-hidden-bit (ash 1 20))
34 (def!constant double-float-trapping-nan-bit (ash 1 19))
35
36 (def!constant single-float-digits
37   (+ (byte-size single-float-significand-byte) 1))
38
39 (def!constant double-float-digits
40   (+ (byte-size double-float-significand-byte) n-word-bits 1))
41
42 (def!constant float-inexact-trap-bit (ash 1 0))
43 (def!constant float-underflow-trap-bit (ash 1 1))
44 (def!constant float-overflow-trap-bit (ash 1 2))
45 (def!constant float-divide-by-zero-trap-bit (ash 1 3))
46 (def!constant float-invalid-trap-bit (ash 1 4))
47
48 (def!constant float-round-to-nearest 0)
49 (def!constant float-round-to-zero 1)
50 (def!constant float-round-to-positive 2)
51 (def!constant float-round-to-negative 3)
52
53 (defconstant-eqx float-rounding-mode (byte 2 7) #'equal)
54 (defconstant-eqx float-sticky-bits (byte 5 27) #'equal)
55 (defconstant-eqx float-traps-byte (byte 5 0) #'equal)
56 (defconstant-eqx float-exceptions-byte (byte 5 27) #'equal)
57 (def!constant float-condition-bit (ash 1 26))
58 (def!constant float-fast-bit 0)                   ; No fast mode on HPPA.
59
60
61 \f
62 ;;;; Description of the target address space.
63
64 ;;; Where to put the different spaces.
65 ;;; 
66 (def!constant read-only-space-start #x20000000)
67 (def!constant read-only-space-end   #x24000000)
68
69 (def!constant binding-stack-start   #x24000000)
70 (def!constant binding-stack-end     #x24ff0000)
71
72 (def!constant control-stack-start   #x25000000)
73 (def!constant control-stack-end     #x25ff0000)
74
75 (def!constant static-space-start    #x28000000)
76 (def!constant static-space-end      #x2a000000)
77
78 (def!constant dynamic-space-start   #x30000000)
79 (def!constant dynamic-space-end     #x37fff000)
80
81 (def!constant dynamic-0-space-start   #x30000000)
82 (def!constant dynamic-0-space-end     #x37fff000)
83 (def!constant dynamic-1-space-start   #x38000000)
84 (def!constant dynamic-1-space-end     #x3ffff000)
85
86 ;;; FIXME: WTF are these for?
87
88 ;; The space-register holding the lisp heap.
89 (def!constant lisp-heap-space 5)
90
91 ;; The space-register holding the C text segment.
92 (def!constant c-text-space 4)
93
94 \f
95 ;;;; Other random constants.
96
97 (defenum (:suffix -trap :start 8)
98   halt
99   pending-interrupt
100   error
101   cerror
102   breakpoint
103   fun-end-breakpoint
104   single-step-breakpoint)
105
106 (defenum (:prefix trace-table-)
107   normal
108   call-site
109   fun-prologue
110   fun-epilogue)
111
112
113 \f
114 ;;;; Static symbols.
115
116 ;;; These symbols are loaded into static space directly after NIL so
117 ;;; that the system can compute their address by adding a constant
118 ;;; amount to NIL.
119 ;;;
120 ;;; The fdefn objects for the static functions are loaded into static
121 ;;; space directly after the static symbols.  That way, the raw-addr
122 ;;; can be loaded directly out of them by indirecting relative to NIL.
123 ;;;
124 (defparameter *static-symbols*
125   '(t
126
127     ;; The C startup code must fill these in.
128     *posix-argv*
129     
130     ;; Functions that the C code needs to call
131     sb!impl::maybe-gc
132     sb!kernel::internal-error
133     sb!kernel::control-stack-exhausted-error
134     sb!di::handle-breakpoint
135     sb!impl::fdefinition-object
136
137     ;; Free Pointers.
138     *read-only-space-free-pointer*
139     *static-space-free-pointer*
140     *initial-dynamic-space-free-pointer*
141
142     ;; Things needed for non-local-exit.
143     *current-catch-block*
144     *current-unwind-protect-block*
145     
146     ;; Interrupt Handling
147     *free-interrupt-context-index*
148     sb!unix::*interrupts-enabled*
149     sb!unix::*interrupt-pending*
150     ))
151
152 (defparameter *static-funs*
153   '(length
154     sb!kernel:two-arg-+
155     sb!kernel:two-arg--
156     sb!kernel:two-arg-*
157     sb!kernel:two-arg-/
158     sb!kernel:two-arg-<
159     sb!kernel:two-arg->
160     sb!kernel:two-arg-=
161     eql
162     sb!kernel:%negate
163     sb!kernel:two-arg-and
164     sb!kernel:two-arg-ior
165     sb!kernel:two-arg-xor
166     sb!kernel:two-arg-gcd
167     sb!kernel:two-arg-lcm
168     ))