0.9.1.51:
[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 ;;; Where to put the different spaces.
61 ;;; 
62 (def!constant read-only-space-start #x01000000)
63 (def!constant read-only-space-end   #x05000000)
64
65 (def!constant static-space-start    #x06000000)
66 (def!constant static-space-end      #x08000000)
67
68 (def!constant dynamic-0-space-start #x08000000)
69 (def!constant dynamic-0-space-end   #x0c000000)
70 (def!constant dynamic-1-space-start #x0c000000)
71 (def!constant dynamic-1-space-end   #x10000000)
72
73 \f
74 ;;;; Other non-type constants.
75
76 (defenum (:suffix -flag)
77   atomic
78   interrupted)
79
80 (defenum (:suffix -trap :start 8)
81   halt
82   pending-interrupt
83   error
84   cerror
85   breakpoint
86   fun-end-breakpoint
87   after-breakpoint)
88
89 (defenum (:prefix trace-table-)
90   normal
91   call-site
92   fun-prologue
93   fun-epilogue)
94 \f
95 ;;;; Static symbols.
96
97 ;;; Static symbols are loaded into static space directly after NIL so
98 ;;; that the system can compute their address by adding a constant
99 ;;; amount to NIL.
100 ;;;
101 ;;; The fdefn objects for the static functions are loaded into static
102 ;;; space directly after the static symbols.  That way, the raw-addr
103 ;;; can be loaded directly out of them by indirecting relative to NIL.
104 ;;;
105 (defparameter *static-symbols*
106   '(t
107
108     *posix-argv*
109
110     sb!impl::sub-gc
111     sb!kernel::internal-error
112     sb!kernel::control-stack-exhausted-error
113     sb!kernel::undefined-alien-variable-error
114     sb!kernel::undefined-alien-function-error
115     sb!di::handle-breakpoint
116     sb!impl::fdefinition-object
117
118     ;; Free Pointers
119     *read-only-space-free-pointer*
120     *static-space-free-pointer*
121     *initial-dynamic-space-free-pointer*
122
123     ;; Things needed for non-local-exit.
124     *current-catch-block*
125     *current-unwind-protect-block*
126
127     *binding-stack-start*
128     *control-stack-start*
129     *control-stack-end*
130     
131     ;; Interrupt Handling
132     *free-interrupt-context-index*
133     sb!unix::*interrupts-enabled*
134     sb!unix::*interrupt-pending*
135     ))
136
137 (defparameter *static-funs*
138   '(sb!kernel:two-arg-+ 
139     sb!kernel:two-arg-- 
140     sb!kernel:two-arg-* 
141     sb!kernel:two-arg-/ 
142     sb!kernel:two-arg-< 
143     sb!kernel:two-arg-> 
144     sb!kernel:two-arg-=
145     sb!kernel:two-arg-<= 
146     sb!kernel:two-arg->= 
147     sb!kernel:two-arg-/= 
148     eql 
149     sb!kernel:%negate
150     sb!kernel:two-arg-and 
151     sb!kernel:two-arg-ior 
152     sb!kernel:two-arg-xor
153     length 
154     sb!kernel:two-arg-gcd 
155     sb!kernel:two-arg-lcm))