2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[Constants]{Info about this compilation}
8 mAX_CONTEXT_REDUCTION_DEPTH,
14 mAX_SPEC_SELECTEE_SIZE,
18 mIN_SIZE_NonUpdHeapObject,
25 rESERVED_C_STACK_BYTES,
34 mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
54 mAX_INTLIKE, mIN_INTLIKE,
55 mAX_CHARLIKE, mIN_CHARLIKE,
72 -- This magical #include brings in all the everybody-knows-these magic
73 -- constants unfortunately, we need to be *explicit* about which one
74 -- we want; if we just hope a -I... will get the right one, we could
77 #include "HsVersions.h"
78 #include "../includes/config.h"
79 #include "../includes/MachRegs.h"
80 #include "../includes/Constants.h"
81 #include "../includes/MachDeps.h"
82 #include "../includes/DerivedConstants.h"
90 mAX_TUPLE_SIZE = (62 :: Int) -- Should really match the number
91 -- of decls in Data.Tuple
92 mAX_CONTEXT_REDUCTION_DEPTH = (20 :: Int)
97 -- specialised fun/thunk/constr closure types
98 mAX_SPEC_THUNK_SIZE = (MAX_SPEC_THUNK_SIZE :: Int)
99 mAX_SPEC_FUN_SIZE = (MAX_SPEC_FUN_SIZE :: Int)
100 mAX_SPEC_CONSTR_SIZE = (MAX_SPEC_CONSTR_SIZE :: Int)
102 -- pre-compiled thunk types
103 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
104 mAX_SPEC_AP_SIZE = (MAX_SPEC_AP_SIZE :: Int)
106 -- closure sizes: these do NOT include the header (see below for header sizes)
107 mIN_UPD_SIZE = (MIN_UPD_SIZE::Int)
108 mIN_SIZE_NonUpdHeapObject = (MIN_NONUPD_SIZE::Int)
111 Constants for semi-tagging; the tags associated with the data
112 constructors will start at 0 and go up.
115 oTHER_TAG = (INFO_OTHER_TAG :: Integer) -- (-1) unevaluated, probably
119 mIN_INTLIKE, mAX_INTLIKE :: Integer -- Only used to compare with (MachInt Integer)
120 mIN_INTLIKE = MIN_INTLIKE
121 mAX_INTLIKE = MAX_INTLIKE
123 mIN_CHARLIKE, mAX_CHARLIKE :: Int -- Only used to compare with (MachChar Int)
124 mIN_CHARLIKE = MIN_CHARLIKE
125 mAX_CHARLIKE = MAX_CHARLIKE
128 A little function that abstracts the stack direction. Note that most
129 of the code generator is dependent on the stack direction anyway, so
130 changing this on its own spells certain doom. ToDo: remove?
133 -- THIS IS DIRECTION SENSITIVE!
135 -- stack grows down, positive virtual offsets correspond to negative
136 -- additions to the stack pointer.
138 spRelToInt :: Int{-VirtualSpOffset-} -> Int{-VirtualSpOffset-} -> Int
139 spRelToInt sp off = sp - off
142 A section of code-generator-related MAGIC CONSTANTS.
145 mAX_FAMILY_SIZE_FOR_VEC_RETURNS = (MAX_VECTORED_RTN::Int) -- pretty arbitrary
146 -- If you change this, you may need to change runtimes/standard/Update.lhc
148 -- The update frame sizes
149 uF_SIZE = (STD_UF_SIZE::Int)
151 -- Same again, with profiling
152 pROF_UF_SIZE = (PROF_UF_SIZE::Int)
154 -- Same again, with gransim
155 gRAN_UF_SIZE = (GRAN_UF_SIZE::Int)
157 -- Offsets in an update frame. They don't change with profiling!
158 uF_RET = (UF_RET::Int)
159 uF_UPDATEE = (UF_UPDATEE::Int)
163 mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
164 mAX_Float_REG = (MAX_FLOAT_REG :: Int)
165 mAX_Double_REG = (MAX_DOUBLE_REG :: Int)
166 mAX_Long_REG = (MAX_LONG_REG :: Int)
168 mAX_Real_Vanilla_REG = (MAX_REAL_VANILLA_REG :: Int)
169 mAX_Real_Float_REG = (MAX_REAL_FLOAT_REG :: Int)
170 mAX_Real_Double_REG = (MAX_REAL_DOUBLE_REG :: Int)
171 #ifdef MAX_REAL_LONG_REG
172 mAX_Real_Long_REG = (MAX_REAL_LONG_REG :: Int)
174 mAX_Real_Long_REG = (0::Int)
178 Closure header sizes.
181 sTD_HDR_SIZE = (STD_HDR_SIZE :: Int)
182 pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int)
183 gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int)
184 aRR_WORDS_HDR_SIZE = (ARR_WORDS_HDR_SIZE :: Int)
185 aRR_PTRS_HDR_SIZE = (ARR_PTRS_HDR_SIZE :: Int)
191 sTD_ITBL_SIZE = (STD_ITBL_SIZE :: Int)
192 rET_ITBL_SIZE = (RET_ITBL_SIZE :: Int)
193 pROF_ITBL_SIZE = (PROF_ITBL_SIZE :: Int)
194 gRAN_ITBL_SIZE = (GRAN_ITBL_SIZE :: Int)
195 tICKY_ITBL_SIZE = (TICKY_ITBL_SIZE :: Int)
198 Size of a double in StgWords.
201 dOUBLE_SIZE = (SIZEOF_DOUBLE `quot` SIZEOF_HSWORD :: Int)
202 wORD64_SIZE = (8 `quot` SIZEOF_HSWORD :: Int)
203 iNT64_SIZE = wORD64_SIZE
206 This tells the native code generator the size of the spill
207 area is has available.
210 rESERVED_C_STACK_BYTES = (RESERVED_C_STACK_BYTES :: Int)
213 The amount of (Haskell) stack to leave free for saving registers when
214 returning to the scheduler.
217 rESERVED_STACK_WORDS = (RESERVED_STACK_WORDS :: Int)
220 Size of a word, in bytes
223 wORD_SIZE = (SIZEOF_HSWORD :: Int)
224 wORD_SIZE_IN_BITS = wORD_SIZE * 8 :: Int
227 Size of a storage manager block (in bytes).
230 bLOCK_SIZE = (BLOCK_SIZE :: Int)
231 bLOCK_SIZE_W = (bLOCK_SIZE `div` wORD_SIZE :: Int)
234 Number of bits to shift a bitfield left by in an info table.
237 bITMAP_BITS_SHIFT = (BITMAP_BITS_SHIFT :: Int)