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