remove some auto-generated files from yasm tree -- see #52

This commit is contained in:
dmharvey 2008-07-06 22:58:23 +00:00
parent 1db0bd7ce9
commit 426559ff6e
3 changed files with 0 additions and 1159 deletions

View File

@ -1,229 +0,0 @@
/* This file auto-generated by genmodule.c - don't edit it */
/*
* YASM module loader
*
* Copyright (C) 2004-2007 Peter Johnson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <util.h>
/*@unused@*/ RCSID("$Id: module.in 2080 2008-04-30 04:40:29Z peter $");
#include <libyasm.h>
typedef struct module {
const char *keyword; /* module keyword */
void *data; /* associated data */
} module;
extern yasm_arch_module yasm_x86_LTX_arch;
extern yasm_arch_module yasm_lc3b_LTX_arch;
extern yasm_listfmt_module yasm_nasm_LTX_listfmt;
extern yasm_parser_module yasm_gas_LTX_parser;
extern yasm_parser_module yasm_gnu_LTX_parser;
extern yasm_parser_module yasm_nasm_LTX_parser;
extern yasm_preproc_module yasm_nasm_LTX_preproc;
extern yasm_preproc_module yasm_raw_LTX_preproc;
extern yasm_preproc_module yasm_cpp_LTX_preproc;
extern yasm_dbgfmt_module yasm_cv8_LTX_dbgfmt;
extern yasm_dbgfmt_module yasm_dwarf2_LTX_dbgfmt;
extern yasm_dbgfmt_module yasm_null_LTX_dbgfmt;
extern yasm_dbgfmt_module yasm_stabs_LTX_dbgfmt;
extern yasm_objfmt_module yasm_dbg_LTX_objfmt;
extern yasm_objfmt_module yasm_bin_LTX_objfmt;
extern yasm_objfmt_module yasm_elf_LTX_objfmt;
extern yasm_objfmt_module yasm_elf32_LTX_objfmt;
extern yasm_objfmt_module yasm_elf64_LTX_objfmt;
extern yasm_objfmt_module yasm_coff_LTX_objfmt;
extern yasm_objfmt_module yasm_macho_LTX_objfmt;
extern yasm_objfmt_module yasm_macho32_LTX_objfmt;
extern yasm_objfmt_module yasm_macho64_LTX_objfmt;
extern yasm_objfmt_module yasm_rdf_LTX_objfmt;
extern yasm_objfmt_module yasm_win32_LTX_objfmt;
extern yasm_objfmt_module yasm_win64_LTX_objfmt;
extern yasm_objfmt_module yasm_x64_LTX_objfmt;
extern yasm_objfmt_module yasm_xdf_LTX_objfmt;
static module arch_modules[] = {
{"x86", &yasm_x86_LTX_arch},
{"lc3b", &yasm_lc3b_LTX_arch},
};
static module dbgfmt_modules[] = {
{"cv8", &yasm_cv8_LTX_dbgfmt},
{"dwarf2", &yasm_dwarf2_LTX_dbgfmt},
{"null", &yasm_null_LTX_dbgfmt},
{"stabs", &yasm_stabs_LTX_dbgfmt},
};
static module objfmt_modules[] = {
{"dbg", &yasm_dbg_LTX_objfmt},
{"bin", &yasm_bin_LTX_objfmt},
{"elf", &yasm_elf_LTX_objfmt},
{"elf32", &yasm_elf32_LTX_objfmt},
{"elf64", &yasm_elf64_LTX_objfmt},
{"coff", &yasm_coff_LTX_objfmt},
{"macho", &yasm_macho_LTX_objfmt},
{"macho32", &yasm_macho32_LTX_objfmt},
{"macho64", &yasm_macho64_LTX_objfmt},
{"rdf", &yasm_rdf_LTX_objfmt},
{"win32", &yasm_win32_LTX_objfmt},
{"win64", &yasm_win64_LTX_objfmt},
{"x64", &yasm_x64_LTX_objfmt},
{"xdf", &yasm_xdf_LTX_objfmt},
};
static module listfmt_modules[] = {
{"nasm", &yasm_nasm_LTX_listfmt},
};
static module parser_modules[] = {
{"gas", &yasm_gas_LTX_parser},
{"gnu", &yasm_gnu_LTX_parser},
{"nasm", &yasm_nasm_LTX_parser},
};
static module preproc_modules[] = {
{"nasm", &yasm_nasm_LTX_preproc},
{"raw", &yasm_raw_LTX_preproc},
{"cpp", &yasm_cpp_LTX_preproc},
};
static struct {
module *m;
size_t n;
} module_types[] = {
{arch_modules, sizeof(arch_modules)/sizeof(module)},
{dbgfmt_modules, sizeof(dbgfmt_modules)/sizeof(module)},
{objfmt_modules, sizeof(objfmt_modules)/sizeof(module)},
{listfmt_modules, sizeof(listfmt_modules)/sizeof(module)},
{parser_modules, sizeof(parser_modules)/sizeof(module)},
{preproc_modules, sizeof(preproc_modules)/sizeof(module)},
};
typedef struct loaded_module {
yasm_module_type type; /* module type */
const char *keyword; /* module keyword */
void *data; /* associated data */
} loaded_module;
static loaded_module *loaded_modules = NULL;
static size_t num_loaded_modules = 0;
void *
yasm_load_module(yasm_module_type type, const char *keyword)
{
size_t i;
module *modules;
size_t n;
/* Look for the module/symbol, first in loaded modules */
if (loaded_modules) {
for (i=0; i<num_loaded_modules; i++) {
if (loaded_modules[i].type == type &&
yasm__strcasecmp(loaded_modules[i].keyword, keyword) == 0)
return loaded_modules[i].data;
}
}
modules = module_types[type].m;
n = module_types[type].n;
for (i=0; i<n; i++) {
if (yasm__strcasecmp(modules[i].keyword, keyword) == 0)
return modules[i].data;
}
return NULL;
}
void
yasm_register_module(yasm_module_type type, const char *keyword, void *data)
{
loaded_modules =
yasm_xrealloc(loaded_modules,
(num_loaded_modules+1)*sizeof(loaded_module));
loaded_modules[num_loaded_modules].type = type;
loaded_modules[num_loaded_modules].keyword = keyword;
loaded_modules[num_loaded_modules].data = data;
num_loaded_modules++;
}
static void
yasm_list_one_module(yasm_module_type type, void *data,
void (*printfunc) (const char *name, const char *keyword))
{
yasm_arch_module *arch;
yasm_dbgfmt_module *dbgfmt;
yasm_objfmt_module *objfmt;
yasm_listfmt_module *listfmt;
yasm_parser_module *parser;
yasm_preproc_module *preproc;
switch (type) {
case YASM_MODULE_ARCH:
arch = data;
printfunc(arch->name, arch->keyword);
break;
case YASM_MODULE_DBGFMT:
dbgfmt = data;
printfunc(dbgfmt->name, dbgfmt->keyword);
break;
case YASM_MODULE_OBJFMT:
objfmt = data;
printfunc(objfmt->name, objfmt->keyword);
break;
case YASM_MODULE_LISTFMT:
listfmt = data;
printfunc(listfmt->name, listfmt->keyword);
break;
case YASM_MODULE_PARSER:
parser = data;
printfunc(parser->name, parser->keyword);
break;
case YASM_MODULE_PREPROC:
preproc = data;
printfunc(preproc->name, preproc->keyword);
break;
}
}
void
yasm_list_modules(yasm_module_type type,
void (*printfunc) (const char *name, const char *keyword))
{
size_t i;
module *modules;
size_t n;;
/* Go through available list, and try to load each one */
if (loaded_modules) {
for (i=0; i<num_loaded_modules; i++)
yasm_list_one_module(type, loaded_modules[i].data, printfunc);
}
modules = module_types[type].m;
n = module_types[type].n;
for (i=0; i<n; i++)
yasm_list_one_module(type, modules[i].data, printfunc);
}

View File

@ -1,513 +0,0 @@
/* ANSI-C code produced by genperf */
/* Command-line: genperf ./modules/arch/x86/x86cpu.gperf x86cpu.c */
#line 26 "./modules/arch/x86/x86cpu.gperf"
#include <util.h>
RCSID("$Id: x86cpu.gperf 2088 2008-05-14 03:32:20Z peter $");
#include <ctype.h>
#include <libyasm.h>
#include <libyasm/phash.h>
#include "modules/arch/x86/x86arch.h"
#define PROC_8086 0
#define PROC_186 1
#define PROC_286 2
#define PROC_386 3
#define PROC_486 4
#define PROC_586 5
#define PROC_686 6
#define PROC_p2 7
#define PROC_p3 8
#define PROC_p4 9
#define PROC_prescott 10
#define PROC_conroe 11
#define PROC_penryn 12
#define PROC_nehalem 13
#define PROC_westmere 14
#define PROC_sandybridge 15
static void
x86_cpu_intel(wordptr cpu, unsigned int data)
{
BitVector_Empty(cpu);
BitVector_Bit_On(cpu, CPU_Priv);
if (data >= PROC_286)
BitVector_Bit_On(cpu, CPU_Prot);
if (data >= PROC_386)
BitVector_Bit_On(cpu, CPU_SMM);
if (data >= PROC_sandybridge)
BitVector_Bit_On(cpu, CPU_AVX);
if (data >= PROC_westmere) {
BitVector_Bit_On(cpu, CPU_AES);
BitVector_Bit_On(cpu, CPU_CLMUL);
}
if (data >= PROC_nehalem) {
BitVector_Bit_On(cpu, CPU_SSE42);
BitVector_Bit_On(cpu, CPU_XSAVE);
}
if (data >= PROC_penryn)
BitVector_Bit_On(cpu, CPU_SSE41);
if (data >= PROC_conroe)
BitVector_Bit_On(cpu, CPU_SSSE3);
if (data >= PROC_prescott)
BitVector_Bit_On(cpu, CPU_SSE3);
if (data >= PROC_p4)
BitVector_Bit_On(cpu, CPU_SSE2);
if (data >= PROC_p3)
BitVector_Bit_On(cpu, CPU_SSE);
if (data >= PROC_p2)
BitVector_Bit_On(cpu, CPU_MMX);
if (data >= PROC_486)
BitVector_Bit_On(cpu, CPU_FPU);
if (data >= PROC_prescott)
BitVector_Bit_On(cpu, CPU_EM64T);
if (data >= PROC_p4)
BitVector_Bit_On(cpu, CPU_P4);
if (data >= PROC_p3)
BitVector_Bit_On(cpu, CPU_P3);
if (data >= PROC_686)
BitVector_Bit_On(cpu, CPU_686);
if (data >= PROC_586)
BitVector_Bit_On(cpu, CPU_586);
if (data >= PROC_486)
BitVector_Bit_On(cpu, CPU_486);
if (data >= PROC_386)
BitVector_Bit_On(cpu, CPU_386);
if (data >= PROC_286)
BitVector_Bit_On(cpu, CPU_286);
if (data >= PROC_186)
BitVector_Bit_On(cpu, CPU_186);
BitVector_Bit_On(cpu, CPU_086);
}
static void
x86_cpu_ia64(wordptr cpu, unsigned int data)
{
BitVector_Empty(cpu);
BitVector_Bit_On(cpu, CPU_Priv);
BitVector_Bit_On(cpu, CPU_Prot);
BitVector_Bit_On(cpu, CPU_SMM);
BitVector_Bit_On(cpu, CPU_SSE2);
BitVector_Bit_On(cpu, CPU_SSE);
BitVector_Bit_On(cpu, CPU_MMX);
BitVector_Bit_On(cpu, CPU_FPU);
BitVector_Bit_On(cpu, CPU_IA64);
BitVector_Bit_On(cpu, CPU_P4);
BitVector_Bit_On(cpu, CPU_P3);
BitVector_Bit_On(cpu, CPU_686);
BitVector_Bit_On(cpu, CPU_586);
BitVector_Bit_On(cpu, CPU_486);
BitVector_Bit_On(cpu, CPU_386);
BitVector_Bit_On(cpu, CPU_286);
BitVector_Bit_On(cpu, CPU_186);
BitVector_Bit_On(cpu, CPU_086);
}
#define PROC_bulldozer 11
#define PROC_k10 10
#define PROC_venice 9
#define PROC_hammer 8
#define PROC_k7 7
#define PROC_k6 6
static void
x86_cpu_amd(wordptr cpu, unsigned int data)
{
BitVector_Empty(cpu);
BitVector_Bit_On(cpu, CPU_Priv);
BitVector_Bit_On(cpu, CPU_Prot);
BitVector_Bit_On(cpu, CPU_SMM);
BitVector_Bit_On(cpu, CPU_3DNow);
if (data >= PROC_bulldozer)
BitVector_Bit_On(cpu, CPU_SSE5);
if (data >= PROC_k10)
BitVector_Bit_On(cpu, CPU_SSE4a);
if (data >= PROC_venice)
BitVector_Bit_On(cpu, CPU_SSE3);
if (data >= PROC_hammer)
BitVector_Bit_On(cpu, CPU_SSE2);
if (data >= PROC_k7)
BitVector_Bit_On(cpu, CPU_SSE);
if (data >= PROC_k6)
BitVector_Bit_On(cpu, CPU_MMX);
BitVector_Bit_On(cpu, CPU_FPU);
if (data >= PROC_hammer)
BitVector_Bit_On(cpu, CPU_Hammer);
if (data >= PROC_k7)
BitVector_Bit_On(cpu, CPU_Athlon);
if (data >= PROC_k6)
BitVector_Bit_On(cpu, CPU_K6);
BitVector_Bit_On(cpu, CPU_686);
BitVector_Bit_On(cpu, CPU_586);
BitVector_Bit_On(cpu, CPU_486);
BitVector_Bit_On(cpu, CPU_386);
BitVector_Bit_On(cpu, CPU_286);
BitVector_Bit_On(cpu, CPU_186);
BitVector_Bit_On(cpu, CPU_086);
}
static void
x86_cpu_set(wordptr cpu, unsigned int data)
{
BitVector_Bit_On(cpu, data);
}
static void
x86_cpu_clear(wordptr cpu, unsigned int data)
{
BitVector_Bit_Off(cpu, data);
}
static void
x86_cpu_set_sse4(wordptr cpu, unsigned int data)
{
BitVector_Bit_On(cpu, CPU_SSE41);
BitVector_Bit_On(cpu, CPU_SSE42);
}
static void
x86_cpu_clear_sse4(wordptr cpu, unsigned int data)
{
BitVector_Bit_Off(cpu, CPU_SSE41);
BitVector_Bit_Off(cpu, CPU_SSE42);
}
#line 212 "./modules/arch/x86/x86cpu.gperf"
struct cpu_parse_data {
const char *name;
void (*handler) (wordptr cpu, unsigned int data);
unsigned int data;
};
static const struct cpu_parse_data *
cpu_find(const char *key, size_t len)
{
static const struct cpu_parse_data pd[129] = {
#line 343 "./modules/arch/x86/x86cpu.gperf"
{"avx", x86_cpu_set, CPU_AVX},
#line 238 "./modules/arch/x86/x86cpu.gperf"
{"ppro", x86_cpu_intel, PROC_686},
#line 329 "./modules/arch/x86/x86cpu.gperf"
{"sse41", x86_cpu_set, CPU_SSE41},
#line 226 "./modules/arch/x86/x86cpu.gperf"
{"80386", x86_cpu_intel, PROC_386},
#line 255 "./modules/arch/x86/x86cpu.gperf"
{"pentium-iv", x86_cpu_intel, PROC_p4},
#line 222 "./modules/arch/x86/x86cpu.gperf"
{"286", x86_cpu_intel, PROC_286},
#line 253 "./modules/arch/x86/x86cpu.gperf"
{"pentium-4", x86_cpu_intel, PROC_p4},
#line 295 "./modules/arch/x86/x86cpu.gperf"
{"3dnow", x86_cpu_set, CPU_3DNow},
#line 246 "./modules/arch/x86/x86cpu.gperf"
{"pentium3", x86_cpu_intel, PROC_p3},
#line 337 "./modules/arch/x86/x86cpu.gperf"
{"sse4", x86_cpu_set_sse4, 0},
#line 333 "./modules/arch/x86/x86cpu.gperf"
{"sse42", x86_cpu_set, CPU_SSE42},
#line 323 "./modules/arch/x86/x86cpu.gperf"
{"em64t", x86_cpu_set, CPU_EM64T},
#line 351 "./modules/arch/x86/x86cpu.gperf"
{"pclmulqdq", x86_cpu_set, CPU_CLMUL},
#line 227 "./modules/arch/x86/x86cpu.gperf"
{"i386", x86_cpu_intel, PROC_386},
#line 330 "./modules/arch/x86/x86cpu.gperf"
{"nosse41", x86_cpu_clear, CPU_SSE41},
#line 317 "./modules/arch/x86/x86cpu.gperf"
{"privileged", x86_cpu_set, CPU_Priv},
#line 307 "./modules/arch/x86/x86cpu.gperf"
{"undoc", x86_cpu_set, CPU_Undoc},
#line 250 "./modules/arch/x86/x86cpu.gperf"
{"katmai", x86_cpu_intel, PROC_p3},
#line 346 "./modules/arch/x86/x86cpu.gperf"
{"nofma", x86_cpu_clear, CPU_FMA},
#line 287 "./modules/arch/x86/x86cpu.gperf"
{"sse", x86_cpu_set, CPU_SSE},
#line 265 "./modules/arch/x86/x86cpu.gperf"
{"clawhammer", x86_cpu_amd, PROC_hammer},
#line 273 "./modules/arch/x86/x86cpu.gperf"
{"conroe", x86_cpu_intel, PROC_conroe},
#line 249 "./modules/arch/x86/x86cpu.gperf"
{"pentium-iii", x86_cpu_intel, PROC_p3},
#line 350 "./modules/arch/x86/x86cpu.gperf"
{"noclmul", x86_cpu_clear, CPU_CLMUL},
#line 296 "./modules/arch/x86/x86cpu.gperf"
{"no3dnow", x86_cpu_clear, CPU_3DNow},
#line 300 "./modules/arch/x86/x86cpu.gperf"
{"noamd", x86_cpu_clear, CPU_AMD},
#line 220 "./modules/arch/x86/x86cpu.gperf"
{"80186", x86_cpu_intel, PROC_186},
#line 252 "./modules/arch/x86/x86cpu.gperf"
{"pentium4", x86_cpu_intel, PROC_p4},
#line 334 "./modules/arch/x86/x86cpu.gperf"
{"nosse42", x86_cpu_clear, CPU_SSE42},
#line 288 "./modules/arch/x86/x86cpu.gperf"
{"nosse", x86_cpu_clear, CPU_SSE},
#line 243 "./modules/arch/x86/x86cpu.gperf"
{"pentiumii", x86_cpu_intel, PROC_p2},
#line 223 "./modules/arch/x86/x86cpu.gperf"
{"80286", x86_cpu_intel, PROC_286},
#line 224 "./modules/arch/x86/x86cpu.gperf"
{"i286", x86_cpu_intel, PROC_286},
#line 291 "./modules/arch/x86/x86cpu.gperf"
{"sse3", x86_cpu_set, CPU_SSE3},
#line 321 "./modules/arch/x86/x86cpu.gperf"
{"padlock", x86_cpu_set, CPU_PadLock},
#line 306 "./modules/arch/x86/x86cpu.gperf"
{"noprotected", x86_cpu_clear, CPU_Prot},
#line 352 "./modules/arch/x86/x86cpu.gperf"
{"nopclmulqdq", x86_cpu_clear, CPU_CLMUL},
#line 272 "./modules/arch/x86/x86cpu.gperf"
{"prescott", x86_cpu_intel, PROC_prescott},
#line 274 "./modules/arch/x86/x86cpu.gperf"
{"core2", x86_cpu_intel, PROC_conroe},
#line 266 "./modules/arch/x86/x86cpu.gperf"
{"opteron", x86_cpu_amd, PROC_hammer},
#line 277 "./modules/arch/x86/x86cpu.gperf"
{"westmere", x86_cpu_intel, PROC_westmere},
#line 314 "./modules/arch/x86/x86cpu.gperf"
{"noobsolete", x86_cpu_clear, CPU_Obs},
#line 319 "./modules/arch/x86/x86cpu.gperf"
{"svm", x86_cpu_set, CPU_SVM},
#line 345 "./modules/arch/x86/x86cpu.gperf"
{"fma", x86_cpu_set, CPU_FMA},
#line 301 "./modules/arch/x86/x86cpu.gperf"
{"smm", x86_cpu_set, CPU_SMM},
#line 303 "./modules/arch/x86/x86cpu.gperf"
{"prot", x86_cpu_set, CPU_Prot},
#line 311 "./modules/arch/x86/x86cpu.gperf"
{"obs", x86_cpu_set, CPU_Obs},
#line 234 "./modules/arch/x86/x86cpu.gperf"
{"p5", x86_cpu_intel, PROC_586},
#line 335 "./modules/arch/x86/x86cpu.gperf"
{"sse4a", x86_cpu_set, CPU_SSE4a},
#line 219 "./modules/arch/x86/x86cpu.gperf"
{"186", x86_cpu_intel, PROC_186},
#line 348 "./modules/arch/x86/x86cpu.gperf"
{"noaes", x86_cpu_clear, CPU_AES},
#line 263 "./modules/arch/x86/x86cpu.gperf"
{"k8", x86_cpu_amd, PROC_hammer},
#line 225 "./modules/arch/x86/x86cpu.gperf"
{"386", x86_cpu_intel, PROC_386},
#line 244 "./modules/arch/x86/x86cpu.gperf"
{"pentium-ii", x86_cpu_intel, PROC_p2},
#line 269 "./modules/arch/x86/x86cpu.gperf"
{"venice", x86_cpu_amd, PROC_venice},
#line 278 "./modules/arch/x86/x86cpu.gperf"
{"sandybridge", x86_cpu_intel, PROC_sandybridge},
#line 270 "./modules/arch/x86/x86cpu.gperf"
{"k10", x86_cpu_amd, PROC_k10},
#line 290 "./modules/arch/x86/x86cpu.gperf"
{"nosse2", x86_cpu_clear, CPU_SSE2},
#line 318 "./modules/arch/x86/x86cpu.gperf"
{"noprivileged", x86_cpu_clear, CPU_Priv},
#line 332 "./modules/arch/x86/x86cpu.gperf"
{"nosse4.2", x86_cpu_clear, CPU_SSE42},
#line 229 "./modules/arch/x86/x86cpu.gperf"
{"80486", x86_cpu_intel, PROC_486},
#line 232 "./modules/arch/x86/x86cpu.gperf"
{"i586", x86_cpu_intel, PROC_586},
#line 286 "./modules/arch/x86/x86cpu.gperf"
{"nommx", x86_cpu_clear, CPU_MMX},
#line 315 "./modules/arch/x86/x86cpu.gperf"
{"priv", x86_cpu_set, CPU_Priv},
#line 248 "./modules/arch/x86/x86cpu.gperf"
{"pentiumiii", x86_cpu_intel, PROC_p3},
#line 241 "./modules/arch/x86/x86cpu.gperf"
{"pentium2", x86_cpu_intel, PROC_p2},
#line 257 "./modules/arch/x86/x86cpu.gperf"
{"ia64", x86_cpu_ia64, 0},
#line 264 "./modules/arch/x86/x86cpu.gperf"
{"hammer", x86_cpu_amd, PROC_hammer},
#line 245 "./modules/arch/x86/x86cpu.gperf"
{"p3", x86_cpu_intel, PROC_p3},
#line 239 "./modules/arch/x86/x86cpu.gperf"
{"pentiumpro", x86_cpu_intel, PROC_686},
#line 308 "./modules/arch/x86/x86cpu.gperf"
{"noundoc", x86_cpu_clear, CPU_Undoc},
#line 218 "./modules/arch/x86/x86cpu.gperf"
{"8086", x86_cpu_intel, PROC_8086},
#line 327 "./modules/arch/x86/x86cpu.gperf"
{"sse4.1", x86_cpu_set, CPU_SSE41},
#line 316 "./modules/arch/x86/x86cpu.gperf"
{"nopriv", x86_cpu_clear, CPU_Priv},
#line 328 "./modules/arch/x86/x86cpu.gperf"
{"nosse4.1", x86_cpu_clear, CPU_SSE41},
#line 324 "./modules/arch/x86/x86cpu.gperf"
{"noem64t", x86_cpu_clear, CPU_EM64T},
#line 275 "./modules/arch/x86/x86cpu.gperf"
{"penryn", x86_cpu_intel, PROC_penryn},
#line 309 "./modules/arch/x86/x86cpu.gperf"
{"undocumented", x86_cpu_set, CPU_Undoc},
#line 313 "./modules/arch/x86/x86cpu.gperf"
{"obsolete", x86_cpu_set, CPU_Obs},
#line 289 "./modules/arch/x86/x86cpu.gperf"
{"sse2", x86_cpu_set, CPU_SSE2},
#line 304 "./modules/arch/x86/x86cpu.gperf"
{"noprot", x86_cpu_clear, CPU_Prot},
#line 302 "./modules/arch/x86/x86cpu.gperf"
{"nosmm", x86_cpu_clear, CPU_SMM},
#line 240 "./modules/arch/x86/x86cpu.gperf"
{"p2", x86_cpu_intel, PROC_p2},
#line 292 "./modules/arch/x86/x86cpu.gperf"
{"nosse3", x86_cpu_clear, CPU_SSE3},
#line 267 "./modules/arch/x86/x86cpu.gperf"
{"athlon64", x86_cpu_amd, PROC_hammer},
#line 268 "./modules/arch/x86/x86cpu.gperf"
{"athlon-64", x86_cpu_amd, PROC_hammer},
#line 338 "./modules/arch/x86/x86cpu.gperf"
{"nosse4", x86_cpu_clear_sse4, 0},
#line 325 "./modules/arch/x86/x86cpu.gperf"
{"ssse3", x86_cpu_set, CPU_SSSE3},
#line 256 "./modules/arch/x86/x86cpu.gperf"
{"williamette", x86_cpu_intel, PROC_p4},
#line 285 "./modules/arch/x86/x86cpu.gperf"
{"mmx", x86_cpu_set, CPU_MMX},
#line 262 "./modules/arch/x86/x86cpu.gperf"
{"athlon", x86_cpu_amd, PROC_k7},
#line 235 "./modules/arch/x86/x86cpu.gperf"
{"686", x86_cpu_intel, PROC_686},
#line 231 "./modules/arch/x86/x86cpu.gperf"
{"586", x86_cpu_intel, PROC_586},
#line 271 "./modules/arch/x86/x86cpu.gperf"
{"bulldozer", x86_cpu_amd, PROC_bulldozer},
#line 341 "./modules/arch/x86/x86cpu.gperf"
{"xsave", x86_cpu_set, CPU_XSAVE},
#line 261 "./modules/arch/x86/x86cpu.gperf"
{"k7", x86_cpu_amd, PROC_k7},
#line 339 "./modules/arch/x86/x86cpu.gperf"
{"sse5", x86_cpu_set, CPU_SSE5},
#line 260 "./modules/arch/x86/x86cpu.gperf"
{"k6", x86_cpu_amd, PROC_k6},
#line 230 "./modules/arch/x86/x86cpu.gperf"
{"i486", x86_cpu_intel, PROC_486},
#line 342 "./modules/arch/x86/x86cpu.gperf"
{"noxsave", x86_cpu_clear, CPU_XSAVE},
#line 233 "./modules/arch/x86/x86cpu.gperf"
{"pentium", x86_cpu_intel, PROC_586},
#line 320 "./modules/arch/x86/x86cpu.gperf"
{"nosvm", x86_cpu_clear, CPU_SVM},
#line 310 "./modules/arch/x86/x86cpu.gperf"
{"noundocumented", x86_cpu_clear, CPU_Undoc},
#line 221 "./modules/arch/x86/x86cpu.gperf"
{"i186", x86_cpu_intel, PROC_186},
#line 326 "./modules/arch/x86/x86cpu.gperf"
{"nossse3", x86_cpu_clear, CPU_SSSE3},
#line 283 "./modules/arch/x86/x86cpu.gperf"
{"fpu", x86_cpu_set, CPU_FPU},
#line 236 "./modules/arch/x86/x86cpu.gperf"
{"i686", x86_cpu_intel, PROC_686},
#line 344 "./modules/arch/x86/x86cpu.gperf"
{"noavx", x86_cpu_clear, CPU_AVX},
#line 340 "./modules/arch/x86/x86cpu.gperf"
{"nosse5", x86_cpu_clear, CPU_SSE5},
#line 298 "./modules/arch/x86/x86cpu.gperf"
{"nocyrix", x86_cpu_clear, CPU_Cyrix},
#line 254 "./modules/arch/x86/x86cpu.gperf"
{"pentiumiv", x86_cpu_intel, PROC_p4},
#line 258 "./modules/arch/x86/x86cpu.gperf"
{"ia-64", x86_cpu_ia64, 0},
#line 312 "./modules/arch/x86/x86cpu.gperf"
{"noobs", x86_cpu_clear, CPU_Obs},
#line 259 "./modules/arch/x86/x86cpu.gperf"
{"itanium", x86_cpu_ia64, 0},
#line 228 "./modules/arch/x86/x86cpu.gperf"
{"486", x86_cpu_intel, PROC_486},
#line 242 "./modules/arch/x86/x86cpu.gperf"
{"pentium-2", x86_cpu_intel, PROC_p2},
#line 297 "./modules/arch/x86/x86cpu.gperf"
{"cyrix", x86_cpu_set, CPU_Cyrix},
#line 276 "./modules/arch/x86/x86cpu.gperf"
{"nehalem", x86_cpu_intel, PROC_nehalem},
#line 247 "./modules/arch/x86/x86cpu.gperf"
{"pentium-3", x86_cpu_intel, PROC_p3},
#line 347 "./modules/arch/x86/x86cpu.gperf"
{"aes", x86_cpu_set, CPU_AES},
#line 322 "./modules/arch/x86/x86cpu.gperf"
{"nopadlock", x86_cpu_clear, CPU_PadLock},
#line 305 "./modules/arch/x86/x86cpu.gperf"
{"protected", x86_cpu_set, CPU_Prot},
#line 251 "./modules/arch/x86/x86cpu.gperf"
{"p4", x86_cpu_intel, PROC_p4},
#line 237 "./modules/arch/x86/x86cpu.gperf"
{"p6", x86_cpu_intel, PROC_686},
#line 299 "./modules/arch/x86/x86cpu.gperf"
{"amd", x86_cpu_set, CPU_AMD},
#line 336 "./modules/arch/x86/x86cpu.gperf"
{"nosse4a", x86_cpu_clear, CPU_SSE4a},
#line 284 "./modules/arch/x86/x86cpu.gperf"
{"nofpu", x86_cpu_clear, CPU_FPU},
#line 349 "./modules/arch/x86/x86cpu.gperf"
{"clmul", x86_cpu_set, CPU_CLMUL},
#line 331 "./modules/arch/x86/x86cpu.gperf"
{"sse4.2", x86_cpu_set, CPU_SSE42}
};
static const unsigned char tab[] = {
125,113,40,0,113,113,0,0,0,113,0,7,0,0,113,0,
125,82,0,0,0,125,0,0,113,125,113,125,0,0,0,125,
113,0,0,0,7,7,7,0,0,125,7,0,82,0,0,0,
40,0,0,0,0,124,0,113,0,27,0,0,0,0,0,0,
82,85,113,0,0,88,120,0,7,0,0,0,0,0,0,0,
40,125,0,0,113,0,7,0,0,0,0,0,120,0,113,113,
0,0,125,27,51,113,0,0,0,0,58,116,125,124,0,128,
0,125,27,0,0,0,0,0,111,82,0,119,82,0,0,0,
};
const struct cpu_parse_data *ret;
unsigned long rsl, val = phash_lookup(key, len, 0xdaa66d2bUL);
rsl = ((val>>25)^tab[val&0x7f]);
if (rsl >= 129) return NULL;
ret = &pd[rsl];
if (strcmp(key, ret->name) != 0) return NULL;
return ret;
}
#line 353 "./modules/arch/x86/x86cpu.gperf"
void
yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid,
size_t cpuid_len)
{
/*@null@*/ const struct cpu_parse_data *pdata;
wordptr new_cpu;
size_t i;
static char lcaseid[16];
if (cpuid_len > 15)
return;
for (i=0; i<cpuid_len; i++)
lcaseid[i] = tolower(cpuid[i]);
lcaseid[cpuid_len] = '\0';
pdata = cpu_find(lcaseid, cpuid_len);
if (!pdata) {
yasm_warn_set(YASM_WARN_GENERAL,
N_("unrecognized CPU identifier `%s'"), cpuid);
return;
}
new_cpu = BitVector_Clone(arch_x86->cpu_enables[arch_x86->active_cpu]);
pdata->handler(new_cpu, pdata->data);
/* try to find an existing match in the CPU table first */
for (i=0; i<arch_x86->cpu_enables_size; i++) {
if (BitVector_equal(arch_x86->cpu_enables[i], new_cpu)) {
arch_x86->active_cpu = i;
BitVector_Destroy(new_cpu);
return;
}
}
/* not found, need to add a new entry */
arch_x86->active_cpu = arch_x86->cpu_enables_size++;
arch_x86->cpu_enables =
yasm_xrealloc(arch_x86->cpu_enables,
arch_x86->cpu_enables_size*sizeof(wordptr));
arch_x86->cpu_enables[arch_x86->active_cpu] = new_cpu;
}

View File

@ -1,417 +0,0 @@
/* ANSI-C code produced by genperf */
/* Command-line: genperf ./modules/arch/x86/x86regtmod.gperf x86regtmod.c */
#line 26 "./modules/arch/x86/x86regtmod.gperf"
#include <util.h>
RCSID("$Id: x86regtmod.gperf 2061 2008-04-12 01:33:54Z peter $");
#include <ctype.h>
#include <libyasm.h>
#include <libyasm/phash.h>
#include "modules/arch/x86/x86arch.h"
enum regtmod_type {
REG = 1,
REGGROUP,
SEGREG,
TARGETMOD
};
#line 51 "./modules/arch/x86/x86regtmod.gperf"
struct regtmod_parse_data {
const char *name;
unsigned int type:8; /* regtmod_type */
/* REG: register size
* SEGREG: prefix encoding
* Others: 0
*/
unsigned int size_prefix:8;
/* REG: register index
* REGGROUP: register group type
* SEGREG: register encoding
* TARGETMOD: target modifier
*/
unsigned int data:8;
/* REG: required bits setting
* SEGREG: BITS in which the segment is ignored
* Others: 0
*/
unsigned int bits:8;
};
static const struct regtmod_parse_data *
regtmod_find(const char *key, size_t len)
{
static const struct regtmod_parse_data pd[152] = {
#line 110 "./modules/arch/x86/x86regtmod.gperf"
{"st6", REG, X86_FPUREG, 6, 0},
#line 140 "./modules/arch/x86/x86regtmod.gperf"
{"ymm1", REG, X86_YMMREG, 1, 0},
#line 162 "./modules/arch/x86/x86regtmod.gperf"
{"rsp", REG, X86_REG64, 4, 64},
#line 168 "./modules/arch/x86/x86regtmod.gperf"
{"r10", REG, X86_REG64, 10, 64},
#line 197 "./modules/arch/x86/x86regtmod.gperf"
{"bp", REG, X86_REG16, 5, 0},
#line 219 "./modules/arch/x86/x86regtmod.gperf"
{"r10b", REG, X86_REG8, 10, 64},
#line 115 "./modules/arch/x86/x86regtmod.gperf"
{"mm2", REG, X86_MMXREG, 2, 0},
#line 165 "./modules/arch/x86/x86regtmod.gperf"
{"rdi", REG, X86_REG64, 7, 64},
#line 151 "./modules/arch/x86/x86regtmod.gperf"
{"ymm12", REG, X86_YMMREG, 12, 64},
#line 166 "./modules/arch/x86/x86regtmod.gperf"
{"r8", REG, X86_REG64, 8, 64},
#line 247 "./modules/arch/x86/x86regtmod.gperf"
{"gs", SEGREG, 0x65, 0x05, 0},
#line 185 "./modules/arch/x86/x86regtmod.gperf"
{"r10d", REG, X86_REG32, 10, 64},
#line 164 "./modules/arch/x86/x86regtmod.gperf"
{"rsi", REG, X86_REG64, 6, 64},
#line 175 "./modules/arch/x86/x86regtmod.gperf"
{"eax", REG, X86_REG32, 0, 0},
#line 116 "./modules/arch/x86/x86regtmod.gperf"
{"mm3", REG, X86_MMXREG, 3, 0},
#line 99 "./modules/arch/x86/x86regtmod.gperf"
{"tr6", REG, X86_TRREG, 6, 0},
#line 93 "./modules/arch/x86/x86regtmod.gperf"
{"tr0", REG, X86_TRREG, 0, 0},
#line 213 "./modules/arch/x86/x86regtmod.gperf"
{"ah", REG, X86_REG8, 4, 0},
#line 128 "./modules/arch/x86/x86regtmod.gperf"
{"xmm6", REG, X86_XMMREG, 6, 0},
#line 90 "./modules/arch/x86/x86regtmod.gperf"
{"dr6", REG, X86_DRREG, 6, 0},
#line 179 "./modules/arch/x86/x86regtmod.gperf"
{"esp", REG, X86_REG32, 4, 0},
#line 227 "./modules/arch/x86/x86regtmod.gperf"
{"bpl", REG, X86_REG8X, 5, 64},
#line 98 "./modules/arch/x86/x86regtmod.gperf"
{"tr5", REG, X86_TRREG, 5, 0},
#line 192 "./modules/arch/x86/x86regtmod.gperf"
{"ax", REG, X86_REG16, 0, 0},
#line 196 "./modules/arch/x86/x86regtmod.gperf"
{"sp", REG, X86_REG16, 4, 0},
#line 224 "./modules/arch/x86/x86regtmod.gperf"
{"r15b", REG, X86_REG8, 15, 64},
#line 136 "./modules/arch/x86/x86regtmod.gperf"
{"xmm14", REG, X86_XMMREG, 14, 64},
#line 134 "./modules/arch/x86/x86regtmod.gperf"
{"xmm12", REG, X86_XMMREG, 12, 64},
#line 169 "./modules/arch/x86/x86regtmod.gperf"
{"r11", REG, X86_REG64, 11, 64},
#line 237 "./modules/arch/x86/x86regtmod.gperf"
{"xmm", REGGROUP, 0, X86_XMMREG, 0},
#line 141 "./modules/arch/x86/x86regtmod.gperf"
{"ymm2", REG, X86_YMMREG, 2, 0},
#line 180 "./modules/arch/x86/x86regtmod.gperf"
{"ebp", REG, X86_REG32, 5, 0},
#line 130 "./modules/arch/x86/x86regtmod.gperf"
{"xmm8", REG, X86_XMMREG, 8, 64},
#line 187 "./modules/arch/x86/x86regtmod.gperf"
{"r12d", REG, X86_REG32, 12, 64},
#line 143 "./modules/arch/x86/x86regtmod.gperf"
{"ymm4", REG, X86_YMMREG, 4, 0},
#line 142 "./modules/arch/x86/x86regtmod.gperf"
{"ymm3", REG, X86_YMMREG, 3, 0},
#line 158 "./modules/arch/x86/x86regtmod.gperf"
{"rax", REG, X86_REG64, 0, 64},
#line 125 "./modules/arch/x86/x86regtmod.gperf"
{"xmm3", REG, X86_XMMREG, 3, 0},
#line 122 "./modules/arch/x86/x86regtmod.gperf"
{"xmm0", REG, X86_XMMREG, 0, 0},
#line 91 "./modules/arch/x86/x86regtmod.gperf"
{"dr7", REG, X86_DRREG, 7, 0},
#line 206 "./modules/arch/x86/x86regtmod.gperf"
{"r14w", REG, X86_REG16, 14, 64},
#line 114 "./modules/arch/x86/x86regtmod.gperf"
{"mm1", REG, X86_MMXREG, 1, 0},
#line 212 "./modules/arch/x86/x86regtmod.gperf"
{"bl", REG, X86_REG8, 3, 0},
#line 201 "./modules/arch/x86/x86regtmod.gperf"
{"r9w", REG, X86_REG16, 9, 64},
#line 152 "./modules/arch/x86/x86regtmod.gperf"
{"ymm13", REG, X86_YMMREG, 13, 64},
#line 218 "./modules/arch/x86/x86regtmod.gperf"
{"r9b", REG, X86_REG8, 9, 64},
#line 147 "./modules/arch/x86/x86regtmod.gperf"
{"ymm8", REG, X86_YMMREG, 8, 64},
#line 194 "./modules/arch/x86/x86regtmod.gperf"
{"dx", REG, X86_REG16, 2, 0},
#line 170 "./modules/arch/x86/x86regtmod.gperf"
{"r12", REG, X86_REG64, 12, 64},
#line 204 "./modules/arch/x86/x86regtmod.gperf"
{"r12w", REG, X86_REG16, 12, 64},
#line 167 "./modules/arch/x86/x86regtmod.gperf"
{"r9", REG, X86_REG64, 9, 64},
#line 207 "./modules/arch/x86/x86regtmod.gperf"
{"r15w", REG, X86_REG16, 15, 64},
#line 228 "./modules/arch/x86/x86regtmod.gperf"
{"sil", REG, X86_REG8X, 6, 64},
#line 202 "./modules/arch/x86/x86regtmod.gperf"
{"r10w", REG, X86_REG16, 10, 64},
#line 145 "./modules/arch/x86/x86regtmod.gperf"
{"ymm6", REG, X86_YMMREG, 6, 0},
#line 244 "./modules/arch/x86/x86regtmod.gperf"
{"ss", SEGREG, 0x36, 0x02, 64},
#line 97 "./modules/arch/x86/x86regtmod.gperf"
{"tr4", REG, X86_TRREG, 4, 0},
#line 80 "./modules/arch/x86/x86regtmod.gperf"
{"cr3", REG, X86_CRREG, 3, 0},
#line 203 "./modules/arch/x86/x86regtmod.gperf"
{"r11w", REG, X86_REG16, 11, 64},
#line 126 "./modules/arch/x86/x86regtmod.gperf"
{"xmm4", REG, X86_XMMREG, 4, 0},
#line 104 "./modules/arch/x86/x86regtmod.gperf"
{"st0", REG, X86_FPUREG, 0, 0},
#line 229 "./modules/arch/x86/x86regtmod.gperf"
{"dil", REG, X86_REG8X, 7, 64},
#line 96 "./modules/arch/x86/x86regtmod.gperf"
{"tr3", REG, X86_TRREG, 3, 0},
#line 188 "./modules/arch/x86/x86regtmod.gperf"
{"r13d", REG, X86_REG32, 13, 64},
#line 200 "./modules/arch/x86/x86regtmod.gperf"
{"r8w", REG, X86_REG16, 8, 64},
#line 135 "./modules/arch/x86/x86regtmod.gperf"
{"xmm13", REG, X86_XMMREG, 13, 64},
#line 107 "./modules/arch/x86/x86regtmod.gperf"
{"st3", REG, X86_FPUREG, 3, 0},
#line 137 "./modules/arch/x86/x86regtmod.gperf"
{"xmm15", REG, X86_XMMREG, 15, 64},
#line 132 "./modules/arch/x86/x86regtmod.gperf"
{"xmm10", REG, X86_XMMREG, 10, 64},
#line 242 "./modules/arch/x86/x86regtmod.gperf"
{"es", SEGREG, 0x26, 0x00, 64},
#line 82 "./modules/arch/x86/x86regtmod.gperf"
{"cr8", REG, X86_CRREG, 8, 64},
#line 129 "./modules/arch/x86/x86regtmod.gperf"
{"xmm7", REG, X86_XMMREG, 7, 0},
#line 226 "./modules/arch/x86/x86regtmod.gperf"
{"spl", REG, X86_REG8X, 4, 64},
#line 173 "./modules/arch/x86/x86regtmod.gperf"
{"r15", REG, X86_REG64, 15, 64},
#line 81 "./modules/arch/x86/x86regtmod.gperf"
{"cr4", REG, X86_CRREG, 4, 0},
#line 246 "./modules/arch/x86/x86regtmod.gperf"
{"fs", SEGREG, 0x64, 0x04, 0},
#line 159 "./modules/arch/x86/x86regtmod.gperf"
{"rcx", REG, X86_REG64, 1, 64},
#line 113 "./modules/arch/x86/x86regtmod.gperf"
{"mm0", REG, X86_MMXREG, 0, 0},
#line 236 "./modules/arch/x86/x86regtmod.gperf"
{"mm", REGGROUP, 0, X86_MMXREG, 0},
#line 94 "./modules/arch/x86/x86regtmod.gperf"
{"tr1", REG, X86_TRREG, 1, 0},
#line 252 "./modules/arch/x86/x86regtmod.gperf"
{"short", TARGETMOD, 0, X86_SHORT, 0},
#line 108 "./modules/arch/x86/x86regtmod.gperf"
{"st4", REG, X86_FPUREG, 4, 0},
#line 78 "./modules/arch/x86/x86regtmod.gperf"
{"cr0", REG, X86_CRREG, 0, 0},
#line 133 "./modules/arch/x86/x86regtmod.gperf"
{"xmm11", REG, X86_XMMREG, 11, 64},
#line 117 "./modules/arch/x86/x86regtmod.gperf"
{"mm4", REG, X86_MMXREG, 4, 0},
#line 216 "./modules/arch/x86/x86regtmod.gperf"
{"bh", REG, X86_REG8, 7, 0},
#line 190 "./modules/arch/x86/x86regtmod.gperf"
{"r15d", REG, X86_REG32, 15, 64},
#line 86 "./modules/arch/x86/x86regtmod.gperf"
{"dr2", REG, X86_DRREG, 2, 0},
#line 183 "./modules/arch/x86/x86regtmod.gperf"
{"r8d", REG, X86_REG32, 8, 64},
#line 146 "./modules/arch/x86/x86regtmod.gperf"
{"ymm7", REG, X86_YMMREG, 7, 0},
#line 131 "./modules/arch/x86/x86regtmod.gperf"
{"xmm9", REG, X86_XMMREG, 9, 64},
#line 221 "./modules/arch/x86/x86regtmod.gperf"
{"r12b", REG, X86_REG8, 12, 64},
#line 106 "./modules/arch/x86/x86regtmod.gperf"
{"st2", REG, X86_FPUREG, 2, 0},
#line 148 "./modules/arch/x86/x86regtmod.gperf"
{"ymm9", REG, X86_YMMREG, 9, 64},
#line 111 "./modules/arch/x86/x86regtmod.gperf"
{"st7", REG, X86_FPUREG, 7, 0},
#line 195 "./modules/arch/x86/x86regtmod.gperf"
{"bx", REG, X86_REG16, 3, 0},
#line 150 "./modules/arch/x86/x86regtmod.gperf"
{"ymm11", REG, X86_YMMREG, 11, 64},
#line 144 "./modules/arch/x86/x86regtmod.gperf"
{"ymm5", REG, X86_YMMREG, 5, 0},
#line 154 "./modules/arch/x86/x86regtmod.gperf"
{"ymm15", REG, X86_YMMREG, 15, 64},
#line 163 "./modules/arch/x86/x86regtmod.gperf"
{"rbp", REG, X86_REG64, 5, 64},
#line 171 "./modules/arch/x86/x86regtmod.gperf"
{"r13", REG, X86_REG64, 13, 64},
#line 118 "./modules/arch/x86/x86regtmod.gperf"
{"mm5", REG, X86_MMXREG, 5, 0},
#line 198 "./modules/arch/x86/x86regtmod.gperf"
{"si", REG, X86_REG16, 6, 0},
#line 211 "./modules/arch/x86/x86regtmod.gperf"
{"dl", REG, X86_REG8, 2, 0},
#line 199 "./modules/arch/x86/x86regtmod.gperf"
{"di", REG, X86_REG16, 7, 0},
#line 79 "./modules/arch/x86/x86regtmod.gperf"
{"cr2", REG, X86_CRREG, 2, 0},
#line 189 "./modules/arch/x86/x86regtmod.gperf"
{"r14d", REG, X86_REG32, 14, 64},
#line 153 "./modules/arch/x86/x86regtmod.gperf"
{"ymm14", REG, X86_YMMREG, 14, 64},
#line 100 "./modules/arch/x86/x86regtmod.gperf"
{"tr7", REG, X86_TRREG, 7, 0},
#line 245 "./modules/arch/x86/x86regtmod.gperf"
{"ds", SEGREG, 0x3e, 0x03, 64},
#line 193 "./modules/arch/x86/x86regtmod.gperf"
{"cx", REG, X86_REG16, 1, 0},
#line 235 "./modules/arch/x86/x86regtmod.gperf"
{"st", REGGROUP, 0, X86_FPUREG, 0},
#line 182 "./modules/arch/x86/x86regtmod.gperf"
{"edi", REG, X86_REG32, 7, 0},
#line 209 "./modules/arch/x86/x86regtmod.gperf"
{"al", REG, X86_REG8, 0, 0},
#line 120 "./modules/arch/x86/x86regtmod.gperf"
{"mm7", REG, X86_MMXREG, 7, 0},
#line 178 "./modules/arch/x86/x86regtmod.gperf"
{"ebx", REG, X86_REG32, 3, 0},
#line 124 "./modules/arch/x86/x86regtmod.gperf"
{"xmm2", REG, X86_XMMREG, 2, 0},
#line 109 "./modules/arch/x86/x86regtmod.gperf"
{"st5", REG, X86_FPUREG, 5, 0},
#line 231 "./modules/arch/x86/x86regtmod.gperf"
{"rip", REG, X86_RIP, 0, 64},
#line 161 "./modules/arch/x86/x86regtmod.gperf"
{"rbx", REG, X86_REG64, 3, 64},
#line 254 "./modules/arch/x86/x86regtmod.gperf"
{"to", TARGETMOD, 0, X86_TO, 0},
#line 186 "./modules/arch/x86/x86regtmod.gperf"
{"r11d", REG, X86_REG32, 11, 64},
#line 89 "./modules/arch/x86/x86regtmod.gperf"
{"dr5", REG, X86_DRREG, 5, 0},
#line 85 "./modules/arch/x86/x86regtmod.gperf"
{"dr1", REG, X86_DRREG, 1, 0},
#line 251 "./modules/arch/x86/x86regtmod.gperf"
{"near", TARGETMOD, 0, X86_NEAR, 0},
#line 172 "./modules/arch/x86/x86regtmod.gperf"
{"r14", REG, X86_REG64, 14, 64},
#line 215 "./modules/arch/x86/x86regtmod.gperf"
{"dh", REG, X86_REG8, 6, 0},
#line 210 "./modules/arch/x86/x86regtmod.gperf"
{"cl", REG, X86_REG8, 1, 0},
#line 88 "./modules/arch/x86/x86regtmod.gperf"
{"dr4", REG, X86_DRREG, 4, 0},
#line 149 "./modules/arch/x86/x86regtmod.gperf"
{"ymm10", REG, X86_YMMREG, 10, 64},
#line 87 "./modules/arch/x86/x86regtmod.gperf"
{"dr3", REG, X86_DRREG, 3, 0},
#line 127 "./modules/arch/x86/x86regtmod.gperf"
{"xmm5", REG, X86_XMMREG, 5, 0},
#line 119 "./modules/arch/x86/x86regtmod.gperf"
{"mm6", REG, X86_MMXREG, 6, 0},
#line 205 "./modules/arch/x86/x86regtmod.gperf"
{"r13w", REG, X86_REG16, 13, 64},
#line 253 "./modules/arch/x86/x86regtmod.gperf"
{"far", TARGETMOD, 0, X86_FAR, 0},
#line 139 "./modules/arch/x86/x86regtmod.gperf"
{"ymm0", REG, X86_YMMREG, 0, 0},
#line 238 "./modules/arch/x86/x86regtmod.gperf"
{"ymm", REGGROUP, 0, X86_YMMREG, 0},
#line 214 "./modules/arch/x86/x86regtmod.gperf"
{"ch", REG, X86_REG8, 5, 0},
#line 123 "./modules/arch/x86/x86regtmod.gperf"
{"xmm1", REG, X86_XMMREG, 1, 0},
#line 181 "./modules/arch/x86/x86regtmod.gperf"
{"esi", REG, X86_REG32, 6, 0},
#line 223 "./modules/arch/x86/x86regtmod.gperf"
{"r14b", REG, X86_REG8, 14, 64},
#line 105 "./modules/arch/x86/x86regtmod.gperf"
{"st1", REG, X86_FPUREG, 1, 0},
#line 217 "./modules/arch/x86/x86regtmod.gperf"
{"r8b", REG, X86_REG8, 8, 64},
#line 220 "./modules/arch/x86/x86regtmod.gperf"
{"r11b", REG, X86_REG8, 11, 64},
#line 222 "./modules/arch/x86/x86regtmod.gperf"
{"r13b", REG, X86_REG8, 13, 64},
#line 176 "./modules/arch/x86/x86regtmod.gperf"
{"ecx", REG, X86_REG32, 1, 0},
#line 95 "./modules/arch/x86/x86regtmod.gperf"
{"tr2", REG, X86_TRREG, 2, 0},
#line 160 "./modules/arch/x86/x86regtmod.gperf"
{"rdx", REG, X86_REG64, 2, 64},
#line 184 "./modules/arch/x86/x86regtmod.gperf"
{"r9d", REG, X86_REG32, 9, 64},
#line 243 "./modules/arch/x86/x86regtmod.gperf"
{"cs", SEGREG, 0x2e, 0x01, 0},
#line 84 "./modules/arch/x86/x86regtmod.gperf"
{"dr0", REG, X86_DRREG, 0, 0},
#line 177 "./modules/arch/x86/x86regtmod.gperf"
{"edx", REG, X86_REG32, 2, 0}
};
static const unsigned char tab[] = {
0,0,125,22,0,0,85,0,85,168,0,0,0,7,113,0,
0,0,0,22,183,0,0,11,42,55,0,0,82,0,88,235,
0,0,0,0,0,0,183,85,0,0,145,113,220,125,22,0,
88,183,0,7,0,0,0,7,0,125,113,87,131,116,7,0,
113,7,0,113,0,87,87,7,7,7,113,40,85,125,113,85,
0,0,22,235,0,131,125,113,0,22,0,220,0,220,0,120,
116,0,124,184,0,0,0,183,92,125,0,92,125,0,0,177,
7,0,0,7,0,45,0,214,180,113,211,163,142,0,88,173,
};
const struct regtmod_parse_data *ret;
unsigned long rsl, val = phash_lookup(key, len, 0x9e3779b9UL);
rsl = ((val>>25)^tab[val&0x7f]);
if (rsl >= 152) return NULL;
ret = &pd[rsl];
if (strcmp(key, ret->name) != 0) return NULL;
return ret;
}
#line 255 "./modules/arch/x86/x86regtmod.gperf"
yasm_arch_regtmod
yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len,
uintptr_t *data)
{
yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch;
/*@null@*/ const struct regtmod_parse_data *pdata;
size_t i;
static char lcaseid[8];
unsigned int bits;
yasm_arch_regtmod type;
if (id_len > 7)
return YASM_ARCH_NOTREGTMOD;
for (i=0; i<id_len; i++)
lcaseid[i] = tolower(id[i]);
lcaseid[id_len] = '\0';
pdata = regtmod_find(lcaseid, id_len);
if (!pdata)
return YASM_ARCH_NOTREGTMOD;
type = (yasm_arch_regtmod)pdata->type;
bits = pdata->bits;
if (type == YASM_ARCH_REG && bits != 0 && arch_x86->mode_bits != bits) {
yasm_warn_set(YASM_WARN_GENERAL,
N_("`%s' is a register in %u-bit mode"), id, bits);
return YASM_ARCH_NOTREGTMOD;
}
if (type == YASM_ARCH_SEGREG && bits != 0 && arch_x86->mode_bits == bits) {
yasm_warn_set(YASM_WARN_GENERAL,
N_("`%s' segment register ignored in %u-bit mode"), id,
bits);
}
if (type == YASM_ARCH_SEGREG)
*data = (pdata->size_prefix<<8) | pdata->data;
else
*data = pdata->size_prefix | pdata->data;
return type;
}