summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/opcodes/cgen-dis.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-05-13 14:00:18 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-05-13 14:00:18 +0000
commit80569f10d304683516f20f86bbafb107127ff63e (patch)
tree5d81f65131a54f7b47340b5148a9f878549db293 /gnu/usr.bin/binutils/opcodes/cgen-dis.c
parent9ed85e2bfb346f753dcf53ed63b65520ed413f8b (diff)
Import binutils-2.11.2
- only the binutils package (no gdb here) - don't import libiberty and texinfo, they are elsewhere - remove all .info* generated files
Diffstat (limited to 'gnu/usr.bin/binutils/opcodes/cgen-dis.c')
-rw-r--r--gnu/usr.bin/binutils/opcodes/cgen-dis.c55
1 files changed, 11 insertions, 44 deletions
diff --git a/gnu/usr.bin/binutils/opcodes/cgen-dis.c b/gnu/usr.bin/binutils/opcodes/cgen-dis.c
index 78b1cd90ed9..b4297bb44d7 100644
--- a/gnu/usr.bin/binutils/opcodes/cgen-dis.c
+++ b/gnu/usr.bin/binutils/opcodes/cgen-dis.c
@@ -1,6 +1,7 @@
/* CGEN generic disassembler support code.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of the GNU Binutils and GDB, the GNU debugger.
@@ -43,7 +44,7 @@ hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
CGEN_CPU_DESC cd;
const CGEN_INSN * insns;
int count;
- int entsize;
+ int entsize ATTRIBUTE_UNUSED;
CGEN_INSN_LIST ** htable;
CGEN_INSN_LIST * hentbuf;
{
@@ -64,27 +65,10 @@ hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
to hash on, so set both up. */
value = CGEN_INSN_BASE_VALUE (insn);
- switch (CGEN_INSN_MASK_BITSIZE (insn))
- {
- case 8:
- buf[0] = value;
- break;
- case 16:
- if (big_p)
- bfd_putb16 ((bfd_vma) value, buf);
- else
- bfd_putl16 ((bfd_vma) value, buf);
- break;
- case 32:
- if (big_p)
- bfd_putb32 ((bfd_vma) value, buf);
- else
- bfd_putl32 ((bfd_vma) value, buf);
- break;
- default:
- abort ();
- }
-
+ bfd_put_bits ((bfd_vma) value,
+ buf,
+ CGEN_INSN_MASK_BITSIZE (insn),
+ big_p);
hash = (* cd->dis_hash) (buf, value);
hentbuf->next = htable[hash];
hentbuf->insn = insn;
@@ -121,27 +105,10 @@ hash_insn_list (cd, insns, htable, hentbuf)
to hash on, so set both up. */
value = CGEN_INSN_BASE_VALUE (ilist->insn);
- switch (CGEN_INSN_MASK_BITSIZE (ilist->insn))
- {
- case 8:
- buf[0] = value;
- break;
- case 16:
- if (big_p)
- bfd_putb16 ((bfd_vma) value, buf);
- else
- bfd_putl16 ((bfd_vma) value, buf);
- break;
- case 32:
- if (big_p)
- bfd_putb32 ((bfd_vma) value, buf);
- else
- bfd_putl32 ((bfd_vma) value, buf);
- break;
- default:
- abort ();
- }
-
+ bfd_put_bits((bfd_vma) value,
+ buf,
+ CGEN_INSN_MASK_BITSIZE (ilist->insn),
+ big_p);
hash = (* cd->dis_hash) (buf, value);
hentbuf->next = htable [hash];
hentbuf->insn = ilist->insn;