2001-03-13 Fernando Nasser <fnasser@redhat.com>
[deliverable/binutils-gdb.git] / opcodes / m32r-dis.c
index 9b0397f3b7cb5f2147cb0c57b6ca40ced20217b5..455f8a38f126af9b8255bf3d996d4fcd619c4290 100644 (file)
@@ -4,7 +4,7 @@
 THIS FILE IS MACHINE GENERATED WITH CGEN.
 - the resultant file is machine generated, cgen-dis.in isn't
 
-Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
 
 This file is part of the GNU Binutils and GDB, the GNU debugger.
 
@@ -369,7 +369,7 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
 {
   const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
   disassemble_info *info = (disassemble_info *) dis_info;
-  const unsigned char *syn;
+  const CGEN_SYNTAX_CHAR_TYPE *syn;
 
   CGEN_INIT_PRINT (cd);
 
@@ -416,21 +416,7 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
   ex_info->valid = (1 << buflen) - 1;
   ex_info->insn_bytes = buf;
 
-  switch (buflen)
-    {
-    case 1:
-      *insn_value = buf[0];
-      break;
-    case 2:
-      *insn_value = info->endian == BFD_ENDIAN_BIG ? bfd_getb16 (buf) : bfd_getl16 (buf);
-      break;
-    case 4:
-      *insn_value = info->endian == BFD_ENDIAN_BIG ? bfd_getb32 (buf) : bfd_getl32 (buf);
-      break;
-    default:
-      abort ();
-    }
-
+  *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG);
   return 0;
 }
 
@@ -486,9 +472,10 @@ print_insn (cd, pc, info, buf, buflen)
             machine insn and extracts the fields.  The second pass prints
             them.  */
 
-#if CGEN_INT_INSN_P
-         /* Make sure the entire insn is loaded into insn_value.  */
-         if (CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize)
+         /* Make sure the entire insn is loaded into insn_value, if it
+            can fit.  */
+         if (CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize &&
+             (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long))
            {
              unsigned long full_insn_value;
              int rc = read_insn (cd, pc, info, buf,
@@ -500,10 +487,9 @@ print_insn (cd, pc, info, buf, buflen)
                (cd, insn, &ex_info, full_insn_value, &fields, pc);
            }
          else
-#endif
+           length = CGEN_EXTRACT_FN (cd, insn)
+             (cd, insn, &ex_info, insn_value, &fields, pc);
 
-         length = CGEN_EXTRACT_FN (cd, insn)
-           (cd, insn, &ex_info, insn_value, &fields, pc);
          /* length < 0 -> error */
          if (length < 0)
            return length;
This page took 0.027263 seconds and 4 git commands to generate.