[project @ 2004-02-12 02:04:59 by mthomas]
[ghc-hetmet.git] / ghc / includes / Bytecodes.h
1 /* -----------------------------------------------------------------------------
2  * $Id: Bytecodes.h,v 1.9 2002/12/11 15:36:37 simonmar Exp $
3  *
4  * (c) The GHC Team, 1998-2002
5  *
6  * Bytecode definitions.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 /* --------------------------------------------------------------------------
11  * Instructions
12  *
13  * Notes:
14  * o CASEFAIL is generated by the compiler whenever it tests an "irrefutable"
15  *   pattern which fails.  If we don't see too many of these, we could
16  *   optimise out the redundant test.
17  * ------------------------------------------------------------------------*/
18
19 /* NOTE:
20
21    THIS FILE IS INCLUDED IN HASKELL SOURCES (ghc/compiler/ghci/ByteCodeGen.lhs).
22    DO NOT PUT C-SPECIFIC STUFF IN HERE!
23
24    I hope that's clear :-)
25 */
26
27 #define bci_STKCHECK                    1
28 #define bci_PUSH_L                      2
29 #define bci_PUSH_LL                     3
30 #define bci_PUSH_LLL                    4
31 #define bci_PUSH_G                      5
32 #define bci_PUSH_ALTS                   6
33 #define bci_PUSH_ALTS_P                 7
34 #define bci_PUSH_ALTS_N                 8 
35 #define bci_PUSH_ALTS_F                 9 
36 #define bci_PUSH_ALTS_D                 10
37 #define bci_PUSH_ALTS_L                 11
38 #define bci_PUSH_ALTS_V                 12
39 #define bci_PUSH_UBX                    13
40 #define bci_PUSH_APPLY_N                14
41 #define bci_PUSH_APPLY_F                15
42 #define bci_PUSH_APPLY_D                16
43 #define bci_PUSH_APPLY_L                17
44 #define bci_PUSH_APPLY_V                18
45 #define bci_PUSH_APPLY_P                19
46 #define bci_PUSH_APPLY_PP               20
47 #define bci_PUSH_APPLY_PPP              21
48 #define bci_PUSH_APPLY_PPPP             22
49 #define bci_PUSH_APPLY_PPPPP            23
50 #define bci_PUSH_APPLY_PPPPPP           24
51 #define bci_PUSH_APPLY_PPPPPPP          25
52 #define bci_SLIDE                       26
53 #define bci_ALLOC_AP                    27
54 #define bci_ALLOC_PAP                   28
55 #define bci_MKAP                        29
56 #define bci_UNPACK                      30
57 #define bci_PACK                        31
58 #define bci_TESTLT_I                    32
59 #define bci_TESTEQ_I                    33
60 #define bci_TESTLT_F                    34
61 #define bci_TESTEQ_F                    35
62 #define bci_TESTLT_D                    36
63 #define bci_TESTEQ_D                    37
64 #define bci_TESTLT_P                    38
65 #define bci_TESTEQ_P                    39
66 #define bci_CASEFAIL                    40
67 #define bci_JMP                         41
68 #define bci_CCALL                       42
69 #define bci_SWIZZLE                     43
70 #define bci_ENTER                       44
71 #define bci_RETURN                      45
72 #define bci_RETURN_P                    46
73 #define bci_RETURN_N                    47
74 #define bci_RETURN_F                    48
75 #define bci_RETURN_D                    49
76 #define bci_RETURN_L                    50
77 #define bci_RETURN_V                    51
78
79 /* If a BCO definitely requires less than this many words of stack,
80    don't include an explicit STKCHECK insn in it.  The interpreter
81    will check for this many words of stack before running each BCO,
82    rendering an explicit check unnecessary in the majority of
83    cases. */
84 #define INTERP_STACK_CHECK_THRESH  50
85
86 /*-------------------------------------------------------------------------*/