1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5#ifndef __openum_h__
6#define __openum_h__
7
8
9typedef enum opcode_t
10{
11#define OPDEF(c,s,pop,push,args,type,l,s1,s2,ctrl) c,
12#include "opcode.def"
13#undef OPDEF
14 CEE_COUNT, /* number of instructions and macros pre-defined */
15} OPCODE;
16
17
18typedef enum opcode_format_t
19{
20 InlineNone = 0, // no inline args
21 InlineVar = 1, // local variable (U2 (U1 if Short on))
22 InlineI = 2, // an signed integer (I4 (I1 if Short on))
23 InlineR = 3, // a real number (R8 (R4 if Short on))
24 InlineBrTarget = 4, // branch target (I4 (I1 if Short on))
25 InlineI8 = 5,
26 InlineMethod = 6, // method token (U4)
27 InlineField = 7, // field token (U4)
28 InlineType = 8, // type token (U4)
29 InlineString = 9, // string TOKEN (U4)
30 InlineSig = 10, // signature tok (U4)
31 InlineRVA = 11, // ldptr token (U4)
32 InlineTok = 12, // a meta-data token of unknown type (U4)
33 InlineSwitch = 13, // count (U4), pcrel1 (U4) .... pcrelN (U4)
34 InlinePhi = 14, // count (U1), var1 (U2) ... varN (U2)
35
36 // WATCH OUT we are close to the limit here, if you add
37 // more enumerations you need to change ShortIline definition below
38
39 // The extended enumeration also encodes the size in the IL stream
40 ShortInline = 16, // if this bit is set, the format is the 'short' format
41 PrimaryMask = (ShortInline-1), // mask these off to get primary enumeration above
42 ShortInlineVar = (ShortInline + InlineVar),
43 ShortInlineI = (ShortInline + InlineI),
44 ShortInlineR = (ShortInline + InlineR),
45 ShortInlineBrTarget = (ShortInline + InlineBrTarget),
46 InlineOpcode = (ShortInline + InlineNone), // This is only used internally. It means the 'opcode' is two byte instead of 1
47} OPCODE_FORMAT;
48
49#endif /* __openum_h__ */
50
51
52