aboutsummaryrefslogtreecommitdiff
path: root/opcodes/ip2k-opc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-12-02 21:58:19 +0000
committerAlan Modra <amodra@gmail.com>2002-12-02 21:58:19 +0000
commit98f70fc4f028bc7399345947077e733e1feddb55 (patch)
treee7fea9c6ca588c2d7861260a00fb8aad73dbeb90 /opcodes/ip2k-opc.c
parent4fdf0a751a935351f70e4167c48fe10529a8c287 (diff)
downloadgdb-98f70fc4f028bc7399345947077e733e1feddb55.zip
gdb-98f70fc4f028bc7399345947077e733e1feddb55.tar.gz
gdb-98f70fc4f028bc7399345947077e733e1feddb55.tar.bz2
* cgen-dis.in: Include libiberty.h.
* fr30-desc.c: Regenerate. * fr30-dis.c: Regenerate. * frv-desc.c: Regenerate. * frv-dis.c: Regenerate. * ip2k-asm.c: Regenerate. * ip2k-desc.c: Regenerate. * ip2k-dis.c: Regenerate. * ip2k-opc.c: Regenerate. * ip2k-opc.h: Regenerate. * m32r-desc.c: Regenerate. * m32r-dis.c: Regenerate. * openrisc-desc.c: Regenerate. * openrisc-dis.c: Regenerate. * xstormy16-asm.c: Regenerate. * xstormy16-desc.c: Regenerate. * xstormy16-dis.c: Regenerate.
Diffstat (limited to 'opcodes/ip2k-opc.c')
-rw-r--r--opcodes/ip2k-opc.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/opcodes/ip2k-opc.c b/opcodes/ip2k-opc.c
index 311a0f7..691cc78 100644
--- a/opcodes/ip2k-opc.c
+++ b/opcodes/ip2k-opc.c
@@ -32,6 +32,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/* -- opc.c */
+#include "safe-ctype.h"
+
/* A better hash function for instruction mnemonics. */
unsigned int
ip2k_asm_hash (insn)
@@ -40,8 +42,8 @@ ip2k_asm_hash (insn)
unsigned int hash;
const char* m = insn;
- for (hash = 0; *m && !isspace(*m); m++)
- hash = (hash * 23) ^ (0x1F & tolower(*m));
+ for (hash = 0; *m && !ISSPACE(*m); m++)
+ hash = (hash * 23) ^ (0x1F & TOLOWER(*m));
/* printf ("%s %d\n", insn, (hash % CGEN_ASM_HASH_SIZE)); */
@@ -49,6 +51,20 @@ ip2k_asm_hash (insn)
}
+/* Special check to ensure that instruction exists for given machine. */
+int
+ip2k_cgen_insn_supported (cd, insn)
+ CGEN_CPU_DESC cd;
+ const CGEN_INSN *insn;
+{
+ int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH);
+
+ /* No mach attribute? Assume it's supported for all machs. */
+ if (machs == 0)
+ return 1;
+
+ return ((machs & cd->machs) != 0);
+}
/* -- asm.c */