8942a4c0276246e24718581aed3f448c7a81d1e2
[ghc-hetmet.git] / ghc / compiler / ghci / ByteCodeLink.lhs
1 %
2 % (c) The University of Glasgow 2000
3 %
4 \section[ByteCodeLink]{Bytecode assembler and linker}
5
6 \begin{code}
7 module ByteCodeLink ( UnlinkedBCO, UnlinkedBCOExpr, assembleBCO,
8                       ClosureEnv, HValue, linkSomeBCOs, filterNameMap
9                    ) where
10
11 #include "HsVersions.h"
12
13 import Outputable
14 import Name             ( Name, getName, nameModule, toRdrName )
15 import RdrName          ( rdrNameOcc, rdrNameModule )
16 import OccName          ( occNameString )
17 import FiniteMap        ( FiniteMap, addListToFM, filterFM,
18                           addToFM, lookupFM, emptyFM )
19 import CoreSyn
20 import Literal          ( Literal(..) )
21 import PrimOp           ( PrimOp, primOpOcc )
22 import PrimRep          ( PrimRep(..) )
23 import Constants        ( wORD_SIZE )
24 import Module           ( ModuleName, moduleName, moduleNameFS )
25 import Linker           ( lookupSymbol )
26 import FastString       ( FastString(..) )
27 import ByteCodeInstr    ( BCInstr(..), ProtoBCO(..) )
28 import ByteCodeItbls    ( ItblEnv, ItblPtr )
29
30
31 import Monad            ( foldM )
32 import ST               ( runST )
33 import MArray           ( castSTUArray, 
34                           newFloatArray, writeFloatArray,
35                           newDoubleArray, writeDoubleArray,
36                           newIntArray, writeIntArray,
37                           newAddrArray, writeAddrArray )
38 import Foreign          ( Word16, Ptr(..) )
39 import Addr             ( Word, Addr )
40
41 import PrelBase         ( Int(..) )
42 import PrelGHC          ( BCO#, newBCO#, unsafeCoerce#, 
43                           ByteArray#, Array#, addrToHValue#, mkApUpd0# )
44 import IOExts           ( fixIO )
45 import ArrayBase        
46 import PrelArr          ( Array(..) )
47 import PrelIOBase       ( IO(..) )
48
49 \end{code}
50
51 %************************************************************************
52 %*                                                                      *
53 \subsection{Top-level stuff}
54 %*                                                                      *
55 %************************************************************************
56
57 \begin{code}
58
59 -- Link a bunch of BCOs and return them + updated closure env.
60 linkSomeBCOs :: ItblEnv -> ClosureEnv -> [UnlinkedBCO]
61                 -> IO (ClosureEnv, [HValue])
62 linkSomeBCOs ie ce_in ul_bcos
63    = do let nms = map nameOfUnlinkedBCO ul_bcos
64         hvals <- fixIO 
65                     ( \ hvs -> let ce_out = addListToFM ce_in (zipLazily nms hvs)
66                                in  mapM (linkBCO ie ce_out) ul_bcos )
67         let ce_out = addListToFM ce_in (zip nms hvals)
68         return (ce_out, hvals)
69      where
70         -- A lazier zip, in which no demand is propagated to the second
71         -- list unless some demand is propagated to the snd of one of the
72         -- result list elems.
73         zipLazily []     ys = []
74         zipLazily (x:xs) ys = (x, head ys) : zipLazily xs (tail ys)
75
76
77 data UnlinkedBCO
78    = UnlinkedBCO Name
79                  (SizedSeq Word16)               -- insns
80                  (SizedSeq Word)                 -- literals
81                  (SizedSeq (Either Name PrimOp)) -- ptrs
82                  (SizedSeq Name)                 -- itbl refs
83
84 nameOfUnlinkedBCO (UnlinkedBCO nm _ _ _ _) = nm
85
86 -- When translating expressions, we need to distinguish the root
87 -- BCO for the expression
88 type UnlinkedBCOExpr = (UnlinkedBCO, [UnlinkedBCO])
89
90 instance Outputable UnlinkedBCO where
91    ppr (UnlinkedBCO nm insns lits ptrs itbls)
92       = sep [text "BCO", ppr nm, text "with", 
93              int (sizeSS insns), text "insns",
94              int (sizeSS lits), text "lits",
95              int (sizeSS ptrs), text "ptrs",
96              int (sizeSS itbls), text "itbls"]
97
98
99 -- these need a proper home
100 type ClosureEnv = FiniteMap Name HValue
101 data HValue     = HValue  -- dummy type, actually a pointer to some Real Code.
102
103 -- remove all entries for a given set of modules from the environment
104 filterNameMap :: [ModuleName] -> FiniteMap Name a -> FiniteMap Name a
105 filterNameMap mods env 
106    = filterFM (\n _ -> moduleName (nameModule n) `notElem` mods) env
107
108 \end{code}
109
110 %************************************************************************
111 %*                                                                      *
112 \subsection{The bytecode assembler}
113 %*                                                                      *
114 %************************************************************************
115
116 The object format for bytecodes is: 16 bits for the opcode, and 16 for
117 each field -- so the code can be considered a sequence of 16-bit ints.
118 Each field denotes either a stack offset or number of items on the
119 stack (eg SLIDE), and index into the pointer table (eg PUSH_G), an
120 index into the literal table (eg PUSH_I/D/L), or a bytecode address in
121 this BCO.
122
123 \begin{code}
124 -- Top level assembler fn.
125 assembleBCO :: ProtoBCO Name -> IO UnlinkedBCO
126
127 assembleBCO (ProtoBCO nm instrs origin)
128    = let
129          -- pass 1: collect up the offsets of the local labels.
130          -- Remember that the first insn starts at offset 1 since offset 0
131          -- (eventually) will hold the total # of insns.
132          label_env = mkLabelEnv emptyFM 1 instrs
133
134          mkLabelEnv env i_offset [] = env
135          mkLabelEnv env i_offset (i:is)
136             = let new_env 
137                      = case i of LABEL n -> addToFM env n i_offset ; _ -> env
138               in  mkLabelEnv new_env (i_offset + instrSize16s i) is
139
140          findLabel lab
141             = case lookupFM label_env lab of
142                  Just bco_offset -> bco_offset
143                  Nothing -> pprPanic "assembleBCO.findLabel" (int lab)
144      in
145      do  -- pass 2: generate the instruction, ptr and nonptr bits
146          insns <- return emptySS :: IO (SizedSeq Word16)
147          lits  <- return emptySS :: IO (SizedSeq Word)
148          ptrs  <- return emptySS :: IO (SizedSeq (Either Name PrimOp))
149          itbls <- return emptySS :: IO (SizedSeq Name)
150          let init_asm_state = (insns,lits,ptrs,itbls)
151          (final_insns, final_lits, final_ptrs, final_itbls) 
152             <- mkBits findLabel init_asm_state instrs         
153
154          return (UnlinkedBCO nm final_insns final_lits final_ptrs final_itbls)
155
156 -- instrs nonptrs ptrs itbls
157 type AsmState = (SizedSeq Word16, SizedSeq Word, 
158                  SizedSeq (Either Name PrimOp), SizedSeq Name)
159
160 data SizedSeq a = SizedSeq !Int [a]
161 emptySS = SizedSeq 0 []
162 addToSS (SizedSeq n r_xs) x = return (SizedSeq (n+1) (x:r_xs))
163 addListToSS (SizedSeq n r_xs) xs 
164    = return (SizedSeq (n + length xs) (reverse xs ++ r_xs))
165 sizeSS (SizedSeq n r_xs) = n
166 listFromSS (SizedSeq n r_xs) = return (reverse r_xs)
167
168
169 -- This is where all the action is (pass 2 of the assembler)
170 mkBits :: (Int -> Int)                  -- label finder
171        -> AsmState
172        -> [BCInstr]                     -- instructions (in)
173        -> IO AsmState
174
175 mkBits findLabel st proto_insns
176   = foldM doInstr st proto_insns
177     where
178        doInstr :: AsmState -> BCInstr -> IO AsmState
179        doInstr st i
180           = case i of
181                ARGCHECK  n        -> instr2 st i_ARGCHECK n
182                PUSH_L    o1       -> instr2 st i_PUSH_L o1
183                PUSH_LL   o1 o2    -> instr3 st i_PUSH_LL o1 o2
184                PUSH_LLL  o1 o2 o3 -> instr4 st i_PUSH_LLL o1 o2 o3
185                PUSH_G    nm       -> do (p, st2) <- ptr st nm
186                                         instr2 st2 i_PUSH_G p
187                PUSH_AS   nm pk    -> do (p, st2)  <- ptr st (Left nm)
188                                         (np, st3) <- ctoi_itbl st2 pk
189                                         instr3 st3 i_PUSH_AS p np
190                PUSH_UBX  lit nws  -> do (np, st2) <- literal st lit
191                                         instr3 st2 i_PUSH_UBX np nws
192                PUSH_TAG  tag      -> instr2 st i_PUSH_TAG tag
193                SLIDE     n by     -> instr3 st i_SLIDE n by
194                ALLOC     n        -> instr2 st i_ALLOC n
195                MKAP      off sz   -> instr3 st i_MKAP off sz
196                UNPACK    n        -> instr2 st i_UNPACK n
197                UPK_TAG   n m k    -> instr4 st i_UPK_TAG n m k
198                PACK      dcon sz  -> do (itbl_no,st2) <- itbl st dcon
199                                         instr3 st2 i_PACK itbl_no sz
200                LABEL     lab      -> return st
201                TESTLT_I  i l      -> do (np, st2) <- int st i
202                                         instr3 st2 i_TESTLT_I np (findLabel l)
203                TESTEQ_I  i l      -> do (np, st2) <- int st i
204                                         instr3 st2 i_TESTEQ_I np (findLabel l)
205                TESTLT_F  f l      -> do (np, st2) <- float st f
206                                         instr3 st2 i_TESTLT_F np (findLabel l)
207                TESTEQ_F  f l      -> do (np, st2) <- float st f
208                                         instr3 st2 i_TESTEQ_F np (findLabel l)
209                TESTLT_D  d l      -> do (np, st2) <- double st d
210                                         instr3 st2 i_TESTLT_D np (findLabel l)
211                TESTEQ_D  d l      -> do (np, st2) <- double st d
212                                         instr3 st2 i_TESTEQ_D np (findLabel l)
213                TESTLT_P  i l      -> instr3 st i_TESTLT_P i (findLabel l)
214                TESTEQ_P  i l      -> instr3 st i_TESTEQ_P i (findLabel l)
215                CASEFAIL           -> instr1 st i_CASEFAIL
216                ENTER              -> instr1 st i_ENTER
217                RETURN rep         -> do (itbl_no,st2) <- itoc_itbl st rep
218                                         instr2 st2 i_RETURN itbl_no
219
220        i2s :: Int -> Word16
221        i2s = fromIntegral
222
223        instr1 (st_i0,st_l0,st_p0,st_I0) i1
224           = do st_i1 <- addToSS st_i0 (i2s i1)
225                return (st_i1,st_l0,st_p0,st_I0)
226
227        instr2 (st_i0,st_l0,st_p0,st_I0) i1 i2
228           = do st_i1 <- addToSS st_i0 (i2s i1)
229                st_i2 <- addToSS st_i1 (i2s i2)
230                return (st_i2,st_l0,st_p0,st_I0)
231
232        instr3 (st_i0,st_l0,st_p0,st_I0) i1 i2 i3
233           = do st_i1 <- addToSS st_i0 (i2s i1)
234                st_i2 <- addToSS st_i1 (i2s i2)
235                st_i3 <- addToSS st_i2 (i2s i3)
236                return (st_i3,st_l0,st_p0,st_I0)
237
238        instr4 (st_i0,st_l0,st_p0,st_I0) i1 i2 i3 i4
239           = do st_i1 <- addToSS st_i0 (i2s i1)
240                st_i2 <- addToSS st_i1 (i2s i2)
241                st_i3 <- addToSS st_i2 (i2s i3)
242                st_i4 <- addToSS st_i3 (i2s i4)
243                return (st_i4,st_l0,st_p0,st_I0)
244
245        float (st_i0,st_l0,st_p0,st_I0) f
246           = do let ws = mkLitF f
247                st_l1 <- addListToSS st_l0 ws
248                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
249
250        double (st_i0,st_l0,st_p0,st_I0) d
251           = do let ws = mkLitD d
252                st_l1 <- addListToSS st_l0 ws
253                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
254
255        int (st_i0,st_l0,st_p0,st_I0) i
256           = do let ws = mkLitI i
257                st_l1 <- addListToSS st_l0 ws
258                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
259
260        addr (st_i0,st_l0,st_p0,st_I0) a
261           = do let ws = mkLitA a
262                st_l1 <- addListToSS st_l0 ws
263                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
264
265        ptr (st_i0,st_l0,st_p0,st_I0) p
266           = do st_p1 <- addToSS st_p0 p
267                return (sizeSS st_p0, (st_i0,st_l0,st_p1,st_I0))
268
269        itbl (st_i0,st_l0,st_p0,st_I0) dcon
270           = do st_I1 <- addToSS st_I0 (getName dcon)
271                return (sizeSS st_I0, (st_i0,st_l0,st_p0,st_I1))
272
273        literal st (MachWord w)   = int st (fromIntegral w)
274        literal st (MachInt j)    = int st (fromIntegral j)
275        literal st (MachFloat r)  = float st (fromRational r)
276        literal st (MachDouble r) = double st (fromRational r)
277        literal st (MachChar c)   = int st c
278
279        ctoi_itbl st pk
280           = addr st ret_itbl_addr
281             where
282                ret_itbl_addr = case pk of
283                                   PtrRep    -> stg_ctoi_ret_R1p_info
284                                   WordRep   -> stg_ctoi_ret_R1n_info
285                                   IntRep    -> stg_ctoi_ret_R1n_info
286                                   AddrRep   -> stg_ctoi_ret_R1n_info
287                                   CharRep   -> stg_ctoi_ret_R1n_info
288                                   FloatRep  -> stg_ctoi_ret_F1_info
289                                   DoubleRep -> stg_ctoi_ret_D1_info
290                                   _ -> pprPanic "mkBits.ctoi_itbl" (ppr pk)
291
292        itoc_itbl st pk
293           = addr st ret_itbl_addr
294             where
295                ret_itbl_addr = case pk of
296                                   CharRep   -> stg_gc_unbx_r1_info
297                                   IntRep    -> stg_gc_unbx_r1_info
298                                   FloatRep  -> stg_gc_f1_info
299                                   DoubleRep -> stg_gc_d1_info
300                      
301 foreign label "stg_ctoi_ret_R1p_info" stg_ctoi_ret_R1p_info :: Addr
302 foreign label "stg_ctoi_ret_R1n_info" stg_ctoi_ret_R1n_info :: Addr
303 foreign label "stg_ctoi_ret_F1_info"  stg_ctoi_ret_F1_info :: Addr
304 foreign label "stg_ctoi_ret_D1_info"  stg_ctoi_ret_D1_info :: Addr
305
306 foreign label "stg_gc_unbx_r1_info" stg_gc_unbx_r1_info :: Addr
307 foreign label "stg_gc_f1_info"      stg_gc_f1_info :: Addr
308 foreign label "stg_gc_d1_info"      stg_gc_d1_info :: Addr
309
310 -- The size in 16-bit entities of an instruction.
311 instrSize16s :: BCInstr -> Int
312 instrSize16s instr
313    = case instr of
314         ARGCHECK _     -> 2
315         PUSH_L   _     -> 2
316         PUSH_LL  _ _   -> 3
317         PUSH_LLL _ _ _ -> 4
318         PUSH_G   _     -> 2
319         PUSH_AS  _ _   -> 3
320         PUSH_UBX _ _   -> 3
321         PUSH_TAG _     -> 2
322         SLIDE    _ _   -> 3
323         ALLOC    _     -> 2
324         MKAP     _ _   -> 3
325         UNPACK   _     -> 2
326         UPK_TAG  _ _ _ -> 4
327         PACK     _ _   -> 3
328         LABEL    _     -> 0     -- !!
329         TESTLT_I _ _   -> 3
330         TESTEQ_I _ _   -> 3
331         TESTLT_F _ _   -> 3
332         TESTEQ_F _ _   -> 3
333         TESTLT_D _ _   -> 3
334         TESTEQ_D _ _   -> 3
335         TESTLT_P _ _   -> 3
336         TESTEQ_P _ _   -> 3
337         CASEFAIL       -> 1
338         ENTER          -> 1
339         RETURN   _     -> 2
340
341
342 -- Make lists of host-sized words for literals, so that when the
343 -- words are placed in memory at increasing addresses, the
344 -- bit pattern is correct for the host's word size and endianness.
345 mkLitI :: Int    -> [Word]
346 mkLitF :: Float  -> [Word]
347 mkLitD :: Double -> [Word]
348 mkLitA :: Addr   -> [Word]
349
350 mkLitF f
351    = runST (do
352         arr <- newFloatArray ((0::Int),0)
353         writeFloatArray arr 0 f
354         f_arr <- castSTUArray arr
355         w0 <- readWordArray f_arr 0
356         return [w0]
357      )
358
359 mkLitD d
360    | wORD_SIZE == 4
361    = runST (do
362         arr <- newDoubleArray ((0::Int),1)
363         writeDoubleArray arr 0 d
364         d_arr <- castSTUArray arr
365         w0 <- readWordArray d_arr 0
366         w1 <- readWordArray d_arr 1
367         return [w0,w1]
368      )
369    | wORD_SIZE == 8
370    = runST (do
371         arr <- newDoubleArray ((0::Int),0)
372         writeDoubleArray arr 0 d
373         d_arr <- castSTUArray arr
374         w0 <- readWordArray d_arr 0
375         return [w0]
376      )
377
378 mkLitI i
379    = runST (do
380         arr <- newIntArray ((0::Int),0)
381         writeIntArray arr 0 i
382         i_arr <- castSTUArray arr
383         w0 <- readWordArray i_arr 0
384         return [w0]
385      )
386
387 mkLitA a
388    = runST (do
389         arr <- newAddrArray ((0::Int),0)
390         writeAddrArray arr 0 a
391         a_arr <- castSTUArray arr
392         w0 <- readWordArray a_arr 0
393         return [w0]
394      )
395
396 \end{code}
397
398 %************************************************************************
399 %*                                                                      *
400 \subsection{Linking interpretables into something we can run}
401 %*                                                                      *
402 %************************************************************************
403
404 \begin{code}
405
406 {- 
407 data BCO# = BCO# ByteArray#             -- instrs   :: array Word16#
408                  ByteArray#             -- literals :: array Word32#
409                  PtrArray#              -- ptrs     :: Array HValue
410                  ByteArray#             -- itbls    :: Array Addr#
411 -}
412
413 linkBCO ie ce (UnlinkedBCO nm insnsSS literalsSS ptrsSS itblsSS)
414    = do insns    <- listFromSS insnsSS
415         literals <- listFromSS literalsSS
416         ptrs     <- listFromSS ptrsSS
417         itbls    <- listFromSS itblsSS
418
419         linked_ptrs  <- mapM (lookupCE ce) ptrs
420         linked_itbls <- mapM (lookupIE ie) itbls
421
422         let n_insns    = sizeSS insnsSS
423             n_literals = sizeSS literalsSS
424             n_ptrs     = sizeSS ptrsSS
425             n_itbls    = sizeSS itblsSS
426
427         let ptrs_arr = array (0, n_ptrs-1) (indexify linked_ptrs)
428                        :: Array Int HValue
429             ptrs_parr = case ptrs_arr of Array lo hi parr -> parr
430
431             itbls_arr = array (0, n_itbls-1) (indexify linked_itbls)
432                         :: UArray Int ItblPtr
433             itbls_barr = case itbls_arr of UArray lo hi barr -> barr
434
435             insns_arr | n_insns > 65535
436                       = panic "linkBCO: >= 64k insns in BCO"
437                       | otherwise 
438                       = array (0, n_insns) 
439                               (indexify (fromIntegral n_insns:insns))
440                         :: UArray Int Word16
441             insns_barr = case insns_arr of UArray lo hi barr -> barr
442
443             literals_arr = array (0, n_literals-1) (indexify literals)
444                            :: UArray Int Word
445             literals_barr = case literals_arr of UArray lo hi barr -> barr
446
447             indexify :: [a] -> [(Int, a)]
448             indexify xs = zip [0..] xs
449
450         BCO bco# <- newBCO insns_barr literals_barr ptrs_parr itbls_barr
451
452         -- WAS: return (unsafeCoerce# bco#)
453         case mkApUpd0# (unsafeCoerce# bco#) of
454            (# final_bco #) -> return final_bco
455
456
457 data BCO = BCO BCO#
458
459 newBCO :: ByteArray# -> ByteArray# -> Array# a -> ByteArray# -> IO BCO
460 newBCO a b c d
461    = IO (\s -> case newBCO# a b c d s of (# s1, bco #) -> (# s1, BCO bco #))
462
463
464 lookupCE :: ClosureEnv -> Either Name PrimOp -> IO HValue
465 lookupCE ce (Right primop)
466    = do m <- lookupSymbol (primopToCLabel primop "closure")
467         case m of
468            Just (Ptr addr) -> case addrToHValue# addr of
469                                  (# hval #) -> return hval
470            Nothing -> pprPanic "ByteCodeGen.lookupCE(primop)" (ppr primop)
471 lookupCE ce (Left nm)
472    = case lookupFM ce nm of
473         Just aa -> return aa
474         Nothing 
475            -> do m <- lookupSymbol (nameToCLabel nm "closure")
476                  case m of
477                     Just (Ptr addr) -> case addrToHValue# addr of
478                                           (# hval #) -> return hval
479                     Nothing        -> pprPanic "ByteCodeGen.lookupCE" (ppr nm)
480
481 lookupIE :: ItblEnv -> Name -> IO (Ptr a)
482 lookupIE ie con_nm 
483    = case lookupFM ie con_nm of
484         Just (Ptr a) -> return (Ptr a)
485         Nothing
486            -> do -- try looking up in the object files.
487                  m <- lookupSymbol (nameToCLabel con_nm "con_info")
488                  case m of
489                     Just addr -> return addr
490                     Nothing 
491                        -> do -- perhaps a nullary constructor?
492                              n <- lookupSymbol (nameToCLabel con_nm "static_info")
493                              case n of
494                                 Just addr -> return addr
495                                 Nothing -> pprPanic "ByteCodeGen.lookupIE" (ppr con_nm)
496
497 -- HACKS!!!  ToDo: cleaner
498 nameToCLabel :: Name -> String{-suffix-} -> String
499 nameToCLabel n suffix
500    = _UNPK_(moduleNameFS (rdrNameModule rn)) 
501      ++ '_':occNameString(rdrNameOcc rn) ++ '_':suffix
502      where rn = toRdrName n
503
504 primopToCLabel :: PrimOp -> String{-suffix-} -> String
505 primopToCLabel primop suffix
506    = let str = "PrelPrimopWrappers_" ++ occNameString (primOpOcc primop) ++ '_':suffix
507      in --trace ("primopToCLabel: " ++ str)
508         str
509
510 \end{code}
511
512 %************************************************************************
513 %*                                                                      *
514 \subsection{Connect to actual values for bytecode opcodes}
515 %*                                                                      *
516 %************************************************************************
517
518 \begin{code}
519
520 #include "Bytecodes.h"
521
522 i_ARGCHECK = (bci_ARGCHECK :: Int)
523 i_PUSH_L   = (bci_PUSH_L :: Int)
524 i_PUSH_LL  = (bci_PUSH_LL :: Int)
525 i_PUSH_LLL = (bci_PUSH_LLL :: Int)
526 i_PUSH_G   = (bci_PUSH_G :: Int)
527 i_PUSH_AS  = (bci_PUSH_AS :: Int)
528 i_PUSH_UBX = (bci_PUSH_UBX :: Int)
529 i_PUSH_TAG = (bci_PUSH_TAG :: Int)
530 i_SLIDE    = (bci_SLIDE :: Int)
531 i_ALLOC    = (bci_ALLOC :: Int)
532 i_MKAP     = (bci_MKAP :: Int)
533 i_UNPACK   = (bci_UNPACK :: Int)
534 i_UPK_TAG  = (bci_UPK_TAG :: Int)
535 i_PACK     = (bci_PACK :: Int)
536 i_TESTLT_I = (bci_TESTLT_I :: Int)
537 i_TESTEQ_I = (bci_TESTEQ_I :: Int)
538 i_TESTLT_F = (bci_TESTLT_F :: Int)
539 i_TESTEQ_F = (bci_TESTEQ_F :: Int)
540 i_TESTLT_D = (bci_TESTLT_D :: Int)
541 i_TESTEQ_D = (bci_TESTEQ_D :: Int)
542 i_TESTLT_P = (bci_TESTLT_P :: Int)
543 i_TESTEQ_P = (bci_TESTEQ_P :: Int)
544 i_CASEFAIL = (bci_CASEFAIL :: Int)
545 i_ENTER    = (bci_ENTER :: Int)
546 i_RETURN   = (bci_RETURN :: Int)
547
548 \end{code}