diff options
author | Christian Groessler <chris@groessler.org> | 2003-12-05 23:40:04 +0000 |
---|---|---|
committer | Christian Groessler <chris@groessler.org> | 2003-12-05 23:40:04 +0000 |
commit | f69532ae1b5a4fa9214a62713b67bd00e078f561 (patch) | |
tree | 5f700f53eae7628597fb60255b2482c8efecb2e2 | |
parent | 24bc63c55a549e1942bd1f64f95f77ea39100c54 (diff) | |
download | gdb-f69532ae1b5a4fa9214a62713b67bd00e078f561.zip gdb-f69532ae1b5a4fa9214a62713b67bd00e078f561.tar.gz gdb-f69532ae1b5a4fa9214a62713b67bd00e078f561.tar.bz2 |
* config/tc-z8k.c (parse_reg): Be case insensitive when checking
register names.
(get_ctrl_operand): Be case insensitive when checking ctrl names.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-z8k.c | 43 |
2 files changed, 25 insertions, 24 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 155e4c1..8ce8aec 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,4 +1,8 @@ - * +2003-12-06 Christian Groessler <chris@groessler.org> + + * config/tc-z8k.c (parse_reg): Be case insensitive when checking + register names. + (get_ctrl_operand): Be case insensitive when checking ctrl names. 2003-12-05 Nick Clifton <nickc@redhat.com> diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index 348add2..f022700 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -246,7 +246,10 @@ parse_reg (char *src, int *mode, unsigned int *reg) char *res = 0; char regno; - if (src[0] == 's' && src[1] == 'p' && (src[2] == 0 || src[2] == ',')) + /* Check for stack pointer "sp" alias. */ + if ((src[0] == 's' || src[0] == 'S') + && (src[1] == 'p' || src[1] == 'P') + && (src[2] == 0 || src[2] == ',')) { if (segmented_mode) { @@ -260,9 +263,10 @@ parse_reg (char *src, int *mode, unsigned int *reg) } return src + 2; } - if (src[0] == 'r') + + if (src[0] == 'r' || src[0] == 'R') { - if (src[1] == 'r') + if (src[1] == 'r' || src[1] == 'R') { if (src[2] < '0' || src[2] > '9') return res; /* Assume no register name but a label starting with 'rr'. */ @@ -274,7 +278,7 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (regno & 1) as_bad (_("register rr%d does not exist"), regno); } - else if (src[1] == 'h') + else if (src[1] == 'h' || src[1] == 'H') { if (src[2] < '0' || src[2] > '9') return res; /* Assume no register name but a label starting with 'rh'. */ @@ -284,7 +288,7 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (regno > 7) as_bad (_("register rh%d out of range"), regno); } - else if (src[1] == 'l') + else if (src[1] == 'l' || src[1] == 'L') { if (src[2] < '0' || src[2] > '9') return res; /* Assume no register name but a label starting with 'rl'. */ @@ -295,7 +299,7 @@ parse_reg (char *src, int *mode, unsigned int *reg) as_bad (_("register rl%d out of range"), regno); *reg += 8; } - else if (src[1] == 'q') + else if (src[1] == 'q' || src[1] == 'Q') { if (src[2] < '0' || src[2] > '9') return res; /* Assume no register name but a label starting with 'rq'. */ @@ -410,7 +414,7 @@ static void get_ctrl_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_UNUSED) { char *src = *ptr; - int i; + int i, l; while (*src == ' ') src++; @@ -418,18 +422,15 @@ get_ctrl_operand (char **ptr, struct z8k_op *mode, unsigned int dst ATTRIBUTE_UN mode->mode = CLASS_CTRL; for (i = 0; ctrl_table[i].name; i++) { - int j; - - for (j = 0; ctrl_table[i].name[j]; j++) - { - if (ctrl_table[i].name[j] != src[j]) - goto fail; - } - the_ctrl = ctrl_table[i].value; - *ptr = src + j; - return; - fail: - ; + l = strlen (ctrl_table[i].name); + if (! strncasecmp (ctrl_table[i].name, src, l)) + { + the_ctrl = ctrl_table[i].value; + if (*(src + l) && *(src + l) != ',') + break; + *ptr = src + l; /* Valid control name found: "consume" it. */ + return; + } } the_ctrl = 0; return; @@ -721,13 +722,10 @@ get_operands (const opcode_entry_type *opcode, char *op_end, op_type *operand) ptr++; /* Consume rest of line. */ } } - else if (opcode->arg_info[0] == CLASS_FLAGS) get_flags_operand (&ptr, operand + 0, 0); - else if (opcode->arg_info[0] == (CLASS_IMM + (ARG_IMM2))) get_interrupt_operand (&ptr, operand + 0, 0); - else get_operand (&ptr, operand + 0, 0); @@ -751,7 +749,6 @@ get_operands (const opcode_entry_type *opcode, char *op_end, op_type *operand) as_bad (_("invalid condition code '%s'"), savptr); } } - else if (opcode->arg_info[0] == CLASS_CTRL) { get_ctrl_operand (&ptr, operand + 0, 0); |