* lib/gdb.exp (gdb_compile): Also set rpath for shlib=, on a
[deliverable/binutils-gdb.git] / opcodes / i386-gen.c
CommitLineData
22da050b
L
1/* Copyright 2007, 2008, 2009
2 Free Software Foundation, Inc.
40b8e679 3
9b201bb5 4 This file is part of the GNU opcodes library.
40b8e679 5
9b201bb5 6 This library is free software; you can redistribute it and/or modify
40b8e679 7 it under the terms of the GNU General Public License as published by
9b201bb5
NC
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
40b8e679 10
9b201bb5
NC
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
40b8e679
L
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
9b201bb5
NC
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
40b8e679 20
40fb9820 21#include "sysdep.h"
40b8e679 22#include <stdio.h>
40b8e679
L
23#include <errno.h>
24#include "getopt.h"
25#include "libiberty.h"
c587b3f9 26#include "hashtab.h"
40b8e679
L
27#include "safe-ctype.h"
28
29#include "i386-opc.h"
30
31#include <libintl.h>
32#define _(String) gettext (String)
33
34static const char *program_name = NULL;
35static int debug = 0;
36
40fb9820
L
37typedef struct initializer
38{
39 const char *name;
40 const char *init;
41} initializer;
42
8acd5377 43static initializer cpu_flag_init[] =
40fb9820
L
44{
45 { "CPU_UNKNOWN_FLAGS",
8a9036a4 46 "~CpuL1OM" },
40fb9820
L
47 { "CPU_GENERIC32_FLAGS",
48 "Cpu186|Cpu286|Cpu386" },
49 { "CPU_GENERIC64_FLAGS",
309d3373 50 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuClflush|Cpu387|Cpu687|CpuMMX|CpuSSE|CpuSSE2|CpuLM" },
40fb9820
L
51 { "CPU_NONE_FLAGS",
52 "0" },
53 { "CPU_I186_FLAGS",
54 "Cpu186" },
55 { "CPU_I286_FLAGS",
56 "Cpu186|Cpu286" },
57 { "CPU_I386_FLAGS",
58 "Cpu186|Cpu286|Cpu386" },
59 { "CPU_I486_FLAGS",
60 "Cpu186|Cpu286|Cpu386|Cpu486" },
61 { "CPU_I586_FLAGS",
309d3373 62 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu387" },
40fb9820 63 { "CPU_I686_FLAGS",
309d3373 64 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|Cpu387|Cpu687" },
40fb9820 65 { "CPU_P2_FLAGS",
309d3373 66 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|Cpu387|Cpu687|CpuMMX" },
40fb9820 67 { "CPU_P3_FLAGS",
309d3373 68 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|Cpu387|Cpu687|CpuMMX|CpuSSE" },
40fb9820 69 { "CPU_P4_FLAGS",
309d3373 70 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuClflush|Cpu387|Cpu687|CpuMMX|CpuSSE|CpuSSE2" },
40fb9820 71 { "CPU_NOCONA_FLAGS",
309d3373 72 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuClflush|Cpu387|Cpu687|CpuFISTTP|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuLM" },
40fb9820 73 { "CPU_CORE_FLAGS",
309d3373 74 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuClflush|Cpu387|Cpu687|CpuFISTTP|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3" },
40fb9820 75 { "CPU_CORE2_FLAGS",
309d3373 76 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuClflush|Cpu387|Cpu687|CpuFISTTP|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuLM" },
bd5295b2 77 { "CPU_COREI7_FLAGS",
309d3373 78 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuClflush|Cpu387|Cpu687|CpuFISTTP|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuRdtscp|CpuLM" },
40fb9820 79 { "CPU_K6_FLAGS",
309d3373 80 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuSYSCALL|Cpu387|CpuMMX" },
40fb9820 81 { "CPU_K6_2_FLAGS",
309d3373 82 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|CpuSYSCALL|Cpu387|CpuMMX|Cpu3dnow" },
40fb9820 83 { "CPU_ATHLON_FLAGS",
309d3373 84 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|Cpu387|Cpu687|CpuMMX|Cpu3dnow|Cpu3dnowA" },
40fb9820 85 { "CPU_K8_FLAGS",
309d3373 86 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuMMX|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2|CpuLM" },
40fb9820 87 { "CPU_AMDFAM10_FLAGS",
309d3373
JB
88 "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuFISTTP|CpuMMX|Cpu3dnow|Cpu3dnowA|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a|CpuABM|CpuLM" },
89 { "CPU_8087_FLAGS",
90 "Cpu8087" },
91 { "CPU_287_FLAGS",
92 "Cpu287" },
93 { "CPU_387_FLAGS",
94 "Cpu387" },
95 { "CPU_ANY87_FLAGS",
96 "Cpu8087|Cpu287|Cpu387|Cpu687|CpuFISTTP" },
bd5295b2
L
97 { "CPU_CLFLUSH_FLAGS",
98 "CpuClflush" },
99 { "CPU_SYSCALL_FLAGS",
100 "CpuSYSCALL" },
40fb9820
L
101 { "CPU_MMX_FLAGS",
102 "CpuMMX" },
103 { "CPU_SSE_FLAGS",
115c7c25 104 "CpuMMX|CpuSSE" },
40fb9820 105 { "CPU_SSE2_FLAGS",
115c7c25 106 "CpuMMX|CpuSSE|CpuSSE2" },
40fb9820 107 { "CPU_SSE3_FLAGS",
115c7c25 108 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3" },
40fb9820 109 { "CPU_SSSE3_FLAGS",
115c7c25 110 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3" },
40fb9820 111 { "CPU_SSE4_1_FLAGS",
115c7c25 112 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1" },
40fb9820 113 { "CPU_SSE4_2_FLAGS",
115c7c25 114 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2" },
309d3373
JB
115 { "CPU_ANY_SSE_FLAGS",
116 "CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuSSE4a|CpuAVX" },
6305a203
L
117 { "CPU_VMX_FLAGS",
118 "CpuVMX" },
119 { "CPU_SMX_FLAGS",
120 "CpuSMX" },
f03fe4c1
L
121 { "CPU_XSAVE_FLAGS",
122 "CpuXsave" },
c0f3af97
L
123 { "CPU_AES_FLAGS",
124 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuAES" },
594ab6a3
L
125 { "CPU_PCLMUL_FLAGS",
126 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuPCLMUL" },
c0f3af97
L
127 { "CPU_FMA_FLAGS",
128 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuAVX|CpuFMA" },
922d8de8
DR
129 { "CPU_FMA4_FLAGS",
130 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuAVX|CpuFMA4" },
f88c9eb0
SP
131 { "CPU_LWP_FLAGS",
132 "CpuLWP" },
f1f8f695
L
133 { "CPU_MOVBE_FLAGS",
134 "CpuMovbe" },
1b7f3fb0
L
135 { "CPU_RDTSCP_FLAGS",
136 "CpuRdtscp" },
f1f8f695
L
137 { "CPU_EPT_FLAGS",
138 "CpuEPT" },
40fb9820
L
139 { "CPU_3DNOW_FLAGS",
140 "CpuMMX|Cpu3dnow" },
141 { "CPU_3DNOWA_FLAGS",
115c7c25 142 "CpuMMX|Cpu3dnow|Cpu3dnowA" },
40fb9820
L
143 { "CPU_PADLOCK_FLAGS",
144 "CpuPadLock" },
145 { "CPU_SVME_FLAGS",
146 "CpuSVME" },
147 { "CPU_SSE4A_FLAGS",
115c7c25 148 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a" },
40fb9820 149 { "CPU_ABM_FLAGS",
3629bb00 150 "CpuABM" },
c0f3af97
L
151 { "CPU_AVX_FLAGS",
152 "CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuAVX" },
309d3373
JB
153 { "CPU_ANY_AVX_FLAGS",
154 "CpuAVX" },
8a9036a4
L
155 { "CPU_L1OM_FLAGS",
156 "unknown" },
40fb9820
L
157};
158
8acd5377 159static initializer operand_type_init[] =
40fb9820
L
160{
161 { "OPERAND_TYPE_NONE",
162 "0" },
163 { "OPERAND_TYPE_REG8",
164 "Reg8" },
165 { "OPERAND_TYPE_REG16",
166 "Reg16" },
167 { "OPERAND_TYPE_REG32",
168 "Reg32" },
169 { "OPERAND_TYPE_REG64",
170 "Reg64" },
171 { "OPERAND_TYPE_IMM1",
172 "Imm1" },
173 { "OPERAND_TYPE_IMM8",
174 "Imm8" },
175 { "OPERAND_TYPE_IMM8S",
176 "Imm8S" },
177 { "OPERAND_TYPE_IMM16",
178 "Imm16" },
179 { "OPERAND_TYPE_IMM32",
180 "Imm32" },
181 { "OPERAND_TYPE_IMM32S",
182 "Imm32S" },
183 { "OPERAND_TYPE_IMM64",
184 "Imm64" },
185 { "OPERAND_TYPE_BASEINDEX",
186 "BaseIndex" },
187 { "OPERAND_TYPE_DISP8",
188 "Disp8" },
189 { "OPERAND_TYPE_DISP16",
190 "Disp16" },
191 { "OPERAND_TYPE_DISP32",
192 "Disp32" },
193 { "OPERAND_TYPE_DISP32S",
194 "Disp32S" },
195 { "OPERAND_TYPE_DISP64",
196 "Disp64" },
197 { "OPERAND_TYPE_INOUTPORTREG",
198 "InOutPortReg" },
199 { "OPERAND_TYPE_SHIFTCOUNT",
200 "ShiftCount" },
201 { "OPERAND_TYPE_CONTROL",
202 "Control" },
203 { "OPERAND_TYPE_TEST",
204 "Test" },
205 { "OPERAND_TYPE_DEBUG",
206 "FloatReg" },
207 { "OPERAND_TYPE_FLOATREG",
208 "FloatReg" },
209 { "OPERAND_TYPE_FLOATACC",
210 "FloatAcc" },
211 { "OPERAND_TYPE_SREG2",
212 "SReg2" },
213 { "OPERAND_TYPE_SREG3",
214 "SReg3" },
215 { "OPERAND_TYPE_ACC",
216 "Acc" },
217 { "OPERAND_TYPE_JUMPABSOLUTE",
218 "JumpAbsolute" },
219 { "OPERAND_TYPE_REGMMX",
220 "RegMMX" },
221 { "OPERAND_TYPE_REGXMM",
222 "RegXMM" },
c0f3af97
L
223 { "OPERAND_TYPE_REGYMM",
224 "RegYMM" },
40fb9820
L
225 { "OPERAND_TYPE_ESSEG",
226 "EsSeg" },
227 { "OPERAND_TYPE_ACC32",
7d5e4556 228 "Reg32|Acc|Dword" },
40fb9820 229 { "OPERAND_TYPE_ACC64",
7d5e4556 230 "Reg64|Acc|Qword" },
65da13b5
L
231 { "OPERAND_TYPE_INOUTPORTREG",
232 "InOutPortReg" },
40fb9820
L
233 { "OPERAND_TYPE_REG16_INOUTPORTREG",
234 "Reg16|InOutPortReg" },
235 { "OPERAND_TYPE_DISP16_32",
236 "Disp16|Disp32" },
237 { "OPERAND_TYPE_ANYDISP",
238 "Disp8|Disp16|Disp32|Disp32S|Disp64" },
239 { "OPERAND_TYPE_IMM16_32",
240 "Imm16|Imm32" },
241 { "OPERAND_TYPE_IMM16_32S",
242 "Imm16|Imm32S" },
243 { "OPERAND_TYPE_IMM16_32_32S",
244 "Imm16|Imm32|Imm32S" },
245 { "OPERAND_TYPE_IMM32_32S_DISP32",
246 "Imm32|Imm32S|Disp32" },
247 { "OPERAND_TYPE_IMM64_DISP64",
248 "Imm64|Disp64" },
249 { "OPERAND_TYPE_IMM32_32S_64_DISP32",
250 "Imm32|Imm32S|Imm64|Disp32" },
251 { "OPERAND_TYPE_IMM32_32S_64_DISP32_64",
252 "Imm32|Imm32S|Imm64|Disp32|Disp64" },
253};
254
255typedef struct bitfield
256{
257 int position;
258 int value;
259 const char *name;
260} bitfield;
261
262#define BITFIELD(n) { n, 0, #n }
263
264static bitfield cpu_flags[] =
265{
266 BITFIELD (Cpu186),
267 BITFIELD (Cpu286),
268 BITFIELD (Cpu386),
269 BITFIELD (Cpu486),
270 BITFIELD (Cpu586),
271 BITFIELD (Cpu686),
bd5295b2
L
272 BITFIELD (CpuClflush),
273 BITFIELD (CpuSYSCALL),
309d3373
JB
274 BITFIELD (Cpu8087),
275 BITFIELD (Cpu287),
276 BITFIELD (Cpu387),
277 BITFIELD (Cpu687),
278 BITFIELD (CpuFISTTP),
40fb9820 279 BITFIELD (CpuMMX),
40fb9820
L
280 BITFIELD (CpuSSE),
281 BITFIELD (CpuSSE2),
282 BITFIELD (CpuSSE3),
283 BITFIELD (CpuSSSE3),
284 BITFIELD (CpuSSE4_1),
285 BITFIELD (CpuSSE4_2),
c0f3af97 286 BITFIELD (CpuAVX),
8a9036a4 287 BITFIELD (CpuL1OM),
40fb9820
L
288 BITFIELD (CpuSSE4a),
289 BITFIELD (Cpu3dnow),
290 BITFIELD (Cpu3dnowA),
291 BITFIELD (CpuPadLock),
292 BITFIELD (CpuSVME),
293 BITFIELD (CpuVMX),
47dd174c 294 BITFIELD (CpuSMX),
40fb9820 295 BITFIELD (CpuABM),
475a2301 296 BITFIELD (CpuXsave),
c0f3af97 297 BITFIELD (CpuAES),
594ab6a3 298 BITFIELD (CpuPCLMUL),
c0f3af97 299 BITFIELD (CpuFMA),
f88c9eb0
SP
300 BITFIELD (CpuFMA4),
301 BITFIELD (CpuLWP),
c0f3af97 302 BITFIELD (CpuLM),
f1f8f695
L
303 BITFIELD (CpuMovbe),
304 BITFIELD (CpuEPT),
1b7f3fb0 305 BITFIELD (CpuRdtscp),
40fb9820
L
306 BITFIELD (Cpu64),
307 BITFIELD (CpuNo64),
308#ifdef CpuUnused
309 BITFIELD (CpuUnused),
310#endif
311};
312
313static bitfield opcode_modifiers[] =
314{
315 BITFIELD (D),
316 BITFIELD (W),
b6169b20 317 BITFIELD (S),
40fb9820
L
318 BITFIELD (Modrm),
319 BITFIELD (ShortForm),
320 BITFIELD (Jump),
321 BITFIELD (JumpDword),
322 BITFIELD (JumpByte),
323 BITFIELD (JumpInterSegment),
324 BITFIELD (FloatMF),
325 BITFIELD (FloatR),
326 BITFIELD (FloatD),
327 BITFIELD (Size16),
328 BITFIELD (Size32),
329 BITFIELD (Size64),
330 BITFIELD (IgnoreSize),
331 BITFIELD (DefaultSize),
332 BITFIELD (No_bSuf),
333 BITFIELD (No_wSuf),
334 BITFIELD (No_lSuf),
335 BITFIELD (No_sSuf),
336 BITFIELD (No_qSuf),
7ce189b3 337 BITFIELD (No_ldSuf),
40fb9820
L
338 BITFIELD (FWait),
339 BITFIELD (IsString),
340 BITFIELD (RegKludge),
e2ec9d29 341 BITFIELD (FirstXmm0),
c0f3af97 342 BITFIELD (Implicit1stXmm0),
ca61edf2
L
343 BITFIELD (ByteOkIntel),
344 BITFIELD (ToDword),
345 BITFIELD (ToQword),
346 BITFIELD (AddrPrefixOp0),
40fb9820
L
347 BITFIELD (IsPrefix),
348 BITFIELD (ImmExt),
349 BITFIELD (NoRex64),
350 BITFIELD (Rex64),
351 BITFIELD (Ugh),
c0f3af97 352 BITFIELD (Vex),
c0f3af97 353 BITFIELD (VexNDS),
03547503 354 BITFIELD (VexNDD),
f88c9eb0 355 BITFIELD (VexLWP),
c0f3af97
L
356 BITFIELD (VexW0),
357 BITFIELD (VexW1),
358 BITFIELD (Vex0F),
359 BITFIELD (Vex0F38),
360 BITFIELD (Vex0F3A),
f88c9eb0
SP
361 BITFIELD (XOP09),
362 BITFIELD (XOP0A),
c0f3af97
L
363 BITFIELD (Vex3Sources),
364 BITFIELD (VexImmExt),
365 BITFIELD (SSE2AVX),
81f8a913 366 BITFIELD (NoAVX),
1efbbeb4
L
367 BITFIELD (OldGcc),
368 BITFIELD (ATTMnemonic),
e1d4d893 369 BITFIELD (ATTSyntax),
5c07affc 370 BITFIELD (IntelSyntax),
40fb9820
L
371};
372
373static bitfield operand_types[] =
374{
375 BITFIELD (Reg8),
376 BITFIELD (Reg16),
377 BITFIELD (Reg32),
378 BITFIELD (Reg64),
379 BITFIELD (FloatReg),
380 BITFIELD (RegMMX),
381 BITFIELD (RegXMM),
c0f3af97 382 BITFIELD (RegYMM),
40fb9820
L
383 BITFIELD (Imm8),
384 BITFIELD (Imm8S),
385 BITFIELD (Imm16),
386 BITFIELD (Imm32),
387 BITFIELD (Imm32S),
388 BITFIELD (Imm64),
389 BITFIELD (Imm1),
390 BITFIELD (BaseIndex),
391 BITFIELD (Disp8),
392 BITFIELD (Disp16),
393 BITFIELD (Disp32),
394 BITFIELD (Disp32S),
395 BITFIELD (Disp64),
396 BITFIELD (InOutPortReg),
397 BITFIELD (ShiftCount),
398 BITFIELD (Control),
399 BITFIELD (Debug),
400 BITFIELD (Test),
401 BITFIELD (SReg2),
402 BITFIELD (SReg3),
403 BITFIELD (Acc),
404 BITFIELD (FloatAcc),
405 BITFIELD (JumpAbsolute),
406 BITFIELD (EsSeg),
407 BITFIELD (RegMem),
5c07affc 408 BITFIELD (Mem),
7d5e4556
L
409 BITFIELD (Byte),
410 BITFIELD (Word),
411 BITFIELD (Dword),
412 BITFIELD (Fword),
413 BITFIELD (Qword),
414 BITFIELD (Tbyte),
415 BITFIELD (Xmmword),
c0f3af97 416 BITFIELD (Ymmword),
7d5e4556
L
417 BITFIELD (Unspecified),
418 BITFIELD (Anysize),
40fb9820
L
419#ifdef OTUnused
420 BITFIELD (OTUnused),
421#endif
422};
423
3d4d5afa
L
424static const char *filename;
425
40fb9820
L
426static int
427compare (const void *x, const void *y)
428{
429 const bitfield *xp = (const bitfield *) x;
430 const bitfield *yp = (const bitfield *) y;
431 return xp->position - yp->position;
432}
433
40b8e679
L
434static void
435fail (const char *message, ...)
436{
437 va_list args;
438
439 va_start (args, message);
440 fprintf (stderr, _("%s: Error: "), program_name);
441 vfprintf (stderr, message, args);
442 va_end (args);
443 xexit (1);
444}
445
72ffa0fb
L
446static void
447process_copyright (FILE *fp)
448{
449 fprintf (fp, "/* This file is automatically generated by i386-gen. Do not edit! */\n\
22da050b
L
450/* Copyright 2007, 2008, 2009\n\
451 Free Software Foundation, Inc.\n\
72ffa0fb
L
452\n\
453 This file is part of the GNU opcodes library.\n\
454\n\
455 This library is free software; you can redistribute it and/or modify\n\
456 it under the terms of the GNU General Public License as published by\n\
457 the Free Software Foundation; either version 3, or (at your option)\n\
458 any later version.\n\
459\n\
460 It is distributed in the hope that it will be useful, but WITHOUT\n\
461 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n\
462 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public\n\
463 License for more details.\n\
464\n\
465 You should have received a copy of the GNU General Public License\n\
466 along with this program; if not, write to the Free Software\n\
467 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,\n\
468 MA 02110-1301, USA. */\n");
469}
470
40b8e679
L
471/* Remove leading white spaces. */
472
473static char *
474remove_leading_whitespaces (char *str)
475{
476 while (ISSPACE (*str))
477 str++;
478 return str;
479}
480
481/* Remove trailing white spaces. */
482
483static void
484remove_trailing_whitespaces (char *str)
485{
486 size_t last = strlen (str);
487
488 if (last == 0)
489 return;
490
491 do
492 {
493 last--;
494 if (ISSPACE (str [last]))
495 str[last] = '\0';
496 else
497 break;
498 }
499 while (last != 0);
500}
501
93b1ec2c 502/* Find next field separated by SEP and terminate it. Return a
40b8e679
L
503 pointer to the one after it. */
504
505static char *
c587b3f9 506next_field (char *str, char sep, char **next, char *last)
40b8e679
L
507{
508 char *p;
509
510 p = remove_leading_whitespaces (str);
93b1ec2c 511 for (str = p; *str != sep && *str != '\0'; str++);
40b8e679
L
512
513 *str = '\0';
514 remove_trailing_whitespaces (p);
515
516 *next = str + 1;
517
c587b3f9
L
518 if (p >= last)
519 abort ();
520
40b8e679
L
521 return p;
522}
523
40fb9820 524static void
8a9036a4
L
525set_bitfield (const char *f, bitfield *array, int value,
526 unsigned int size, int lineno)
40fb9820
L
527{
528 unsigned int i;
529
309d3373
JB
530 if (strcmp (f, "CpuFP") == 0)
531 {
8a9036a4
L
532 set_bitfield("Cpu387", array, value, size, lineno);
533 set_bitfield("Cpu287", array, value, size, lineno);
309d3373
JB
534 f = "Cpu8087";
535 }
536 else if (strcmp (f, "Mmword") == 0)
7d5e4556
L
537 f= "Qword";
538 else if (strcmp (f, "Oword") == 0)
539 f= "Xmmword";
40fb9820
L
540
541 for (i = 0; i < size; i++)
542 if (strcasecmp (array[i].name, f) == 0)
543 {
8a9036a4 544 array[i].value = value;
40fb9820
L
545 return;
546 }
547
2bf05e57
L
548 if (value)
549 {
550 const char *v = strchr (f, '=');
551
552 if (v)
553 {
554 size_t n = v - f;
555 char *end;
556
557 for (i = 0; i < size; i++)
558 if (strncasecmp (array[i].name, f, n) == 0)
559 {
560 value = strtol (v + 1, &end, 0);
561 if (*end == '\0')
562 {
563 array[i].value = value;
564 return;
565 }
566 break;
567 }
568 }
569 }
570
bd5295b2
L
571 if (lineno != -1)
572 fail (_("%s: %d: Unknown bitfield: %s\n"), filename, lineno, f);
573 else
574 fail (_("Unknown bitfield: %s\n"), f);
40fb9820
L
575}
576
577static void
578output_cpu_flags (FILE *table, bitfield *flags, unsigned int size,
579 int macro, const char *comma, const char *indent)
580{
581 unsigned int i;
582
583 fprintf (table, "%s{ { ", indent);
584
585 for (i = 0; i < size - 1; i++)
586 {
587 fprintf (table, "%d, ", flags[i].value);
588 if (((i + 1) % 20) == 0)
589 {
590 /* We need \\ for macro. */
591 if (macro)
592 fprintf (table, " \\\n %s", indent);
593 else
594 fprintf (table, "\n %s", indent);
595 }
596 }
597
598 fprintf (table, "%d } }%s\n", flags[i].value, comma);
599}
600
601static void
602process_i386_cpu_flag (FILE *table, char *flag, int macro,
bd5295b2
L
603 const char *comma, const char *indent,
604 int lineno)
40fb9820
L
605{
606 char *str, *next, *last;
8a9036a4 607 unsigned int i;
40fb9820
L
608 bitfield flags [ARRAY_SIZE (cpu_flags)];
609
610 /* Copy the default cpu flags. */
611 memcpy (flags, cpu_flags, sizeof (cpu_flags));
612
613 if (strcasecmp (flag, "unknown") == 0)
614 {
40fb9820 615 /* We turn on everything except for cpu64 in case of
8a9036a4
L
616 CPU_UNKNOWN_FLAGS. */
617 for (i = 0; i < ARRAY_SIZE (flags); i++)
618 if (flags[i].position != Cpu64)
619 flags[i].value = 1;
620 }
621 else if (flag[0] == '~')
622 {
623 last = flag + strlen (flag);
624
625 if (flag[1] == '(')
626 {
627 last -= 1;
628 next = flag + 2;
629 if (*last != ')')
630 fail (_("%s: %d: Missing `)' in bitfield: %s\n"), filename,
631 lineno, flag);
632 *last = '\0';
633 }
634 else
635 next = flag + 1;
636
637 /* First we turn on everything except for cpu64. */
40fb9820
L
638 for (i = 0; i < ARRAY_SIZE (flags); i++)
639 if (flags[i].position != Cpu64)
640 flags[i].value = 1;
8a9036a4
L
641
642 /* Turn off selective bits. */
643 for (; next && next < last; )
644 {
645 str = next_field (next, '|', &next, last);
646 if (str)
647 set_bitfield (str, flags, 0, ARRAY_SIZE (flags), lineno);
648 }
40fb9820
L
649 }
650 else if (strcmp (flag, "0"))
651 {
8a9036a4 652 /* Turn on selective bits. */
40fb9820
L
653 last = flag + strlen (flag);
654 for (next = flag; next && next < last; )
655 {
c587b3f9 656 str = next_field (next, '|', &next, last);
40fb9820 657 if (str)
8a9036a4 658 set_bitfield (str, flags, 1, ARRAY_SIZE (flags), lineno);
40fb9820
L
659 }
660 }
661
662 output_cpu_flags (table, flags, ARRAY_SIZE (flags), macro,
663 comma, indent);
664}
665
666static void
667output_opcode_modifier (FILE *table, bitfield *modifier, unsigned int size)
668{
669 unsigned int i;
670
671 fprintf (table, " { ");
672
673 for (i = 0; i < size - 1; i++)
674 {
675 fprintf (table, "%d, ", modifier[i].value);
676 if (((i + 1) % 20) == 0)
677 fprintf (table, "\n ");
678 }
679
680 fprintf (table, "%d },\n", modifier[i].value);
681}
682
683static void
bd5295b2 684process_i386_opcode_modifier (FILE *table, char *mod, int lineno)
40fb9820
L
685{
686 char *str, *next, *last;
687 bitfield modifiers [ARRAY_SIZE (opcode_modifiers)];
688
689 /* Copy the default opcode modifier. */
690 memcpy (modifiers, opcode_modifiers, sizeof (modifiers));
691
692 if (strcmp (mod, "0"))
693 {
694 last = mod + strlen (mod);
695 for (next = mod; next && next < last; )
696 {
c587b3f9 697 str = next_field (next, '|', &next, last);
40fb9820 698 if (str)
8a9036a4
L
699 set_bitfield (str, modifiers, 1, ARRAY_SIZE (modifiers),
700 lineno);
40fb9820
L
701 }
702 }
703 output_opcode_modifier (table, modifiers, ARRAY_SIZE (modifiers));
704}
705
706static void
707output_operand_type (FILE *table, bitfield *types, unsigned int size,
708 int macro, const char *indent)
709{
710 unsigned int i;
711
712 fprintf (table, "{ { ");
713
714 for (i = 0; i < size - 1; i++)
715 {
716 fprintf (table, "%d, ", types[i].value);
717 if (((i + 1) % 20) == 0)
718 {
719 /* We need \\ for macro. */
720 if (macro)
721 fprintf (table, "\\\n%s", indent);
722 else
723 fprintf (table, "\n%s", indent);
724 }
725 }
726
727 fprintf (table, "%d } }", types[i].value);
728}
729
730static void
731process_i386_operand_type (FILE *table, char *op, int macro,
bd5295b2 732 const char *indent, int lineno)
40fb9820
L
733{
734 char *str, *next, *last;
735 bitfield types [ARRAY_SIZE (operand_types)];
736
737 /* Copy the default operand type. */
738 memcpy (types, operand_types, sizeof (types));
739
740 if (strcmp (op, "0"))
741 {
742 last = op + strlen (op);
743 for (next = op; next && next < last; )
744 {
c587b3f9 745 str = next_field (next, '|', &next, last);
40fb9820 746 if (str)
8a9036a4 747 set_bitfield (str, types, 1, ARRAY_SIZE (types), lineno);
40fb9820
L
748 }
749 }
750 output_operand_type (table, types, ARRAY_SIZE (types), macro,
751 indent);
752}
753
c587b3f9
L
754static void
755output_i386_opcode (FILE *table, const char *name, char *str,
bd5295b2 756 char *last, int lineno)
c587b3f9
L
757{
758 unsigned int i;
759 char *operands, *base_opcode, *extension_opcode, *opcode_length;
760 char *cpu_flags, *opcode_modifier, *operand_types [MAX_OPERANDS];
761
762 /* Find number of operands. */
763 operands = next_field (str, ',', &str, last);
764
765 /* Find base_opcode. */
766 base_opcode = next_field (str, ',', &str, last);
767
768 /* Find extension_opcode. */
769 extension_opcode = next_field (str, ',', &str, last);
770
771 /* Find opcode_length. */
772 opcode_length = next_field (str, ',', &str, last);
773
774 /* Find cpu_flags. */
775 cpu_flags = next_field (str, ',', &str, last);
776
777 /* Find opcode_modifier. */
778 opcode_modifier = next_field (str, ',', &str, last);
779
780 /* Remove the first {. */
781 str = remove_leading_whitespaces (str);
782 if (*str != '{')
783 abort ();
784 str = remove_leading_whitespaces (str + 1);
785
786 i = strlen (str);
787
788 /* There are at least "X}". */
789 if (i < 2)
790 abort ();
791
792 /* Remove trailing white spaces and }. */
793 do
794 {
795 i--;
796 if (ISSPACE (str[i]) || str[i] == '}')
797 str[i] = '\0';
798 else
799 break;
800 }
801 while (i != 0);
802
803 last = str + i;
804
805 /* Find operand_types. */
806 for (i = 0; i < ARRAY_SIZE (operand_types); i++)
807 {
808 if (str >= last)
809 {
810 operand_types [i] = NULL;
811 break;
812 }
813
814 operand_types [i] = next_field (str, ',', &str, last);
815 if (*operand_types[i] == '0')
816 {
817 if (i != 0)
818 operand_types[i] = NULL;
819 break;
820 }
821 }
822
823 fprintf (table, " { \"%s\", %s, %s, %s, %s,\n",
824 name, operands, base_opcode, extension_opcode,
825 opcode_length);
826
bd5295b2 827 process_i386_cpu_flag (table, cpu_flags, 0, ",", " ", lineno);
c587b3f9 828
bd5295b2 829 process_i386_opcode_modifier (table, opcode_modifier, lineno);
c587b3f9
L
830
831 fprintf (table, " { ");
832
833 for (i = 0; i < ARRAY_SIZE (operand_types); i++)
834 {
835 if (operand_types[i] == NULL || *operand_types[i] == '0')
836 {
837 if (i == 0)
bd5295b2 838 process_i386_operand_type (table, "0", 0, "\t ", lineno);
c587b3f9
L
839 break;
840 }
841
842 if (i != 0)
843 fprintf (table, ",\n ");
844
845 process_i386_operand_type (table, operand_types[i], 0,
bd5295b2 846 "\t ", lineno);
c587b3f9
L
847 }
848 fprintf (table, " } },\n");
849}
850
851struct opcode_hash_entry
852{
853 struct opcode_hash_entry *next;
854 char *name;
855 char *opcode;
bd5295b2 856 int lineno;
c587b3f9
L
857};
858
859/* Calculate the hash value of an opcode hash entry P. */
860
861static hashval_t
862opcode_hash_hash (const void *p)
863{
864 struct opcode_hash_entry *entry = (struct opcode_hash_entry *) p;
865 return htab_hash_string (entry->name);
866}
867
868/* Compare a string Q against an opcode hash entry P. */
869
870static int
871opcode_hash_eq (const void *p, const void *q)
872{
873 struct opcode_hash_entry *entry = (struct opcode_hash_entry *) p;
874 const char *name = (const char *) q;
875 return strcmp (name, entry->name) == 0;
876}
877
40b8e679 878static void
72ffa0fb 879process_i386_opcodes (FILE *table)
40b8e679 880{
3d4d5afa 881 FILE *fp;
40b8e679 882 char buf[2048];
c587b3f9
L
883 unsigned int i, j;
884 char *str, *p, *last, *name;
885 struct opcode_hash_entry **hash_slot, **entry, *next;
886 htab_t opcode_hash_table;
887 struct opcode_hash_entry **opcode_array;
888 unsigned int opcode_array_size = 1024;
bd5295b2 889 int lineno = 0;
40b8e679 890
3d4d5afa
L
891 filename = "i386-opc.tbl";
892 fp = fopen (filename, "r");
893
40b8e679 894 if (fp == NULL)
34edb9ad 895 fail (_("can't find i386-opc.tbl for reading, errno = %s\n"),
40fb9820 896 xstrerror (errno));
40b8e679 897
c587b3f9
L
898 i = 0;
899 opcode_array = (struct opcode_hash_entry **)
900 xmalloc (sizeof (*opcode_array) * opcode_array_size);
901
902 opcode_hash_table = htab_create_alloc (16, opcode_hash_hash,
903 opcode_hash_eq, NULL,
904 xcalloc, free);
905
34edb9ad 906 fprintf (table, "\n/* i386 opcode table. */\n\n");
d3ce72d0 907 fprintf (table, "const insn_template i386_optab[] =\n{\n");
40b8e679 908
c587b3f9 909 /* Put everything on opcode array. */
40b8e679
L
910 while (!feof (fp))
911 {
912 if (fgets (buf, sizeof (buf), fp) == NULL)
913 break;
914
3d4d5afa
L
915 lineno++;
916
40b8e679
L
917 p = remove_leading_whitespaces (buf);
918
919 /* Skip comments. */
920 str = strstr (p, "//");
921 if (str != NULL)
922 str[0] = '\0';
923
924 /* Remove trailing white spaces. */
925 remove_trailing_whitespaces (p);
926
927 switch (p[0])
928 {
929 case '#':
c587b3f9 930 /* Ignore comments. */
40b8e679
L
931 case '\0':
932 continue;
933 break;
934 default:
935 break;
936 }
937
938 last = p + strlen (p);
939
940 /* Find name. */
c587b3f9 941 name = next_field (p, ',', &str, last);
40b8e679 942
c587b3f9
L
943 /* Get the slot in hash table. */
944 hash_slot = (struct opcode_hash_entry **)
945 htab_find_slot_with_hash (opcode_hash_table, name,
946 htab_hash_string (name),
947 INSERT);
40b8e679 948
c587b3f9 949 if (*hash_slot == NULL)
40b8e679 950 {
c587b3f9
L
951 /* It is the new one. Put it on opcode array. */
952 if (i >= opcode_array_size)
40b8e679 953 {
c587b3f9
L
954 /* Grow the opcode array when needed. */
955 opcode_array_size += 1024;
956 opcode_array = (struct opcode_hash_entry **)
957 xrealloc (opcode_array,
958 sizeof (*opcode_array) * opcode_array_size);
40b8e679
L
959 }
960
c587b3f9
L
961 opcode_array[i] = (struct opcode_hash_entry *)
962 xmalloc (sizeof (struct opcode_hash_entry));
963 opcode_array[i]->next = NULL;
964 opcode_array[i]->name = xstrdup (name);
965 opcode_array[i]->opcode = xstrdup (str);
bd5295b2 966 opcode_array[i]->lineno = lineno;
c587b3f9
L
967 *hash_slot = opcode_array[i];
968 i++;
40b8e679 969 }
c587b3f9 970 else
40b8e679 971 {
c587b3f9
L
972 /* Append it to the existing one. */
973 entry = hash_slot;
974 while ((*entry) != NULL)
975 entry = &(*entry)->next;
976 *entry = (struct opcode_hash_entry *)
977 xmalloc (sizeof (struct opcode_hash_entry));
978 (*entry)->next = NULL;
979 (*entry)->name = (*hash_slot)->name;
980 (*entry)->opcode = xstrdup (str);
bd5295b2 981 (*entry)->lineno = lineno;
c587b3f9
L
982 }
983 }
40b8e679 984
c587b3f9
L
985 /* Process opcode array. */
986 for (j = 0; j < i; j++)
987 {
988 for (next = opcode_array[j]; next; next = next->next)
989 {
990 name = next->name;
991 str = next->opcode;
bd5295b2 992 lineno = next->lineno;
c587b3f9 993 last = str + strlen (str);
bd5295b2 994 output_i386_opcode (table, name, str, last, lineno);
40b8e679 995 }
40b8e679
L
996 }
997
34edb9ad
L
998 fclose (fp);
999
4dffcebc 1000 fprintf (table, " { NULL, 0, 0, 0, 0,\n");
40fb9820 1001
bd5295b2 1002 process_i386_cpu_flag (table, "0", 0, ",", " ", -1);
40fb9820 1003
bd5295b2 1004 process_i386_opcode_modifier (table, "0", -1);
40fb9820
L
1005
1006 fprintf (table, " { ");
bd5295b2 1007 process_i386_operand_type (table, "0", 0, "\t ", -1);
40fb9820
L
1008 fprintf (table, " } }\n");
1009
34edb9ad 1010 fprintf (table, "};\n");
40b8e679
L
1011}
1012
1013static void
72ffa0fb 1014process_i386_registers (FILE *table)
40b8e679 1015{
3d4d5afa 1016 FILE *fp;
40b8e679
L
1017 char buf[2048];
1018 char *str, *p, *last;
1019 char *reg_name, *reg_type, *reg_flags, *reg_num;
a60de03c 1020 char *dw2_32_num, *dw2_64_num;
bd5295b2 1021 int lineno = 0;
40b8e679 1022
3d4d5afa
L
1023 filename = "i386-reg.tbl";
1024 fp = fopen (filename, "r");
40b8e679 1025 if (fp == NULL)
34edb9ad 1026 fail (_("can't find i386-reg.tbl for reading, errno = %s\n"),
40fb9820 1027 xstrerror (errno));
40b8e679 1028
34edb9ad
L
1029 fprintf (table, "\n/* i386 register table. */\n\n");
1030 fprintf (table, "const reg_entry i386_regtab[] =\n{\n");
40b8e679
L
1031
1032 while (!feof (fp))
1033 {
1034 if (fgets (buf, sizeof (buf), fp) == NULL)
1035 break;
1036
3d4d5afa
L
1037 lineno++;
1038
40b8e679
L
1039 p = remove_leading_whitespaces (buf);
1040
1041 /* Skip comments. */
1042 str = strstr (p, "//");
1043 if (str != NULL)
1044 str[0] = '\0';
1045
1046 /* Remove trailing white spaces. */
1047 remove_trailing_whitespaces (p);
1048
1049 switch (p[0])
1050 {
1051 case '#':
34edb9ad 1052 fprintf (table, "%s\n", p);
40b8e679
L
1053 case '\0':
1054 continue;
1055 break;
1056 default:
1057 break;
1058 }
1059
1060 last = p + strlen (p);
1061
1062 /* Find reg_name. */
c587b3f9 1063 reg_name = next_field (p, ',', &str, last);
40b8e679
L
1064
1065 /* Find reg_type. */
c587b3f9 1066 reg_type = next_field (str, ',', &str, last);
40b8e679
L
1067
1068 /* Find reg_flags. */
c587b3f9 1069 reg_flags = next_field (str, ',', &str, last);
40b8e679
L
1070
1071 /* Find reg_num. */
c587b3f9 1072 reg_num = next_field (str, ',', &str, last);
a60de03c 1073
40fb9820
L
1074 fprintf (table, " { \"%s\",\n ", reg_name);
1075
bd5295b2 1076 process_i386_operand_type (table, reg_type, 0, "\t", lineno);
40fb9820 1077
a60de03c 1078 /* Find 32-bit Dwarf2 register number. */
c587b3f9 1079 dw2_32_num = next_field (str, ',', &str, last);
a60de03c
JB
1080
1081 /* Find 64-bit Dwarf2 register number. */
c587b3f9 1082 dw2_64_num = next_field (str, ',', &str, last);
a60de03c
JB
1083
1084 fprintf (table, ",\n %s, %s, { %s, %s } },\n",
1085 reg_flags, reg_num, dw2_32_num, dw2_64_num);
40b8e679
L
1086 }
1087
34edb9ad
L
1088 fclose (fp);
1089
1090 fprintf (table, "};\n");
40b8e679 1091
34edb9ad 1092 fprintf (table, "\nconst unsigned int i386_regtab_size = ARRAY_SIZE (i386_regtab);\n");
40b8e679
L
1093}
1094
40fb9820
L
1095static void
1096process_i386_initializers (void)
1097{
1098 unsigned int i;
1099 FILE *fp = fopen ("i386-init.h", "w");
1100 char *init;
1101
1102 if (fp == NULL)
1103 fail (_("can't create i386-init.h, errno = %s\n"),
1104 xstrerror (errno));
1105
1106 process_copyright (fp);
1107
1108 for (i = 0; i < ARRAY_SIZE (cpu_flag_init); i++)
1109 {
1110 fprintf (fp, "\n#define %s \\\n", cpu_flag_init[i].name);
1111 init = xstrdup (cpu_flag_init[i].init);
bd5295b2 1112 process_i386_cpu_flag (fp, init, 1, "", " ", -1);
40fb9820
L
1113 free (init);
1114 }
1115
1116 for (i = 0; i < ARRAY_SIZE (operand_type_init); i++)
1117 {
1118 fprintf (fp, "\n\n#define %s \\\n ", operand_type_init[i].name);
1119 init = xstrdup (operand_type_init[i].init);
bd5295b2 1120 process_i386_operand_type (fp, init, 1, " ", -1);
40fb9820
L
1121 free (init);
1122 }
1123 fprintf (fp, "\n");
1124
1125 fclose (fp);
1126}
1127
40b8e679
L
1128/* Program options. */
1129#define OPTION_SRCDIR 200
1130
1131struct option long_options[] =
1132{
1133 {"srcdir", required_argument, NULL, OPTION_SRCDIR},
1134 {"debug", no_argument, NULL, 'd'},
1135 {"version", no_argument, NULL, 'V'},
1136 {"help", no_argument, NULL, 'h'},
1137 {0, no_argument, NULL, 0}
1138};
1139
1140static void
1141print_version (void)
1142{
1143 printf ("%s: version 1.0\n", program_name);
1144 xexit (0);
1145}
1146
1147static void
1148usage (FILE * stream, int status)
1149{
1150 fprintf (stream, "Usage: %s [-V | --version] [-d | --debug] [--srcdir=dirname] [--help]\n",
1151 program_name);
1152 xexit (status);
1153}
1154
1155int
1156main (int argc, char **argv)
1157{
1158 extern int chdir (char *);
1159 char *srcdir = NULL;
8b40d594 1160 int c;
72ffa0fb 1161 FILE *table;
40b8e679
L
1162
1163 program_name = *argv;
1164 xmalloc_set_program_name (program_name);
1165
1166 while ((c = getopt_long (argc, argv, "vVdh", long_options, 0)) != EOF)
1167 switch (c)
1168 {
1169 case OPTION_SRCDIR:
1170 srcdir = optarg;
1171 break;
1172 case 'V':
1173 case 'v':
1174 print_version ();
1175 break;
1176 case 'd':
1177 debug = 1;
1178 break;
1179 case 'h':
1180 case '?':
1181 usage (stderr, 0);
1182 default:
1183 case 0:
1184 break;
1185 }
1186
1187 if (optind != argc)
1188 usage (stdout, 1);
1189
1190 if (srcdir != NULL)
1191 if (chdir (srcdir) != 0)
1192 fail (_("unable to change directory to \"%s\", errno = %s\n"),
40fb9820
L
1193 srcdir, xstrerror (errno));
1194
1195 /* Check the unused bitfield in i386_cpu_flags. */
1196#ifndef CpuUnused
8b40d594
L
1197 c = CpuNumOfBits - CpuMax - 1;
1198 if (c)
1199 fail (_("%d unused bits in i386_cpu_flags.\n"), c);
40fb9820
L
1200#endif
1201
1202 /* Check the unused bitfield in i386_operand_type. */
1203#ifndef OTUnused
8b40d594
L
1204 c = OTNumOfBits - OTMax - 1;
1205 if (c)
1206 fail (_("%d unused bits in i386_operand_type.\n"), c);
40fb9820
L
1207#endif
1208
1209 qsort (cpu_flags, ARRAY_SIZE (cpu_flags), sizeof (cpu_flags [0]),
1210 compare);
1211
1212 qsort (opcode_modifiers, ARRAY_SIZE (opcode_modifiers),
1213 sizeof (opcode_modifiers [0]), compare);
1214
1215 qsort (operand_types, ARRAY_SIZE (operand_types),
1216 sizeof (operand_types [0]), compare);
40b8e679 1217
34edb9ad
L
1218 table = fopen ("i386-tbl.h", "w");
1219 if (table == NULL)
40fb9820
L
1220 fail (_("can't create i386-tbl.h, errno = %s\n"),
1221 xstrerror (errno));
34edb9ad 1222
72ffa0fb 1223 process_copyright (table);
40b8e679 1224
72ffa0fb
L
1225 process_i386_opcodes (table);
1226 process_i386_registers (table);
40fb9820 1227 process_i386_initializers ();
40b8e679 1228
34edb9ad
L
1229 fclose (table);
1230
40b8e679
L
1231 exit (0);
1232}
This page took 0.182151 seconds and 4 git commands to generate.