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