8cec2ba2032baad90889269a2f6f748de0fae8b2
[sbcl.git] / src / compiler / hppa / parms.lisp
1 (in-package "SB!VM")
2 \f
3 ;;;; Machine Architecture parameters:
4 (eval-when (:compile-toplevel :load-toplevel :execute)
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) #'equalp)
21 (defconstant-eqx single-float-significand-byte (byte 23 0) #'equalp)
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) #'equalp)
29 (defconstant-eqx double-float-significand-byte (byte 20 0) #'equalp)
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) #'equalp)
53 (defconstant-eqx float-sticky-bits (byte 5 27) #'equalp)
54 (defconstant-eqx float-traps-byte (byte 5 0) #'equalp)
55 (defconstant-eqx float-exceptions-byte (byte 5 27) #'equalp)
56 (defconstant-eqx float-condition-bit (ash 1 26) #'equalp)
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 #x4b000000)
66 (def!constant read-only-space-end   #x4dff0000)
67
68 (def!constant static-space-start    #x4e000000)
69 (def!constant static-space-end      #x4fff0000)
70
71 (def!constant dynamic-0-space-start   #x50000000)
72 (def!constant dynamic-0-space-end     #x54000000)
73 (def!constant dynamic-1-space-start   #x60000000)
74 (def!constant dynamic-1-space-end     #x64000000)
75
76 ); eval-when
77
78 ;;; When doing external branching on hppa (e.g. inst ble)
79 ;;; we must know which space we want to jump into (text, code)
80
81 ;; The space-register holding the lisp heap.
82 (def!constant lisp-heap-space 5)
83
84 ;; The space-register holding the C text heap.
85 (def!constant c-text-space 4)
86
87 \f
88 ;;;; Other random constants.
89
90 (defenum (:suffix -flag)
91   atomic
92   interrupted)
93
94 (defenum (:suffix -trap :start 8)
95   halt
96   pending-interrupt
97   error
98   cerror
99   breakpoint
100   fun-end-breakpoint
101   single-step-breakpoint
102   single-step-around
103   single-step-before
104   single-step-after)
105
106 (defenum (:prefix trace-table-)
107   normal
108   call-site
109   fun-prologue
110   fun-epilogue)
111
112
113 \f
114 ;;;; Static symbols.
115
116 ;;; These symbols are loaded into static space directly after NIL so
117 ;;; that the system can compute their address by adding a constant
118 ;;; amount to NIL.
119 ;;;
120 ;;; The fdefn objects for the static functions are loaded into static
121 ;;; space directly after the static symbols.  That way, the raw-addr
122 ;;; can be loaded directly out of them by indirecting relative to NIL.
123 (defparameter *static-symbols*
124   (append
125    *common-static-symbols*
126    *c-callable-static-symbols*
127    '()))
128
129 (defparameter *static-funs*
130   '(length
131     sb!kernel:two-arg-+
132     sb!kernel:two-arg--
133     sb!kernel:two-arg-*
134     sb!kernel:two-arg-/
135     sb!kernel:two-arg-<
136     sb!kernel:two-arg->
137     sb!kernel:two-arg-=
138     sb!kernel:two-arg-<=
139     sb!kernel:two-arg->=
140     sb!kernel:two-arg-/=
141     eql
142     sb!kernel:%negate
143     sb!kernel:two-arg-and
144     sb!kernel:two-arg-ior
145     sb!kernel:two-arg-xor
146     sb!kernel:two-arg-gcd
147     sb!kernel:two-arg-lcm))
148