From 4af823161d6b4275181bf560e41bca5dc274224d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 17 Sep 2007 02:58:05 +0000 Subject: [PATCH] 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 --- modules/arch/x86/tests/Makefile.inc | 2 ++ modules/arch/x86/tests/mixcase.asm | 3 +++ modules/arch/x86/tests/mixcase.hex | 3 +++ modules/arch/x86/x86cpu.gperf | 8 ++++++-- modules/arch/x86/x86regtmod.gperf | 7 ++++++- 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 modules/arch/x86/tests/mixcase.asm create mode 100644 modules/arch/x86/tests/mixcase.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 60406bfc..c513ad17 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -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 diff --git a/modules/arch/x86/tests/mixcase.asm b/modules/arch/x86/tests/mixcase.asm new file mode 100644 index 00000000..4964e721 --- /dev/null +++ b/modules/arch/x86/tests/mixcase.asm @@ -0,0 +1,3 @@ +CPU SSE5 +MOV AX,5 + diff --git a/modules/arch/x86/tests/mixcase.hex b/modules/arch/x86/tests/mixcase.hex new file mode 100644 index 00000000..76dc00b9 --- /dev/null +++ b/modules/arch/x86/tests/mixcase.hex @@ -0,0 +1,3 @@ +b8 +05 +00 diff --git a/modules/arch/x86/x86cpu.gperf b/modules/arch/x86/x86cpu.gperf index 3597b535..5878a917 100644 --- a/modules/arch/x86/x86cpu.gperf +++ b/modules/arch/x86/x86cpu.gperf @@ -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 7) return YASM_ARCH_NOTREGTMOD; + for (i=0; i