2009-12-02 Zoltan Varga <vargaz@gmail.com>
[mono-project.git] / mono / interpreter / mintops.h
blobe787526e2febe225faeb272671a1f38770600f42
1 #ifndef __INTERPRETER_MINTOPS_H
2 #define __INTERPRETER_MINTOPS_H
4 #include <glib.h>
6 typedef enum
8 MintOpNoArgs,
9 MintOpShortInt,
10 MintOpUShortInt,
11 MintOpInt,
12 MintOpLongInt,
13 MintOpFloat,
14 MintOpDouble,
15 MintOpBranch,
16 MintOpShortBranch,
17 MintOpSwitch,
18 MintOpMethodToken,
19 MintOpFieldToken,
20 MintOpClassToken,
21 MintOpTwoShorts,
22 MintOpShortAndInt
23 } MintOpArgType;
25 #define OPDEF(a,b,c,d) \
27 enum {
28 #include "mintops.def"
29 MINT_LASTOP
31 #undef OPDEF
33 #if NO_UNALIGNED_ACCESS
34 # if G_BYTE_ORDER == G_LITTLE_ENDIAN
35 #define READ32(x) (((guint16 *)(x)) [0] | ((guint16 *)(x)) [1] << 16)
36 #define READ64(x) ((guint64)((guint16 *)(x)) [0] | \
37 (guint64)((guint16 *)(x)) [1] << 16 | \
38 (guint64)((guint16 *)(x)) [2] << 32 | \
39 (guint64)((guint16 *)(x)) [3] << 48)
40 # else
41 #define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
42 #define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
43 (guint64)((guint16 *)(x)) [1] << 32 | \
44 (guint64)((guint16 *)(x)) [2] << 16 | \
45 (guint64)((guint16 *)(x)) [3])
46 # endif
47 #else /* unaligned access OK */
48 #define READ32(x) (*(guint32 *)(x))
49 #define READ64(x) (*(guint64 *)(x))
50 #endif
52 extern const char *mono_interp_opname[];
53 extern unsigned char mono_interp_oplen[];
54 extern MintOpArgType mono_interp_opargtype[];
55 extern const guint16 *mono_interp_dis_mintop(const unsigned short *base, const guint16 *ip);
57 #endif