diff options
author | Jan Beulich <jbeulich@novell.com> | 2005-05-09 06:44:51 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2005-05-09 06:44:51 +0000 |
commit | 089dfecdde9d6ef28dc2131603dab78e0668c32f (patch) | |
tree | 0edc6a38cb0079b7a52896957b1422908fb7a3b0 /gas/config/tc-i386.c | |
parent | f41bbced4588cb88ed116a617f705bcfaf9ba486 (diff) | |
download | gdb-089dfecdde9d6ef28dc2131603dab78e0668c32f.zip gdb-089dfecdde9d6ef28dc2131603dab78e0668c32f.tar.gz gdb-089dfecdde9d6ef28dc2131603dab78e0668c32f.tar.bz2 |
gas/
2005-05-09 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (tc_x86_regname_to_dw2regnum): Correct 64-bit mode
names to match ABI. Add more registers for 32-bit and 64-bit modes.
Make name array static and const. Adjust lookup to account for NULL
entries (standing for unused register numbers).
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 7b26546..be4d814 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6789,21 +6789,36 @@ tc_x86_regname_to_dw2regnum (const char *regname) { unsigned int regnum; unsigned int regnames_count; - char *regnames_32[] = + static const char *const regnames_32[] = { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", - "eip" + "eip", "eflags", NULL, + "st0", "st1", "st2", "st3", + "st4", "st5", "st6", "st7", + NULL, NULL, + "xmm0", "xmm1", "xmm2", "xmm3", + "xmm4", "xmm5", "xmm6", "xmm7", + "mm0", "mm1", "mm2", "mm3", + "mm4", "mm5", "mm6", "mm7" }; - char *regnames_64[] = + static const char *const regnames_64[] = { - "rax", "rbx", "rcx", "rdx", - "rdi", "rsi", "rbp", "rsp", - "r8", "r9", "r10", "r11", + "rax", "rdx", "rcx", "rbx", + "rsi", "rdi", "rbp", "rsp", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "rip" + "rip", + "xmm0", "xmm1", "xmm2", "xmm3", + "xmm4", "xmm5", "xmm6", "xmm7", + "xmm8", "xmm9", "xmm10", "xmm11", + "xmm12", "xmm13", "xmm14", "xmm15", + "st0", "st1", "st2", "st3", + "st4", "st5", "st6", "st7", + "mm0", "mm1", "mm2", "mm3", + "mm4", "mm5", "mm6", "mm7" }; - char **regnames; + const char *const *regnames; if (flag_code == CODE_64BIT) { @@ -6817,7 +6832,8 @@ tc_x86_regname_to_dw2regnum (const char *regname) } for (regnum = 0; regnum < regnames_count; regnum++) - if (strcmp (regname, regnames[regnum]) == 0) + if (regnames[regnum] != NULL + && strcmp (regname, regnames[regnum]) == 0) return regnum; return -1; |