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,
26 rESERVED_C_STACK_BYTES,
33 mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
45 gRAN_SEQ_FRAME_SIZE, -- HWL
59 mAX_INTLIKE, mIN_INTLIKE,
67 interfaceFileFormatVersion
71 -- This magical #include brings in all the everybody-knows-these magic
72 -- constants unfortunately, we need to be *explicit* about which one
73 -- we want; if we just hope a -I... will get the right one, we could
76 #include "HsVersions.h"
77 #include "../includes/config.h"
78 #include "../includes/MachRegs.h"
79 #include "../includes/Constants.h"
87 mAX_TUPLE_SIZE = (37 :: Int)
88 mAX_CONTEXT_REDUCTION_DEPTH = (20 :: Int)
93 -- specialised fun/thunk/constr closure types
94 mAX_SPEC_THUNK_SIZE = (MAX_SPEC_THUNK_SIZE :: Int)
95 mAX_SPEC_FUN_SIZE = (MAX_SPEC_FUN_SIZE :: Int)
96 mAX_SPEC_CONSTR_SIZE = (MAX_SPEC_CONSTR_SIZE :: Int)
98 -- pre-compiled thunk types
99 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
100 mAX_SPEC_AP_SIZE = (MAX_SPEC_AP_SIZE :: Int)
102 -- closure sizes: these do NOT include the header (see below for header sizes)
103 mIN_UPD_SIZE = (MIN_UPD_SIZE::Int)
104 mIN_SIZE_NonUpdHeapObject = (MIN_NONUPD_SIZE::Int)
107 Constants for semi-tagging; the tags associated with the data
108 constructors will start at 0 and go up.
111 oTHER_TAG = (INFO_OTHER_TAG :: Integer) -- (-1) unevaluated, probably
115 mIN_INTLIKE, mAX_INTLIKE :: Integer -- Only used to compare with (MachInt Integer)
116 mIN_INTLIKE = MIN_INTLIKE
117 mAX_INTLIKE = MAX_INTLIKE
120 A little function that abstracts the stack direction. Note that most
121 of the code generator is dependent on the stack direction anyway, so
122 changing this on its own spells certain doom. ToDo: remove?
125 -- THIS IS DIRECTION SENSITIVE!
127 -- stack grows down, positive virtual offsets correspond to negative
128 -- additions to the stack pointer.
130 spRelToInt :: Int{-VirtualSpOffset-} -> Int{-VirtualSpOffset-} -> Int
131 spRelToInt sp off = sp - off
134 A section of code-generator-related MAGIC CONSTANTS.
137 mAX_FAMILY_SIZE_FOR_VEC_RETURNS = (MAX_VECTORED_RTN::Int) -- pretty arbitrary
138 -- If you change this, you may need to change runtimes/standard/Update.lhc
140 -- The update frame sizes
141 uF_SIZE = (NOSCC_UF_SIZE::Int)
143 -- Same again, with profiling
144 sCC_UF_SIZE = (SCC_UF_SIZE::Int)
146 -- Same again, with gransim
147 gRAN_UF_SIZE = (GRAN_UF_SIZE::Int)
149 -- Offsets in an update frame. They don't change with profiling!
150 uF_RET = (UF_RET::Int)
152 uF_UPDATEE = (UF_UPDATEE::Int)
153 uF_CCS = (UF_CCS::Int)
159 sEQ_FRAME_SIZE = (NOSCC_SEQ_FRAME_SIZE::Int)
160 sCC_SEQ_FRAME_SIZE = (SCC_SEQ_FRAME_SIZE::Int)
161 gRAN_SEQ_FRAME_SIZE = (GRAN_SEQ_FRAME_SIZE::Int)
165 mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
166 mAX_Float_REG = (MAX_FLOAT_REG :: Int)
167 mAX_Double_REG = (MAX_DOUBLE_REG :: Int)
168 mAX_Long_REG = (MAX_LONG_REG :: Int)
170 mAX_Real_Vanilla_REG = (MAX_REAL_VANILLA_REG :: Int)
171 mAX_Real_Float_REG = (MAX_REAL_FLOAT_REG :: Int)
172 mAX_Real_Double_REG = (MAX_REAL_DOUBLE_REG :: Int)
173 #ifdef MAX_REAL_LONG_REG
174 mAX_Real_Long_REG = (MAX_REAL_LONG_REG :: Int)
176 mAX_Real_Long_REG = (0::Int)
180 Closure header sizes.
183 sTD_HDR_SIZE = (STD_HDR_SIZE :: Int)
184 pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int)
185 gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int)
186 tICKY_HDR_SIZE = (TICKY_HDR_SIZE :: Int)
187 aRR_WORDS_HDR_SIZE = (ARR_WORDS_HDR_SIZE :: Int)
188 aRR_PTRS_HDR_SIZE = (ARR_PTRS_HDR_SIZE :: Int)
194 sTD_ITBL_SIZE = (STD_ITBL_SIZE :: Int)
195 pROF_ITBL_SIZE = (PROF_ITBL_SIZE :: Int)
196 gRAN_ITBL_SIZE = (GRAN_ITBL_SIZE :: Int)
197 tICKY_ITBL_SIZE = (TICKY_ITBL_SIZE :: Int)
200 Size of a double in StgWords.
203 dOUBLE_SIZE = (DOUBLE_SIZE :: Int)
204 wORD64_SIZE = (WORD64_SIZE :: Int)
205 iNT64_SIZE = (INT64_SIZE :: Int)
208 The version of the interface file format we're
212 interfaceFileFormatVersion :: Int
213 interfaceFileFormatVersion = HscIfaceFileVersion
216 This tells the native code generator the size of the spill
217 area is has available.
220 rESERVED_C_STACK_BYTES = (RESERVED_C_STACK_BYTES :: Int)