2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[Constants]{Info about this compilation}
8 uNFOLDING_USE_THRESHOLD,
9 uNFOLDING_CREATION_THRESHOLD,
10 iNTERFACE_UNFOLD_THRESHOLD,
11 lIBERATE_CASE_THRESHOLD,
12 uNFOLDING_CHEAP_OP_COST,
13 uNFOLDING_DEAR_OP_COST,
14 uNFOLDING_NOREP_LIT_COST,
15 uNFOLDING_CON_DISCOUNT_WEIGHT,
16 uNFOLDING_KEENESS_FACTOR,
18 mAX_CONTEXT_REDUCTION_DEPTH,
24 mAX_SPEC_SELECTEE_SIZE,
27 tARGET_MIN_INT, tARGET_MAX_INT,
30 mIN_SIZE_NonUpdHeapObject,
43 mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
67 mAX_INTLIKE, mIN_INTLIKE,
75 interfaceFileFormatVersion
79 -- This magical #include brings in all the everybody-knows-these magic
80 -- constants unfortunately, we need to be *explicit* about which one
81 -- we want; if we just hope a -I... will get the right one, we could
84 #include "HsVersions.h"
85 #include "../includes/config.h"
86 #include "../includes/MachRegs.h"
87 #include "../includes/Constants.h"
95 mAX_TUPLE_SIZE = (37 :: Int)
96 mAX_CONTEXT_REDUCTION_DEPTH = (20 :: Int)
100 uNFOLDING_USE_THRESHOLD = ( 8 :: Int)
101 uNFOLDING_CREATION_THRESHOLD = (30 :: Int) -- Discounts can be big
102 iNTERFACE_UNFOLD_THRESHOLD = (30 :: Int)
103 lIBERATE_CASE_THRESHOLD = (10 :: Int)
105 uNFOLDING_CHEAP_OP_COST = ( 1 :: Int)
106 uNFOLDING_DEAR_OP_COST = ( 4 :: Int)
107 uNFOLDING_NOREP_LIT_COST = ( 20 :: Int) -- Strings can be pretty big
108 uNFOLDING_CON_DISCOUNT_WEIGHT = ( 3 :: Int)
109 uNFOLDING_KEENESS_FACTOR = ( 2.0 :: Float)
114 -- specialised fun/thunk/constr closure types
115 mAX_SPEC_THUNK_SIZE = (MAX_SPEC_THUNK_SIZE :: Int)
116 mAX_SPEC_FUN_SIZE = (MAX_SPEC_FUN_SIZE :: Int)
117 mAX_SPEC_CONSTR_SIZE = (MAX_SPEC_CONSTR_SIZE :: Int)
119 -- pre-compiled thunk types
120 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
121 mAX_SPEC_AP_SIZE = (MAX_SPEC_AP_SIZE :: Int)
123 -- closure sizes: these do NOT include the header (see below for header sizes)
124 mIN_UPD_SIZE = (MIN_UPD_SIZE::Int)
125 mIN_SIZE_NonUpdHeapObject = (MIN_NONUPD_SIZE::Int)
128 If we're compiling with GHC (and we're not cross-compiling), then we
129 know that minBound and maxBound :: Int are the right values for the
130 target architecture. Otherwise, we assume -2^31 and 2^31-1
131 respectively (which will be wrong on a 64-bit machine).
134 tARGET_MIN_INT, tARGET_MAX_INT :: Integer
135 #if __GLASGOW_HASKELL__
136 tARGET_MIN_INT = toInteger (minBound :: Int)
137 tARGET_MAX_INT = toInteger (maxBound :: Int)
139 tARGET_MIN_INT = -2147483648
140 tARGET_MAX_INT = 2147483647
144 Constants for semi-tagging; the tags associated with the data
145 constructors will start at 0 and go up.
148 oTHER_TAG = (INFO_OTHER_TAG :: Integer) -- (-1) unevaluated, probably
152 mIN_INTLIKE, mAX_INTLIKE :: Integer -- Only used to compare with (MachInt Integer)
153 mIN_INTLIKE = MIN_INTLIKE
154 mAX_INTLIKE = MAX_INTLIKE
157 A little function that abstracts the stack direction. Note that most
158 of the code generator is dependent on the stack direction anyway, so
159 changing this on its own spells certain doom. ToDo: remove?
162 -- THIS IS DIRECTION SENSITIVE!
164 -- stack grows down, positive virtual offsets correspond to negative
165 -- additions to the stack pointer.
167 spRelToInt :: Int{-VirtualSpOffset-} -> Int{-VirtualSpOffset-} -> Int
168 spRelToInt sp off = sp - off
171 A section of code-generator-related MAGIC CONSTANTS.
174 mAX_FAMILY_SIZE_FOR_VEC_RETURNS = (MAX_VECTORED_RTN::Int) -- pretty arbitrary
175 -- If you change this, you may need to change runtimes/standard/Update.lhc
177 -- The update frame sizes
178 uF_SIZE = (NOSCC_UF_SIZE::Int)
180 -- Same again, with profiling
181 sCC_UF_SIZE = (SCC_UF_SIZE::Int)
183 -- Offsets in an update frame. They don't change with profiling!
184 uF_RET = (UF_RET::Int)
186 uF_UPDATEE = (UF_UPDATEE::Int)
187 uF_CCS = (UF_CCS::Int)
193 sEQ_FRAME_SIZE = (NOSCC_SEQ_FRAME_SIZE::Int)
194 sCC_SEQ_FRAME_SIZE = (SCC_SEQ_FRAME_SIZE::Int)
198 mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
199 mAX_Float_REG = (MAX_FLOAT_REG :: Int)
200 mAX_Double_REG = (MAX_DOUBLE_REG :: Int)
201 mAX_Long_REG = (MAX_LONG_REG :: Int)
203 mAX_Real_Vanilla_REG = (MAX_REAL_VANILLA_REG :: Int)
204 mAX_Real_Float_REG = (MAX_REAL_FLOAT_REG :: Int)
205 mAX_Real_Double_REG = (MAX_REAL_DOUBLE_REG :: Int)
206 #ifdef MAX_REAL_LONG_REG
207 mAX_Real_Long_REG = (MAX_REAL_LONG_REG :: Int)
209 mAX_Real_Long_REG = (0::Int)
213 Closure header sizes.
216 sTD_HDR_SIZE = (STD_HDR_SIZE :: Int)
217 pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int)
218 gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int)
219 tICKY_HDR_SIZE = (TICKY_HDR_SIZE :: Int)
220 aRR_HDR_SIZE = (ARR_HDR_SIZE :: Int)
226 sTD_ITBL_SIZE = (STD_ITBL_SIZE :: Int)
227 pROF_ITBL_SIZE = (PROF_ITBL_SIZE :: Int)
228 gRAN_ITBL_SIZE = (GRAN_ITBL_SIZE :: Int)
229 tICKY_ITBL_SIZE = (TICKY_ITBL_SIZE :: Int)
232 Size of a double in StgWords.
235 dOUBLE_SIZE = (DOUBLE_SIZE :: Int)
236 wORD64_SIZE = (WORD64_SIZE :: Int)
237 iNT64_SIZE = (INT64_SIZE :: Int)
240 The version of the interface file format we're
244 interfaceFileFormatVersion :: Int
245 interfaceFileFormatVersion = HscIfaceFileVersion