Make CPU feature flags and registers case insensitive again.

This was accidentally removed in [1929].
Add test case for these so it doesn't happen again.

svn path=/trunk/yasm/; revision=1955
multiarch^2
Peter Johnson 17 years ago
parent 1f6c405d98
commit 4af823161d
  1. 2
      modules/arch/x86/tests/Makefile.inc
  2. 3
      modules/arch/x86/tests/mixcase.asm
  3. 3
      modules/arch/x86/tests/mixcase.hex
  4. 8
      modules/arch/x86/x86cpu.gperf
  5. 7
      modules/arch/x86/x86regtmod.gperf

@ -84,6 +84,8 @@ EXTRA_DIST += modules/arch/x86/tests/mem64hi32.asm
EXTRA_DIST += modules/arch/x86/tests/mem64hi32.hex
EXTRA_DIST += modules/arch/x86/tests/mem64rip.asm
EXTRA_DIST += modules/arch/x86/tests/mem64rip.hex
EXTRA_DIST += modules/arch/x86/tests/mixcase.asm
EXTRA_DIST += modules/arch/x86/tests/mixcase.hex
EXTRA_DIST += modules/arch/x86/tests/movdq32.asm
EXTRA_DIST += modules/arch/x86/tests/movdq32.hex
EXTRA_DIST += modules/arch/x86/tests/movdq64.asm

@ -0,0 +1,3 @@
CPU SSE5
MOV AX,5

@ -332,12 +332,16 @@ yasm_x86__parse_cpu(yasm_arch_x86 *arch_x86, const char *cpuid,
{
/*@null@*/ const struct cpu_parse_data *pdata;
wordptr new_cpu;
unsigned int i;
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(cpuid, cpuid_len);
pdata = cpu_find(lcaseid, cpuid_len);
if (!pdata) {
yasm_warn_set(YASM_WARN_GENERAL,
N_("unrecognized CPU identifier `%s'"), cpuid);

@ -241,13 +241,18 @@ yasm_x86__parse_check_regtmod(yasm_arch *arch, const char *id, size_t id_len,
{
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(id, id_len);
pdata = regtmod_find(lcaseid, id_len);
if (!pdata)
return YASM_ARCH_NOTREGTMOD;

Loading…
Cancel
Save