2004-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mono / interpreter / mintops.h
1 #ifndef __INTERPRETER_MINTOPS_H
2 #define __INTERPRETER_MINTOPS_H
3
4 typedef enum
5 {
6         MintOpNoArgs,
7         MintOpShortInt,
8         MintOpUShortInt,
9         MintOpInt,
10         MintOpLongInt,
11         MintOpFloat,
12         MintOpDouble,
13         MintOpBranch,
14         MintOpShortBranch,
15         MintOpSwitch,
16         MintOpMethodToken,
17         MintOpFieldToken,
18         MintOpClassToken,
19         MintOpTwoShorts,
20         MintOpShortAndInt
21 } MintOpArgType;
22
23 #define OPDEF(a,b,c,d) \
24         a,
25 enum {
26 #include "mintops.def"
27         MINT_LASTOP
28 };
29 #undef OPDEF
30
31 #if NO_UNALIGNED_ACCESS
32 #define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
33 #define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
34                    (guint64)((guint16 *)(x)) [1] << 32 | \
35                    (guint64)((guint16 *)(x)) [2] << 16 | \
36                    (guint64)((guint16 *)(x)) [3])
37 #else /* unaligned access OK */
38 #define READ32(x) (*(guint32 *)(x))
39 #define READ64(x) (*(guint64 *)(x))
40 #endif
41
42 extern const char *mono_interp_opname[];
43 extern unsigned char mono_interp_oplen[];
44 extern MintOpArgType mono_interp_opargtype[];
45 extern const guint16 *mono_interp_dis_mintop(const unsigned short *base, const guint16 *ip);
46
47 #endif
48