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