tccgen: nocode_wanted: do not output constants
[tinycc.git] / i386-tok.h
1 /* ------------------------------------------------------------------ */
2 /* WARNING: relative order of tokens is important. */
3
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 #endif
39 DEF_ASM(mm0)
40 DEF_ASM(mm1)
41 DEF_ASM(mm2)
42 DEF_ASM(mm3)
43 DEF_ASM(mm4)
44 DEF_ASM(mm5)
45 DEF_ASM(mm6)
46 DEF_ASM(mm7)
47 DEF_ASM(xmm0)
48 DEF_ASM(xmm1)
49 DEF_ASM(xmm2)
50 DEF_ASM(xmm3)
51 DEF_ASM(xmm4)
52 DEF_ASM(xmm5)
53 DEF_ASM(xmm6)
54 DEF_ASM(xmm7)
55 DEF_ASM(cr0)
56 DEF_ASM(cr1)
57 DEF_ASM(cr2)
58 DEF_ASM(cr3)
59 DEF_ASM(cr4)
60 DEF_ASM(cr5)
61 DEF_ASM(cr6)
62 DEF_ASM(cr7)
63 DEF_ASM(tr0)
64 DEF_ASM(tr1)
65 DEF_ASM(tr2)
66 DEF_ASM(tr3)
67 DEF_ASM(tr4)
68 DEF_ASM(tr5)
69 DEF_ASM(tr6)
70 DEF_ASM(tr7)
71 DEF_ASM(db0)
72 DEF_ASM(db1)
73 DEF_ASM(db2)
74 DEF_ASM(db3)
75 DEF_ASM(db4)
76 DEF_ASM(db5)
77 DEF_ASM(db6)
78 DEF_ASM(db7)
79 DEF_ASM(dr0)
80 DEF_ASM(dr1)
81 DEF_ASM(dr2)
82 DEF_ASM(dr3)
83 DEF_ASM(dr4)
84 DEF_ASM(dr5)
85 DEF_ASM(dr6)
86 DEF_ASM(dr7)
87 DEF_ASM(es)
88 DEF_ASM(cs)
89 DEF_ASM(ss)
90 DEF_ASM(ds)
91 DEF_ASM(fs)
92 DEF_ASM(gs)
93 DEF_ASM(st)
94
95 /* generic two operands */
96 DEF_BWLX(mov)
97
98 DEF_BWLX(add)
99 DEF_BWLX(or)
100 DEF_BWLX(adc)
101 DEF_BWLX(sbb)
102 DEF_BWLX(and)
103 DEF_BWLX(sub)
104 DEF_BWLX(xor)
105 DEF_BWLX(cmp)
106
107 /* unary ops */
108 DEF_BWLX(inc)
109 DEF_BWLX(dec)
110 DEF_BWLX(not)
111 DEF_BWLX(neg)
112 DEF_BWLX(mul)
113 DEF_BWLX(imul)
114 DEF_BWLX(div)
115 DEF_BWLX(idiv)
116
117 DEF_BWLX(xchg)
118 DEF_BWLX(test)
119
120 /* shifts */
121 DEF_BWLX(rol)
122 DEF_BWLX(ror)
123 DEF_BWLX(rcl)
124 DEF_BWLX(rcr)
125 DEF_BWLX(shl)
126 DEF_BWLX(shr)
127 DEF_BWLX(sar)
128
129 DEF_ASM(shldw)
130 DEF_ASM(shldl)
131 DEF_ASM(shld)
132 DEF_ASM(shrdw)
133 DEF_ASM(shrdl)
134 DEF_ASM(shrd)
135
136 DEF_ASM(pushw)
137 DEF_ASM(pushl)
138 #ifdef TCC_TARGET_X86_64
139 DEF_ASM(pushq)
140 #endif
141 DEF_ASM(push)
142
143 DEF_ASM(popw)
144 DEF_ASM(popl)
145 #ifdef TCC_TARGET_X86_64
146 DEF_ASM(popq)
147 #endif
148 DEF_ASM(pop)
149
150 DEF_BWL(in)
151 DEF_BWL(out)
152
153 DEF_WL(movzb)
154 DEF_ASM(movzwl)
155 DEF_ASM(movsbw)
156 DEF_ASM(movsbl)
157 DEF_ASM(movswl)
158 #ifdef TCC_TARGET_X86_64
159 DEF_ASM(movslq)
160 #endif
161
162 DEF_WLX(lea)
163
164 DEF_ASM(les)
165 DEF_ASM(lds)
166 DEF_ASM(lss)
167 DEF_ASM(lfs)
168 DEF_ASM(lgs)
169
170 DEF_ASM(call)
171 DEF_ASM(jmp)
172 DEF_ASM(lcall)
173 DEF_ASM(ljmp)
174
175 DEF_ASMTEST(j)
176
177 DEF_ASMTEST(set)
178 DEF_ASMTEST(cmov)
179
180 DEF_WLX(bsf)
181 DEF_WLX(bsr)
182 DEF_WLX(bt)
183 DEF_WLX(bts)
184 DEF_WLX(btr)
185 DEF_WLX(btc)
186
187 DEF_WLX(lsl)
188
189 /* generic FP ops */
190 DEF_FP(add)
191 DEF_FP(mul)
192
193 DEF_ASM(fcom)
194 DEF_ASM(fcom_1) /* non existent op, just to have a regular table */
195 DEF_FP1(com)
196
197 DEF_FP(comp)
198 DEF_FP(sub)
199 DEF_FP(subr)
200 DEF_FP(div)
201 DEF_FP(divr)
202
203 DEF_BWLX(xadd)
204 DEF_BWLX(cmpxchg)
205
206 /* string ops */
207 DEF_BWLX(cmps)
208 DEF_BWLX(scmp)
209 DEF_BWL(ins)
210 DEF_BWL(outs)
211 DEF_BWLX(lods)
212 DEF_BWLX(slod)
213 DEF_BWLX(movs)
214 DEF_BWLX(smov)
215 DEF_BWLX(scas)
216 DEF_BWLX(ssca)
217 DEF_BWLX(stos)
218 DEF_BWLX(ssto)
219
220 /* generic asm ops */
221 #define ALT(x)
222 #define DEF_ASM_OP0(name, opcode) DEF_ASM(name)
223 #define DEF_ASM_OP0L(name, opcode, group, instr_type)
224 #define DEF_ASM_OP1(name, opcode, group, instr_type, op0)
225 #define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1)
226 #define DEF_ASM_OP3(name, opcode, group, instr_type, op0, op1, op2)
227 #ifdef TCC_TARGET_X86_64
228 # include "x86_64-asm.h"
229 #else
230 # include "i386-asm.h"
231 #endif
232
233 #define ALT(x)
234 #define DEF_ASM_OP0(name, opcode)
235 #define DEF_ASM_OP0L(name, opcode, group, instr_type) DEF_ASM(name)
236 #define DEF_ASM_OP1(name, opcode, group, instr_type, op0) DEF_ASM(name)
237 #define DEF_ASM_OP2(name, opcode, group, instr_type, op0, op1) DEF_ASM(name)
238 #define DEF_ASM_OP3(name, opcode, group, instr_type, op0, op1, op2) DEF_ASM(name)
239 #ifdef TCC_TARGET_X86_64
240 # include "x86_64-asm.h"
241 #else
242 # include "i386-asm.h"
243 #endif