diff options
Diffstat (limited to 'opcodes/openrisc-asm.c')
-rw-r--r-- | opcodes/openrisc-asm.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/opcodes/openrisc-asm.c b/opcodes/openrisc-asm.c index b414cb5..de9b554 100644 --- a/opcodes/openrisc-asm.c +++ b/opcodes/openrisc-asm.c @@ -26,9 +26,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., Keep that in mind. */ #include "sysdep.h" +#include <ctype.h> #include <stdio.h> #include "ansidecl.h" -#include "safe-ctype.h" #include "bfd.h" #include "symcat.h" #include "openrisc-desc.h" @@ -44,14 +44,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., static const char * parse_insn_normal PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *)); -long openrisc_sign_extend_16bit - PARAMS ((long)); -static const char * parse_hi16 - PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); -static const char * parse_lo16 - PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); -const char * openrisc_cgen_parse_operand - PARAMS ((CGEN_CPU_DESC, int, const char **, CGEN_FIELDS *)); /* -- assembler routines inserted here */ @@ -59,6 +51,11 @@ const char * openrisc_cgen_parse_operand #define CGEN_VERBOSE_ASSEMBLER_ERRORS +static const char * parse_hi16 + PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); +static const char * parse_lo16 + PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); + long openrisc_sign_extend_16bit (value) long value; @@ -66,7 +63,6 @@ openrisc_sign_extend_16bit (value) return (long) (short) value; } - /* Handle hi(). */ static const char * @@ -116,8 +112,7 @@ parse_hi16 (cd, strp, opindex, valuep) return errmsg; } - -/* Handle lo() */ +/* Handle lo(). */ static const char * parse_lo16 (cd, strp, opindex, valuep) @@ -167,6 +162,9 @@ parse_lo16 (cd, strp, opindex, valuep) /* -- */ +const char * openrisc_cgen_parse_operand + PARAMS ((CGEN_CPU_DESC, int, const char **, CGEN_FIELDS *)); + /* Main entry point for operand parsing. This function is basically just a big switch statement. Earlier versions @@ -278,8 +276,7 @@ openrisc_cgen_init_asm (cd) It then compiles the regex and stores it in the opcode, for later use by openrisc_cgen_assemble_insn - returns NULL for success, an error message for failure -*/ + Returns NULL for success, an error message for failure. */ char * openrisc_cgen_build_insn_regex (insn) @@ -402,14 +399,14 @@ parse_insn_normal (cd, insn, strp, fields) GAS's input scrubber will ensure mnemonics are lowercase, but we may not be called from GAS. */ p = CGEN_INSN_MNEMONIC (insn); - while (*p && TOLOWER (*p) == TOLOWER (*str)) + while (*p && tolower (*p) == tolower (*str)) ++p, ++str; if (* p) return _("unrecognized instruction"); #ifndef CGEN_MNEMONIC_OPERANDS - if (* str && !ISSPACE (* str)) + if (* str && !isspace (* str)) return _("unrecognized instruction"); #endif @@ -438,7 +435,7 @@ parse_insn_normal (cd, insn, strp, fields) first char after the mnemonic part is a space. */ /* FIXME: We also take inappropriate advantage of the fact that GAS's input scrubber will remove extraneous blanks. */ - if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn))) + if (tolower (*str) == tolower (CGEN_SYNTAX_CHAR (* syn))) { #ifdef CGEN_MNEMONIC_OPERANDS if (CGEN_SYNTAX_CHAR(* syn) == ' ') @@ -485,7 +482,7 @@ parse_insn_normal (cd, insn, strp, fields) blanks now. IE: We needn't try again with a longer version of the insn and it is assumed that longer versions of insns appear before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */ - while (ISSPACE (* str)) + while (isspace (* str)) ++ str; if (* str != '\0') @@ -534,7 +531,7 @@ openrisc_cgen_assemble_insn (cd, str, fields, buf, errmsg) int recognized_mnemonic = 0; /* Skip leading white space. */ - while (ISSPACE (* str)) + while (isspace (* str)) ++ str; /* The instructions are stored in hashed lists. |