* generalization
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 3 Jan 2001 15:10:26 +0000 (15:10 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Wed, 3 Jan 2001 15:10:26 +0000 (15:10 +0000)
2001-01-03  Richard Sandiford  <r.sandiford@redhat.com>

 cgen-dis.in (read_insn): Use bfd_get_bits()

opcodes/ChangeLog
opcodes/cgen-dis.in

index a9a0645acba01652397ee40f6c1a07b6e0d4c375..1666a769c2e9e57b6f18681267843dc5decc1af0 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-03  Richard Sandiford  <r.sandiford@redhat.com>
+
+        cgen-dis.in (read_insn): Use bfd_get_bits()
+
 2001-01-02  Richard Sandiford  <rsandifo@redhat.com>
 
        * cgen-dis.c (hash_insn_array): Use bfd_put_bits().
index 22cef1f0fee19e0f6ff72ce4e94c015a7831ea30..9d25c1a3476c8b8ee4f69a2a81aa2ff903daa614 100644 (file)
@@ -211,21 +211,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;
 }
 
This page took 0.046416 seconds and 4 git commands to generate.