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,
21 mAX_SPEC_SELECTEE_SIZE,
24 tARGET_MIN_INT, tARGET_MAX_INT,
27 mIN_SIZE_NonUpdHeapObject,
40 mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
62 mAX_INTLIKE, mIN_INTLIKE,
70 interfaceFileFormatVersion
74 -- This magical #include brings in all the everybody-knows-these magic
75 -- constants unfortunately, we need to be *explicit* about which one
76 -- we want; if we just hope a -I... will get the right one, we could
79 #include "HsVersions.h"
80 #include "../includes/config.h"
81 #include "../includes/MachRegs.h"
82 #include "../includes/Constants.h"
91 mAX_CONTEXT_REDUCTION_DEPTH = 20
95 uNFOLDING_USE_THRESHOLD = ( 8 :: Int)
96 uNFOLDING_CREATION_THRESHOLD = (30 :: Int) -- Discounts can be big
97 iNTERFACE_UNFOLD_THRESHOLD = (30 :: Int)
98 lIBERATE_CASE_THRESHOLD = (10 :: Int)
100 uNFOLDING_CHEAP_OP_COST = ( 1 :: Int)
101 uNFOLDING_DEAR_OP_COST = ( 4 :: Int)
102 uNFOLDING_NOREP_LIT_COST = ( 20 :: Int) -- Strings can be pretty big
103 uNFOLDING_CON_DISCOUNT_WEIGHT = ( 3 :: Int)
104 uNFOLDING_KEENESS_FACTOR = ( 2.0 :: Float)
109 -- pre-compiled thunk types
110 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
111 mAX_SPEC_AP_SIZE = (MAX_SPEC_AP_SIZE :: Int)
113 -- closure sizes: these do NOT include the header (see below for header sizes)
114 mIN_UPD_SIZE = (MIN_UPD_SIZE::Int)
115 mIN_SIZE_NonUpdHeapObject = (MIN_NONUPD_SIZE::Int)
119 tARGET_MIN_INT, tARGET_MAX_INT :: Integer
120 tARGET_MIN_INT = -536870912
121 tARGET_MAX_INT = 536870912
124 Constants for semi-tagging; the tags associated with the data
125 constructors will start at 0 and go up.
128 oTHER_TAG = (INFO_OTHER_TAG :: Integer) -- (-1) unevaluated, probably
132 mIN_INTLIKE, mAX_INTLIKE :: Integer -- Only used to compare with (MachInt Integer)
133 mIN_INTLIKE = MIN_INTLIKE
134 mAX_INTLIKE = MAX_INTLIKE
137 A little function that abstracts the stack direction. Note that most
138 of the code generator is dependent on the stack direction anyway, so
139 changing this on its own spells certain doom. ToDo: remove?
142 -- THIS IS DIRECTION SENSITIVE!
144 -- stack grows down, positive virtual offsets correspond to negative
145 -- additions to the stack pointer.
147 spRelToInt :: Int{-VirtualSpOffset-} -> Int{-VirtualSpOffset-} -> Int
148 spRelToInt sp off = sp - off
151 A section of code-generator-related MAGIC CONSTANTS.
154 mAX_FAMILY_SIZE_FOR_VEC_RETURNS = (MAX_VECTORED_RTN::Int) -- pretty arbitrary
155 -- If you change this, you may need to change runtimes/standard/Update.lhc
157 -- The update frame sizes
158 uF_SIZE = (NOSCC_UF_SIZE::Int)
160 -- Same again, with profiling
161 sCC_UF_SIZE = (SCC_UF_SIZE::Int)
163 -- Offsets in an update frame. They don't change with profiling!
164 uF_RET = (UF_RET::Int)
166 uF_UPDATEE = (UF_UPDATEE::Int)
167 uF_CCS = (UF_CCS::Int)
171 sEQ_FRAME_SIZE = (SEQ_FRAME_SIZE::Int)
175 mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
176 mAX_Float_REG = (MAX_FLOAT_REG :: Int)
177 mAX_Double_REG = (MAX_DOUBLE_REG :: Int)
179 mAX_Real_Vanilla_REG = (MAX_REAL_VANILLA_REG :: Int)
180 mAX_Real_Float_REG = (MAX_REAL_FLOAT_REG :: Int)
181 mAX_Real_Double_REG = (MAX_REAL_DOUBLE_REG :: Int)
184 Closure header sizes.
187 sTD_HDR_SIZE = (STD_HDR_SIZE :: Int)
188 pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int)
189 gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int)
190 tICKY_HDR_SIZE = (TICKY_HDR_SIZE :: Int)
191 aRR_HDR_SIZE = (ARR_HDR_SIZE :: Int)
197 sTD_ITBL_SIZE = (STD_ITBL_SIZE :: Int)
198 pROF_ITBL_SIZE = (PROF_ITBL_SIZE :: Int)
199 gRAN_ITBL_SIZE = (GRAN_ITBL_SIZE :: Int)
200 tICKY_ITBL_SIZE = (TICKY_ITBL_SIZE :: Int)
203 Size of a double in StgWords.
206 dOUBLE_SIZE = (DOUBLE_SIZE :: Int)
207 mAX_Long_REG = (MAX_LONG_REG :: Int)
208 wORD64_SIZE = (WORD64_SIZE :: Int)
209 iNT64_SIZE = (INT64_SIZE :: Int)
212 The version of the interface file format we're
216 interfaceFileFormatVersion = HscIfaceFileVersion