Control symbol table of which to relocate symbols
[tinycc.git] / i386-tok.h
blob17d17ce215fbca257379a9b8a6e9970c4a85b352
1 /* ------------------------------------------------------------------ */
2 /* WARNING: relative order of tokens is important. */
4 /* register */
5 DEF_ASM(al)
6 DEF_ASM(cl)
7 DEF_ASM(dl)
8 DEF_ASM(bl)
9 DEF_ASM(ah)
10 DEF_ASM(ch)
11 DEF_ASM(dh)
12 DEF_ASM(bh)
13 DEF_ASM(ax)
14 DEF_ASM(cx)
15 DEF_ASM(dx)
16 DEF_ASM(bx)
17 DEF_ASM(sp)
18 DEF_ASM(bp)
19 DEF_ASM(si)
20 DEF_ASM(di)
21 DEF_ASM(eax)
22 DEF_ASM(ecx)
23 DEF_ASM(edx)
24 DEF_ASM(ebx)
25 DEF_ASM(esp)
26 DEF_ASM(ebp)
27 DEF_ASM(esi)
28 DEF_ASM(edi)
29 #ifdef TCC_TARGET_X86_64
30 DEF_ASM(rax)
31 DEF_ASM(rcx)
32 DEF_ASM(rdx)
33 DEF_ASM(rbx)
34 DEF_ASM(rsp)
35 DEF_ASM(rbp)
36 DEF_ASM(rsi)
37 DEF_ASM(rdi)
38 DEF_ASM(rip)
39 #endif
40 DEF_ASM(mm0)
41 DEF_ASM(mm1)
42 DEF_ASM(mm2)
43 DEF_ASM(mm3)
44 DEF_ASM(mm4)
45 DEF_ASM(mm5)
46 DEF_ASM(mm6)
47 DEF_ASM(mm7)
48 DEF_ASM(xmm0)
49 DEF_ASM(xmm1)
50 DEF_ASM(xmm2)
51 DEF_ASM(xmm3)
52 DEF_ASM(xmm4)
53 DEF_ASM(xmm5)
54 DEF_ASM(xmm6)
55 DEF_ASM(xmm7)
56 DEF_ASM(cr0)
57 DEF_ASM(cr1)
58 DEF_ASM(cr2)
59 DEF_ASM(cr3)
60 DEF_ASM(cr4)
61 DEF_ASM(cr5)
62 DEF_ASM(cr6)
63 DEF_ASM(cr7)
64 DEF_ASM(tr0)
65 DEF_ASM(tr1)
66 DEF_ASM(tr2)
67 DEF_ASM(tr3)
68 DEF_ASM(tr4)
69 DEF_ASM(tr5)
70 DEF_ASM(tr6)
71 DEF_ASM(tr7)
72 DEF_ASM(db0)
73 DEF_ASM(db1)
74 DEF_ASM(db2)
75 DEF_ASM(db3)
76 DEF_ASM(db4)
77 DEF_ASM(db5)
78 DEF_ASM(db6)
79 DEF_ASM(db7)
80 DEF_ASM(dr0)
81 DEF_ASM(dr1)
82 DEF_ASM(dr2)
83 DEF_ASM(dr3)
84 DEF_ASM(dr4)
85 DEF_ASM(dr5)
86 DEF_ASM(dr6)
87 DEF_ASM(dr7)
88 DEF_ASM(es)
89 DEF_ASM(cs)
90 DEF_ASM(ss)
91 DEF_ASM(ds)
92 DEF_ASM(fs)
93 DEF_ASM(gs)
94 DEF_ASM(st)
96 /* generic two operands */
97 DEF_BWLX(mov)
99 DEF_BWLX(add)
100 DEF_BWLX(or)
101 DEF_BWLX(adc)
102 DEF_BWLX(sbb)
103 DEF_BWLX(and)
104 DEF_BWLX(sub)
105 DEF_BWLX(xor)
106 DEF_BWLX(cmp)
108 /* unary ops */
109 DEF_BWLX(inc)
110 DEF_BWLX(dec)
111 DEF_BWLX(not)
112 DEF_BWLX(neg)
113 DEF_BWLX(mul)
114 DEF_BWLX(imul)
115 DEF_BWLX(div)
116 DEF_BWLX(idiv)
118 DEF_BWLX(xchg)
119 DEF_BWLX(test)
121 /* shifts */
122 DEF_BWLX(rol)
123 DEF_BWLX(ror)
124 DEF_BWLX(rcl)
125 DEF_BWLX(rcr)
126 DEF_BWLX(shl)
127 DEF_BWLX(shr)
128 DEF_BWLX(sar)
130 DEF_WLX(shld)
131 DEF_WLX(shrd)
133 DEF_ASM(pushw)
134 DEF_ASM(pushl)
135 #ifdef TCC_TARGET_X86_64
136 DEF_ASM(pushq)
137 #endif
138 DEF_ASM(push)
140 DEF_ASM(popw)
141 DEF_ASM(popl)
142 #ifdef TCC_TARGET_X86_64
143 DEF_ASM(popq)
144 #endif
145 DEF_ASM(pop)
147 DEF_BWL(in)
148 DEF_BWL(out)
150 DEF_WLX(movzb)
151 DEF_ASM(movzwl)
152 DEF_ASM(movsbw)
153 DEF_ASM(movsbl)
154 DEF_ASM(movswl)
155 #ifdef TCC_TARGET_X86_64
156 DEF_ASM(movsbq)
157 DEF_ASM(movswq)
158 DEF_ASM(movzwq)
159 DEF_ASM(movslq)
160 #endif
162 DEF_WLX(lea)
164 DEF_ASM(les)
165 DEF_ASM(lds)
166 DEF_ASM(lss)
167 DEF_ASM(lfs)
168 DEF_ASM(lgs)
170 DEF_ASM(call)
171 DEF_ASM(jmp)
172 DEF_ASM(lcall)
173 DEF_ASM(ljmp)
175 DEF_ASMTEST(j,)
177 DEF_ASMTEST(set,)
178 DEF_ASMTEST(set,b)
179 DEF_ASMTEST(cmov,)
181 DEF_WLX(bsf)
182 DEF_WLX(bsr)
183 DEF_WLX(bt)
184 DEF_WLX(bts)
185 DEF_WLX(btr)
186 DEF_WLX(btc)
188 DEF_WLX(lsl)
190 /* generic FP ops */
191 DEF_FP(add)
192 DEF_FP(mul)
194 DEF_ASM(fcom)
195 DEF_ASM(fcom_1) /* non existent op, just to have a regular table */
196 DEF_FP1(com)
198 DEF_FP(comp)
199 DEF_FP(sub)
200 DEF_FP(subr)
201 DEF_FP(div)
202 DEF_FP(divr)
204 DEF_BWLX(xadd)
205 DEF_BWLX(cmpxchg)
207 /* string ops */
208 DEF_BWLX(cmps)
209 DEF_BWLX(scmp)
210 DEF_BWL(ins)
211 DEF_BWL(outs)
212 DEF_BWLX(lods)
213 DEF_BWLX(slod)
214 DEF_BWLX(movs)
215 DEF_BWLX(smov)
216 DEF_BWLX(scas)
217 DEF_BWLX(ssca)
218 DEF_BWLX(stos)
219 DEF_BWLX(ssto)
221 /* generic asm ops */
222 #define ALT(x)
223 #define DEF_ASM_OP0(name, opcode) DEF_ASM(name)
224 #define DEF_ASM_OP0L(name, opcode, group, instr_type)
225 #define DEF_ASM_OP1(name, opcode, group, instr_type, op0)
226 #define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1)
227 #define DEF_ASM_OP3(name, opcode, group, instr_type, op0, op1, op2)
228 #ifdef TCC_TARGET_X86_64
229 # include "x86_64-asm.h"
230 #else
231 # include "i386-asm.h"
232 #endif
234 #define ALT(x)
235 #define DEF_ASM_OP0(name, opcode)
236 #define DEF_ASM_OP0L(name, opcode, group, instr_type) DEF_ASM(name)
237 #define DEF_ASM_OP1(name, opcode, group, instr_type, op0) DEF_ASM(name)
238 #define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) DEF_ASM(name)
239 #define DEF_ASM_OP3(name, opcode, group, instr_type, op0, op1, op2) DEF_ASM(name)
240 #ifdef TCC_TARGET_X86_64
241 # include "x86_64-asm.h"
242 #else
243 # include "i386-asm.h"
244 #endif