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