OSDN Git Service

For include/opcode:
authorGavin Romig-Koch <gavin@redhat.com>
Mon, 1 Nov 1999 19:29:55 +0000 (19:29 +0000)
committerGavin Romig-Koch <gavin@redhat.com>
Mon, 1 Nov 1999 19:29:55 +0000 (19:29 +0000)
* mips.h (OPCODE_IS_MEMBER): New.

For gas:

* config/tc-mips.c (macro_build): Use OPCODE_IS_MEMBER.
(mips_ip): Use OPCODE_IS_MEMBER.

For opcodes:

* mips-dis.c (_print_insn_mips): Use OPCODE_IS_MEMBER.

include/opcode/ChangeLog
include/opcode/mips.h
opcodes/ChangeLog
opcodes/mips-dis.c

index 63d2e83..ebf79dd 100644 (file)
@@ -1,3 +1,7 @@
+1999-11-01  Gavin Romig-Koch  <gavin@cygnus.com>
+
+       * mips.h (OPCODE_IS_MEMBER): New.
+
 1999-10-29  Nick Clifton  <nickc@cygnus.com>
 
        * d30v.h (SHORT_AR): Define.
index f0a8c7e..07e0fd7 100644 (file)
@@ -319,6 +319,24 @@ struct mips_opcode
 /* Toshiba R3900 instruction.  */
 #define INSN_3900                   0x00000080
 
+/* Test for membership in an ISA including chip specific ISAs.
+   INSN is pointer to an element of the opcode table; ISA is the
+   specified ISA to test against; and CPU is the CPU specific ISA
+   to test, or zero if no CPU specific ISA test is desired. */ 
+
+#define OPCODE_IS_MEMBER(insn,isa,cpu)                                 \
+    ((((insn)->membership & INSN_ISA) != 0                     \
+      && ((insn)->membership & INSN_ISA) <= isa)               \
+     || (cpu == 4650                                           \
+        && ((insn)->membership & INSN_4650) != 0)              \
+     || (cpu == 4010                                           \
+        && ((insn)->membership & INSN_4010) != 0)              \
+     || ((cpu == 4100                                          \
+         || cpu == 4111                                        \
+         )                                                     \
+        && ((insn)->membership & INSN_4100) != 0)              \
+     || (cpu == 3900                                           \
+        && ((insn)->membership & INSN_3900) != 0))
 
 /* This is a list of macro expanded instructions.
  *
index b8c8822..0ac1cf1 100644 (file)
@@ -1,3 +1,7 @@
+1999-11-01  Gavin Romig-Koch  <gavin@cygnus.com>
+
+       * mips-dis.c (_print_insn_mips): Use OPCODE_IS_MEMBER.
+
 1999-10-29  Nick Clifton  <nickc@cygnus.com>
 
        * d30v-opc.c (mvtacc): Use format SHORT_AR not SHORT_AA
index 1e3577c..a1bd62e 100644 (file)
@@ -387,28 +387,8 @@ _print_insn_mips (memaddr, word, info)
          if (op->pinfo != INSN_MACRO && (word & op->mask) == op->match)
            {
              register const char *d;
-             int insn_isa;
-
-             if ((op->membership & INSN_ISA) == INSN_ISA1)
-               insn_isa = 1;
-             else if ((op->membership & INSN_ISA) == INSN_ISA2)
-               insn_isa = 2;
-             else if ((op->membership & INSN_ISA) == INSN_ISA3)
-               insn_isa = 3;
-             else if ((op->membership & INSN_ISA) == INSN_ISA4)
-               insn_isa = 4;
-             else
-               insn_isa = 15;
-
-             if (insn_isa > mips_isa
-                 && (target_processor == 4650
-                     && op->membership & INSN_4650) == 0
-                 && (target_processor == 4010
-                     && op->membership & INSN_4010) == 0
-                 && (target_processor == 4100
-                     && op->membership & INSN_4100) == 0
-                 && (target_processor == 3900
-                     && op->membership & INSN_3900) == 0)
+
+             if (! OPCODE_IS_MEMBER (op, mips_isa, target_processor))
                continue;
 
              (*info->fprintf_func) (info->stream, "%s", op->name);