VLA code: minor fix
[tinycc.git] / il-opcodes.h
Commit [+]AuthorDateLineData
5a50e739 bellard2002-02-10 16:14:03 +00001/*
2 * CIL opcode definition
3 *
4 * Copyright (c) 2002 Fabrice Bellard
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20OP(NOP, "nop", 0x00)
21OP(BREAK, "break", 0x01)
22OP(LDARG_0, "ldarg.0", 0x02)
23OP(LDARG_1, "ldarg.1", 0x03)
24OP(LDARG_2, "ldarg.2", 0x04)
25OP(LDARG_3, "ldarg.3", 0x05)
26OP(LDLOC_0, "ldloc.0", 0x06)
27OP(LDLOC_1, "ldloc.1", 0x07)
28OP(LDLOC_2, "ldloc.2", 0x08)
29OP(LDLOC_3, "ldloc.3", 0x09)
30OP(STLOC_0, "stloc.0", 0x0a)
31OP(STLOC_1, "stloc.1", 0x0b)
32OP(STLOC_2, "stloc.2", 0x0c)
33OP(STLOC_3, "stloc.3", 0x0d)
34OP(LDARG_S, "ldarg.s", 0x0e)
35OP(LDARGA_S, "ldarga.s", 0x0f)
36OP(STARG_S, "starg.s", 0x10)
37OP(LDLOC_S, "ldloc.s", 0x11)
38OP(LDLOCA_S, "ldloca.s", 0x12)
39OP(STLOC_S, "stloc.s", 0x13)
40OP(LDNULL, "ldnull", 0x14)
41OP(LDC_I4_M1, "ldc.i4.m1", 0x15)
42OP(LDC_I4_0, "ldc.i4.0", 0x16)
43OP(LDC_I4_1, "ldc.i4.1", 0x17)
44OP(LDC_I4_2, "ldc.i4.2", 0x18)
45OP(LDC_I4_3, "ldc.i4.3", 0x19)
46OP(LDC_I4_4, "ldc.i4.4", 0x1a)
47OP(LDC_I4_5, "ldc.i4.5", 0x1b)
48OP(LDC_I4_6, "ldc.i4.6", 0x1c)
49OP(LDC_I4_7, "ldc.i4.7", 0x1d)
50OP(LDC_I4_8, "ldc.i4.8", 0x1e)
51OP(LDC_I4_S, "ldc.i4.s", 0x1f)
52OP(LDC_I4, "ldc.i4", 0x20)
53OP(LDC_I8, "ldc.i8", 0x21)
54OP(LDC_R4, "ldc.r4", 0x22)
55OP(LDC_R8, "ldc.r8", 0x23)
56OP(LDPTR, "ldptr", 0x24)
57OP(DUP, "dup", 0x25)
58OP(POP, "pop", 0x26)
59OP(JMP, "jmp", 0x27)
60OP(CALL, "call", 0x28)
61OP(CALLI, "calli", 0x29)
62OP(RET, "ret", 0x2a)
63OP(BR_S, "br.s", 0x2b)
64OP(BRFALSE_S, "brfalse.s", 0x2c)
65OP(BRTRUE_S, "brtrue.s", 0x2d)
66OP(BEQ_S, "beq.s", 0x2e)
67OP(BGE_S, "bge.s", 0x2f)
68OP(BGT_S, "bgt.s", 0x30)
69OP(BLE_S, "ble.s", 0x31)
70OP(BLT_S, "blt.s", 0x32)
71OP(BNE_UN_S, "bne.un.s", 0x33)
72OP(BGE_UN_S, "bge.un.s", 0x34)
73OP(BGT_UN_S, "bgt.un.s", 0x35)
74OP(BLE_UN_S, "ble.un.s", 0x36)
75OP(BLT_UN_S, "blt.un.s", 0x37)
76OP(BR, "br", 0x38)
77OP(BRFALSE, "brfalse", 0x39)
78OP(BRTRUE, "brtrue", 0x3a)
79OP(BEQ, "beq", 0x3b)
80OP(BGE, "bge", 0x3c)
81OP(BGT, "bgt", 0x3d)
82OP(BLE, "ble", 0x3e)
83OP(BLT, "blt", 0x3f)
84OP(BNE_UN, "bne.un", 0x40)
85OP(BGE_UN, "bge.un", 0x41)
86OP(BGT_UN, "bgt.un", 0x42)
87OP(BLE_UN, "ble.un", 0x43)
88OP(BLT_UN, "blt.un", 0x44)
89OP(SWITCH, "switch", 0x45)
90OP(LDIND_I1, "ldind.i1", 0x46)
91OP(LDIND_U1, "ldind.u1", 0x47)
92OP(LDIND_I2, "ldind.i2", 0x48)
93OP(LDIND_U2, "ldind.u2", 0x49)
94OP(LDIND_I4, "ldind.i4", 0x4a)
95OP(LDIND_U4, "ldind.u4", 0x4b)
96OP(LDIND_I8, "ldind.i8", 0x4c)
97OP(LDIND_I, "ldind.i", 0x4d)
98OP(LDIND_R4, "ldind.r4", 0x4e)
99OP(LDIND_R8, "ldind.r8", 0x4f)
100OP(LDIND_REF, "ldind.ref", 0x50)
101OP(STIND_REF, "stind.ref", 0x51)
102OP(STIND_I1, "stind.i1", 0x52)
103OP(STIND_I2, "stind.i2", 0x53)
104OP(STIND_I4, "stind.i4", 0x54)
105OP(STIND_I8, "stind.i8", 0x55)
106OP(STIND_R4, "stind.r4", 0x56)
107OP(STIND_R8, "stind.r8", 0x57)
108OP(ADD, "add", 0x58)
109OP(SUB, "sub", 0x59)
110OP(MUL, "mul", 0x5a)
111OP(DIV, "div", 0x5b)
112OP(DIV_UN, "div.un", 0x5c)
113OP(REM, "rem", 0x5d)
114OP(REM_UN, "rem.un", 0x5e)
115OP(AND, "and", 0x5f)
116OP(OR, "or", 0x60)
117OP(XOR, "xor", 0x61)
118OP(SHL, "shl", 0x62)
119OP(SHR, "shr", 0x63)
120OP(SHR_UN, "shr.un", 0x64)
121OP(NEG, "neg", 0x65)
122OP(NOT, "not", 0x66)
123OP(CONV_I1, "conv.i1", 0x67)
124OP(CONV_I2, "conv.i2", 0x68)
125OP(CONV_I4, "conv.i4", 0x69)
126OP(CONV_I8, "conv.i8", 0x6a)
127OP(CONV_R4, "conv.r4", 0x6b)
128OP(CONV_R8, "conv.r8", 0x6c)
129OP(CONV_U4, "conv.u4", 0x6d)
130OP(CONV_U8, "conv.u8", 0x6e)
131OP(CALLVIRT, "callvirt", 0x6f)
132OP(CPOBJ, "cpobj", 0x70)
133OP(LDOBJ, "ldobj", 0x71)
134OP(LDSTR, "ldstr", 0x72)
135OP(NEWOBJ, "newobj", 0x73)
136OP(CASTCLASS, "castclass", 0x74)
137OP(ISINST, "isinst", 0x75)
138OP(CONV_R_UN, "conv.r.un", 0x76)
139OP(ANN_DATA_S, "ann.data.s", 0x77)
140OP(UNBOX, "unbox", 0x79)
141OP(THROW, "throw", 0x7a)
142OP(LDFLD, "ldfld", 0x7b)
143OP(LDFLDA, "ldflda", 0x7c)
144OP(STFLD, "stfld", 0x7d)
145OP(LDSFLD, "ldsfld", 0x7e)
146OP(LDSFLDA, "ldsflda", 0x7f)
147OP(STSFLD, "stsfld", 0x80)
148OP(STOBJ, "stobj", 0x81)
149OP(CONV_OVF_I1_UN, "conv.ovf.i1.un", 0x82)
150OP(CONV_OVF_I2_UN, "conv.ovf.i2.un", 0x83)
151OP(CONV_OVF_I4_UN, "conv.ovf.i4.un", 0x84)
152OP(CONV_OVF_I8_UN, "conv.ovf.i8.un", 0x85)
153OP(CONV_OVF_U1_UN, "conv.ovf.u1.un", 0x86)
154OP(CONV_OVF_U2_UN, "conv.ovf.u2.un", 0x87)
155OP(CONV_OVF_U4_UN, "conv.ovf.u4.un", 0x88)
156OP(CONV_OVF_U8_UN, "conv.ovf.u8.un", 0x89)
157OP(CONV_OVF_I_UN, "conv.ovf.i.un", 0x8a)
158OP(CONV_OVF_U_UN, "conv.ovf.u.un", 0x8b)
159OP(BOX, "box", 0x8c)
160OP(NEWARR, "newarr", 0x8d)
161OP(LDLEN, "ldlen", 0x8e)
162OP(LDELEMA, "ldelema", 0x8f)
163OP(LDELEM_I1, "ldelem.i1", 0x90)
164OP(LDELEM_U1, "ldelem.u1", 0x91)
165OP(LDELEM_I2, "ldelem.i2", 0x92)
166OP(LDELEM_U2, "ldelem.u2", 0x93)
167OP(LDELEM_I4, "ldelem.i4", 0x94)
168OP(LDELEM_U4, "ldelem.u4", 0x95)
169OP(LDELEM_I8, "ldelem.i8", 0x96)
170OP(LDELEM_I, "ldelem.i", 0x97)
171OP(LDELEM_R4, "ldelem.r4", 0x98)
172OP(LDELEM_R8, "ldelem.r8", 0x99)
173OP(LDELEM_REF, "ldelem.ref", 0x9a)
174OP(STELEM_I, "stelem.i", 0x9b)
175OP(STELEM_I1, "stelem.i1", 0x9c)
176OP(STELEM_I2, "stelem.i2", 0x9d)
177OP(STELEM_I4, "stelem.i4", 0x9e)
178OP(STELEM_I8, "stelem.i8", 0x9f)
179OP(STELEM_R4, "stelem.r4", 0xa0)
180OP(STELEM_R8, "stelem.r8", 0xa1)
181OP(STELEM_REF, "stelem.ref", 0xa2)
182OP(CONV_OVF_I1, "conv.ovf.i1", 0xb3)
183OP(CONV_OVF_U1, "conv.ovf.u1", 0xb4)
184OP(CONV_OVF_I2, "conv.ovf.i2", 0xb5)
185OP(CONV_OVF_U2, "conv.ovf.u2", 0xb6)
186OP(CONV_OVF_I4, "conv.ovf.i4", 0xb7)
187OP(CONV_OVF_U4, "conv.ovf.u4", 0xb8)
188OP(CONV_OVF_I8, "conv.ovf.i8", 0xb9)
189OP(CONV_OVF_U8, "conv.ovf.u8", 0xba)
190OP(REFANYVAL, "refanyval", 0xc2)
191OP(CKFINITE, "ckfinite", 0xc3)
192OP(MKREFANY, "mkrefany", 0xc6)
193OP(ANN_CALL, "ann.call", 0xc7)
194OP(ANN_CATCH, "ann.catch", 0xc8)
195OP(ANN_DEAD, "ann.dead", 0xc9)
196OP(ANN_HOISTED, "ann.hoisted", 0xca)
197OP(ANN_HOISTED_CALL, "ann.hoisted.call", 0xcb)
198OP(ANN_LAB, "ann.lab", 0xcc)
199OP(ANN_DEF, "ann.def", 0xcd)
200OP(ANN_REF_S, "ann.ref.s", 0xce)
201OP(ANN_PHI, "ann.phi", 0xcf)
202OP(LDTOKEN, "ldtoken", 0xd0)
203OP(CONV_U2, "conv.u2", 0xd1)
204OP(CONV_U1, "conv.u1", 0xd2)
205OP(CONV_I, "conv.i", 0xd3)
206OP(CONV_OVF_I, "conv.ovf.i", 0xd4)
207OP(CONV_OVF_U, "conv.ovf.u", 0xd5)
208OP(ADD_OVF, "add.ovf", 0xd6)
209OP(ADD_OVF_UN, "add.ovf.un", 0xd7)
210OP(MUL_OVF, "mul.ovf", 0xd8)
211OP(MUL_OVF_UN, "mul.ovf.un", 0xd9)
212OP(SUB_OVF, "sub.ovf", 0xda)
213OP(SUB_OVF_UN, "sub.ovf.un", 0xdb)
214OP(ENDFINALLY, "endfinally", 0xdc)
215OP(LEAVE, "leave", 0xdd)
216OP(LEAVE_S, "leave.s", 0xde)
217OP(STIND_I, "stind.i", 0xdf)
218OP(CONV_U, "conv.u", 0xe0)
219
220/* prefix instructions. we use an opcode >= 256 to ease coding */
221
222OP(ARGLIST, "arglist", 0x100)
223OP(CEQ, "ceq", 0x101)
224OP(CGT, "cgt", 0x102)
225OP(CGT_UN, "cgt.un", 0x103)
226OP(CLT, "clt", 0x104)
227OP(CLT_UN, "clt.un", 0x105)
228OP(LDFTN, "ldftn", 0x106)
229OP(LDVIRTFTN, "ldvirtftn", 0x107)
230OP(JMPI, "jmpi", 0x108)
231OP(LDARG, "ldarg", 0x109)
232OP(LDARGA, "ldarga", 0x10a)
233OP(STARG, "starg", 0x10b)
234OP(LDLOC, "ldloc", 0x10c)
235OP(LDLOCA, "ldloca", 0x10d)
236OP(STLOC, "stloc", 0x10e)
237OP(LOCALLOC, "localloc", 0x10f)
238OP(ENDFILTER, "endfilter", 0x111)
239OP(UNALIGNED, "unaligned", 0x112)
240OP(VOLATILE, "volatile", 0x113)
241OP(TAIL, "tail", 0x114)
242OP(INITOBJ, "initobj", 0x115)
243OP(ANN_LIVE, "ann.live", 0x116)
244OP(CPBLK, "cpblk", 0x117)
245OP(INITBLK, "initblk", 0x118)
246OP(ANN_REF, "ann.ref", 0x119)
247OP(RETHROW, "rethrow", 0x11a)
248OP(SIZEOF, "sizeof", 0x11c)
249OP(REFANYTYPE, "refanytype", 0x11d)
250OP(ANN_DATA, "ann.data", 0x122)
251OP(ANN_ARG, "ann.arg", 0x123)