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