2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
4 \section[Constants]{Info about this compilation}
6 !!!!! THIS CODE MUST AGREE WITH SMinterface.h !!!!!!
8 *** This SHOULD BE the only module that is CPP'd with "stgdefs.h" stuff.
11 #include "HsVersions.h"
14 uNFOLDING_USE_THRESHOLD,
15 uNFOLDING_CREATION_THRESHOLD,
16 iNTERFACE_UNFOLD_THRESHOLD,
17 lIBERATE_CASE_THRESHOLD,
18 uNFOLDING_CHEAP_OP_COST,
19 uNFOLDING_DEAR_OP_COST,
20 uNFOLDING_NOREP_LIT_COST,
21 uNFOLDING_CON_DISCOUNT_WEIGHT,
22 uNFOLDING_KEENESS_FACTOR,
26 mAX_SPEC_MIXED_FIELDS,
27 mAX_SPEC_SELECTEE_SIZE,
29 tARGET_MIN_INT, tARGET_MAX_INT,
32 mIN_SIZE_NonUpdHeapObject,
33 mIN_SIZE_NonUpdStaticHeapObject,
35 mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
37 sTD_UF_SIZE, cON_UF_SIZE,
38 sCC_STD_UF_SIZE, sCC_CON_UF_SIZE,
52 oTHER_TAG, iND_TAG, -- semi-tagging stuff
63 mAX_INTLIKE, mIN_INTLIKE,
70 -- This magical #include brings in all the everybody-knows-these magic
71 -- constants unfortunately, we need to be *explicit* about which one
72 -- we want; if we just hope a -I... will get the right one, we could
75 #include "../../includes/GhcConstants.h"
77 CHK_Ubiq() -- debugging consistency check
84 uNFOLDING_USE_THRESHOLD = ( 3 :: Int)
85 uNFOLDING_CREATION_THRESHOLD = (30 :: Int) -- Discounts can be big
86 iNTERFACE_UNFOLD_THRESHOLD = (30 :: Int)
87 lIBERATE_CASE_THRESHOLD = (10 :: Int)
89 uNFOLDING_CHEAP_OP_COST = ( 1 :: Int)
90 uNFOLDING_DEAR_OP_COST = ( 4 :: Int)
91 uNFOLDING_NOREP_LIT_COST = ( 20 :: Int) -- Strings can be pretty big
92 uNFOLDING_CON_DISCOUNT_WEIGHT = ( 1 :: Int)
93 uNFOLDING_KEENESS_FACTOR = ( 2.0 :: Float)
97 mAX_SPEC_ALL_PTRS = (MAX_SPEC_ALL_PTRS :: Int)
98 mAX_SPEC_ALL_NONPTRS = (MAX_SPEC_ALL_NONPTRS :: Int)
99 mAX_SPEC_MIXED_FIELDS = (MAX_SPEC_OTHER_SIZE :: Int)
100 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
102 -- closure sizes: these do NOT include the header
103 mIN_UPD_SIZE = (MIN_UPD_SIZE::Int)
104 mIN_SIZE_NonUpdHeapObject = (MIN_NONUPD_SIZE::Int)
105 mIN_SIZE_NonUpdStaticHeapObject = (0::Int)
108 Sizes of gmp objects:
110 mIN_MP_INT_SIZE = (MIN_MP_INT_SIZE :: Int)
111 mP_STRUCT_SIZE = (MP_STRUCT_SIZE :: Int)
115 tARGET_MIN_INT, tARGET_MAX_INT :: Integer
116 tARGET_MIN_INT = -536870912
117 tARGET_MAX_INT = 536870912
120 Constants for semi-tagging; the tags associated with the data
121 constructors will start at 0 and go up.
123 oTHER_TAG = (INFO_OTHER_TAG :: Integer) -- (-1) unevaluated, probably
124 iND_TAG = (INFO_IND_TAG :: Integer) -- (-2) NOT USED, REALLY
127 Stuff for liveness masks:
129 lIVENESS_R1 = (LIVENESS_R1 :: Int)
130 lIVENESS_R2 = (LIVENESS_R2 :: Int)
131 lIVENESS_R3 = (LIVENESS_R3 :: Int)
132 lIVENESS_R4 = (LIVENESS_R4 :: Int)
133 lIVENESS_R5 = (LIVENESS_R5 :: Int)
134 lIVENESS_R6 = (LIVENESS_R6 :: Int)
135 lIVENESS_R7 = (LIVENESS_R7 :: Int)
136 lIVENESS_R8 = (LIVENESS_R8 :: Int)
140 mIN_INTLIKE, mAX_INTLIKE :: Integer -- Only used to compare with (MachInt Integer)
141 mIN_INTLIKE = MIN_INTLIKE
142 mAX_INTLIKE = MAX_INTLIKE
146 -- THESE ARE DIRECTION SENSITIVE!
147 spARelToInt :: Int{-VirtualSpAOffset-} -> Int{-VirtualSpAOffset-} -> Int
148 spBRelToInt :: Int{-VirtualSpBOffset-} -> Int{-VirtualSpBOffset-} -> Int
150 spARelToInt spA off = spA - off -- equiv to: AREL(spA - off)
151 spBRelToInt spB off = off - spB -- equiv to: BREL(spB - off)
154 A section of code-generator-related MAGIC CONSTANTS.
156 mAX_FAMILY_SIZE_FOR_VEC_RETURNS = (MAX_VECTORED_RTN::Int) -- pretty arbitrary
157 -- If you change this, you may need to change runtimes/standard/Update.lhc
159 -- The update frame sizes
160 sTD_UF_SIZE = (NOSCC_STD_UF_SIZE::Int)
161 cON_UF_SIZE = (NOSCC_CON_UF_SIZE::Int)
163 -- Same again, with profiling
164 sCC_STD_UF_SIZE = (SCC_STD_UF_SIZE::Int)
165 sCC_CON_UF_SIZE = (SCC_CON_UF_SIZE::Int)
167 -- Offsets in an update frame. They don't change with profiling!
168 uF_RET = (UF_RET::Int)
169 uF_SUB = (UF_SUB::Int)
170 uF_SUA = (UF_SUA::Int)
171 uF_UPDATEE = (UF_UPDATEE::Int)
172 uF_COST_CENTRE = (UF_COST_CENTRE::Int)
176 mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
177 mAX_Float_REG = (MAX_FLOAT_REG :: Int)
178 mAX_Double_REG = (MAX_DOUBLE_REG :: Int)