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