* i370-dis.c: Likewise.
* i370-opc.c: Likewiwse.
* i960-dis.c: Likewise.
* ia64-opc.c: Likewise.
+2003-09-14 Andreas Jaeger <aj@suse.de>
+
+ * i386-dis.c: Convert to ISO C90 prototypes.
+ * i370-dis.c: Likewise.
+ * i370-opc.c: Likewiwse.
+ * i960-dis.c: Likewise.
+ * ia64-opc.c: Likewise.
+
2003-09-09 Dave Brolley <brolley@redhat.com>
* frv-desc.c: Regenerated.
-
/* i370-dis.c -- Disassemble Instruction 370 (ESA/390) instructions
- Copyright 1994, 2000 Free Software Foundation, Inc.
+ Copyright 1994, 2000, 2003 Free Software Foundation, Inc.
PowerPC version written by Ian Lance Taylor, Cygnus Support
Rewritten for i370 ESA/390 support by Linas Vepstas <linas@linas.org>
*/
int
-print_insn_i370 (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_i370 (bfd_vma memaddr, struct disassemble_info *info)
{
bfd_byte buffer[8];
int status;
/* i370-opc.c -- Instruction 370 (ESA/390) architecture opcode list
- Copyright 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1994, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
PowerPC version written by Ian Lance Taylor, Cygnus Support
Rewritten for i370 ESA/390 support by Linas Vepstas <linas@linas.org> 1998, 1999
file. */
\f
/* Local insertion and extraction functions. */
-static i370_insn_t insert_ss_b2 PARAMS (( i370_insn_t, long, const char **));
-static i370_insn_t insert_ss_d2 PARAMS (( i370_insn_t, long, const char **));
-static i370_insn_t insert_rxf_r3 PARAMS (( i370_insn_t, long, const char **));
-static long extract_ss_b2 PARAMS (( i370_insn_t, int *));
-static long extract_ss_d2 PARAMS (( i370_insn_t, int *));
-static long extract_rxf_r3 PARAMS (( i370_insn_t, int *));
+static i370_insn_t insert_ss_b2 (i370_insn_t, long, const char **);
+static i370_insn_t insert_ss_d2 (i370_insn_t, long, const char **);
+static i370_insn_t insert_rxf_r3 (i370_insn_t, long, const char **);
+static long extract_ss_b2 (i370_insn_t, int *);
+static long extract_ss_d2 (i370_insn_t, int *);
+static long extract_rxf_r3 (i370_insn_t, int *);
\f
/* The operands table.
/*ARGSUSED*/
static i370_insn_t
-insert_ss_b2 (insn, value, errmsg)
- i370_insn_t insn;
- long value;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_ss_b2 (i370_insn_t insn, long value,
+ const char **errmsg ATTRIBUTE_UNUSED)
{
insn.i[1] |= (value & 0xf) << 28;
return insn;
}
static i370_insn_t
-insert_ss_d2 (insn, value, errmsg)
- i370_insn_t insn;
- long value;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_ss_d2 (i370_insn_t insn, long value,
+ const char **errmsg ATTRIBUTE_UNUSED)
{
insn.i[1] |= (value & 0xfff) << 16;
return insn;
}
static i370_insn_t
-insert_rxf_r3 (insn, value, errmsg)
- i370_insn_t insn;
- long value;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_rxf_r3 (i370_insn_t insn, long value,
+ const char **errmsg ATTRIBUTE_UNUSED)
{
insn.i[1] |= (value & 0xf) << 28;
return insn;
}
static long
-extract_ss_b2 (insn, invalid)
- i370_insn_t insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_ss_b2 (i370_insn_t insn, int *invalid ATTRIBUTE_UNUSED)
{
return (insn.i[1] >>28) & 0xf;
}
static long
-extract_ss_d2 (insn, invalid)
- i370_insn_t insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_ss_d2 (i370_insn_t insn, int *invalid ATTRIBUTE_UNUSED)
{
return (insn.i[1] >>16) & 0xfff;
}
static long
-extract_rxf_r3 (insn, invalid)
- i370_insn_t insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_rxf_r3 (i370_insn_t insn, int *invalid ATTRIBUTE_UNUSED)
{
return (insn.i[1] >>28) & 0xf;
}
{ "xi", 4, {{SI(0x97,0,0,0), 0}}, {{SI_MASK, 0}}, I370, {SI_D1, SI_B1, SI_I2} },
/* S form instructions */
-{ "cfc", 4, {{S(0xb21a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "csch", 4, {{S(0xb230,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "hsch", 4, {{S(0xb231,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "ipk", 4, {{S(0xb20b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "lfpc", 4, {{S(0xb29d,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
-{ "lpsw", 4, {{S(0x8200,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "msch", 4, {{S(0xb232,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "pc", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "pcf", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IPC, {S_D2, S_B2} },
-{ "ptlb", 4, {{S(0xb20d,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "rchp", 4, {{S(0xb23b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "rp", 4, {{S(0xb277,0,0), 0}}, {{S_MASK, 0}}, IRP, {0} },
-{ "rsch", 4, {{S(0xb238,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "sac", 4, {{S(0xb219,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "sacf", 4, {{S(0xb279,0,0), 0}}, {{S_MASK, 0}}, ISA, {S_D2, S_B2} },
-{ "sal", 4, {{S(0xb237,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "schm", 4, {{S(0xb23c,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "sck", 4, {{S(0xb204,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "sckc", 4, {{S(0xb206,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "spka", 4, {{S(0xb20a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "spt", 4, {{S(0xb208,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "spx", 4, {{S(0xb210,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "srnm", 4, {{S(0xb299,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
-{ "ssch", 4, {{S(0xb233,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "ssm", 4, {{S(0x8000,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "stap", 4, {{S(0xb212,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stck", 4, {{S(0xb205,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stckc", 4, {{S(0xb207,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "stcps", 4, {{S(0xb23a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stcrw", 4, {{S(0xb239,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stfpc", 4, {{S(0xb29c,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
-{ "stidp", 4, {{S(0xb202,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "stpt", 4, {{S(0xb209,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stpx", 4, {{S(0xb211,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stsch", 4, {{S(0xb234,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "tpi", 4, {{S(0xb236,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "trap4", 4, {{S(0xb2ff,0,0), 0}}, {{S_MASK, 0}}, ITR, {S_D2, S_B2} },
-{ "ts", 4, {{S(0x9300,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "tsch", 4, {{S(0xb235,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "cfc", 4, {{S(0xb21a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "csch", 4, {{S(0xb230,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "hsch", 4, {{S(0xb231,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "ipk", 4, {{S(0xb20b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "lfpc", 4, {{S(0xb29d,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
+{ "lpsw", 4, {{S(0x8200,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "msch", 4, {{S(0xb232,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "pc", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "pcf", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IPC, {S_D2, S_B2} },
+{ "ptlb", 4, {{S(0xb20d,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "rchp", 4, {{S(0xb23b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "rp", 4, {{S(0xb277,0,0), 0}}, {{S_MASK, 0}}, IRP, {0} },
+{ "rsch", 4, {{S(0xb238,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "sac", 4, {{S(0xb219,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "sacf", 4, {{S(0xb279,0,0), 0}}, {{S_MASK, 0}}, ISA, {S_D2, S_B2} },
+{ "sal", 4, {{S(0xb237,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "schm", 4, {{S(0xb23c,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "sck", 4, {{S(0xb204,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "sckc", 4, {{S(0xb206,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "spka", 4, {{S(0xb20a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "spt", 4, {{S(0xb208,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "spx", 4, {{S(0xb210,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "srnm", 4, {{S(0xb299,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
+{ "ssch", 4, {{S(0xb233,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "ssm", 4, {{S(0x8000,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "stap", 4, {{S(0xb212,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stck", 4, {{S(0xb205,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stckc", 4, {{S(0xb207,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "stcps", 4, {{S(0xb23a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stcrw", 4, {{S(0xb239,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stfpc", 4, {{S(0xb29c,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
+{ "stidp", 4, {{S(0xb202,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "stpt", 4, {{S(0xb209,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stpx", 4, {{S(0xb211,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stsch", 4, {{S(0xb234,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "tpi", 4, {{S(0xb236,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "trap4", 4, {{S(0xb2ff,0,0), 0}}, {{S_MASK, 0}}, ITR, {S_D2, S_B2} },
+{ "ts", 4, {{S(0x9300,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "tsch", 4, {{S(0xb235,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
/* SS form instructions */
{ "ap", 6, {{SSH(0xfa,0,0,0), 0}}, {{SS_MASK, 0}}, I370, {SS_D1,SS_L,SS_B1,SS_D2,SS_B2} },
#define UNIXWARE_COMPAT 1
#endif
-static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
-static void ckprefix PARAMS ((void));
-static const char *prefix_name PARAMS ((int, int));
-static int print_insn PARAMS ((bfd_vma, disassemble_info *));
-static void dofloat PARAMS ((int));
-static void OP_ST PARAMS ((int, int));
-static void OP_STi PARAMS ((int, int));
-static int putop PARAMS ((const char *, int));
-static void oappend PARAMS ((const char *));
-static void append_seg PARAMS ((void));
-static void OP_indirE PARAMS ((int, int));
-static void print_operand_value PARAMS ((char *, int, bfd_vma));
-static void OP_E PARAMS ((int, int));
-static void OP_G PARAMS ((int, int));
-static bfd_vma get64 PARAMS ((void));
-static bfd_signed_vma get32 PARAMS ((void));
-static bfd_signed_vma get32s PARAMS ((void));
-static int get16 PARAMS ((void));
-static void set_op PARAMS ((bfd_vma, int));
-static void OP_REG PARAMS ((int, int));
-static void OP_IMREG PARAMS ((int, int));
-static void OP_I PARAMS ((int, int));
-static void OP_I64 PARAMS ((int, int));
-static void OP_sI PARAMS ((int, int));
-static void OP_J PARAMS ((int, int));
-static void OP_SEG PARAMS ((int, int));
-static void OP_DIR PARAMS ((int, int));
-static void OP_OFF PARAMS ((int, int));
-static void OP_OFF64 PARAMS ((int, int));
-static void ptr_reg PARAMS ((int, int));
-static void OP_ESreg PARAMS ((int, int));
-static void OP_DSreg PARAMS ((int, int));
-static void OP_C PARAMS ((int, int));
-static void OP_D PARAMS ((int, int));
-static void OP_T PARAMS ((int, int));
-static void OP_Rd PARAMS ((int, int));
-static void OP_MMX PARAMS ((int, int));
-static void OP_XMM PARAMS ((int, int));
-static void OP_EM PARAMS ((int, int));
-static void OP_EX PARAMS ((int, int));
-static void OP_MS PARAMS ((int, int));
-static void OP_XS PARAMS ((int, int));
-static void OP_3DNowSuffix PARAMS ((int, int));
-static void OP_SIMD_Suffix PARAMS ((int, int));
-static void SIMD_Fixup PARAMS ((int, int));
-static void PNI_Fixup PARAMS ((int, int));
-static void BadOp PARAMS ((void));
+static int fetch_data (struct disassemble_info *, bfd_byte *);
+static void ckprefix (void);
+static const char *prefix_name (int, int);
+static int print_insn (bfd_vma, disassemble_info *);
+static void dofloat (int);
+static void OP_ST (int, int);
+static void OP_STi (int, int);
+static int putop (const char *, int);
+static void oappend (const char *);
+static void append_seg (void);
+static void OP_indirE (int, int);
+static void print_operand_value (char *, int, bfd_vma);
+static void OP_E (int, int);
+static void OP_G (int, int);
+static bfd_vma get64 (void);
+static bfd_signed_vma get32 (void);
+static bfd_signed_vma get32s (void);
+static int get16 (void);
+static void set_op (bfd_vma, int);
+static void OP_REG (int, int);
+static void OP_IMREG (int, int);
+static void OP_I (int, int);
+static void OP_I64 (int, int);
+static void OP_sI (int, int);
+static void OP_J (int, int);
+static void OP_SEG (int, int);
+static void OP_DIR (int, int);
+static void OP_OFF (int, int);
+static void OP_OFF64 (int, int);
+static void ptr_reg (int, int);
+static void OP_ESreg (int, int);
+static void OP_DSreg (int, int);
+static void OP_C (int, int);
+static void OP_D (int, int);
+static void OP_T (int, int);
+static void OP_Rd (int, int);
+static void OP_MMX (int, int);
+static void OP_XMM (int, int);
+static void OP_EM (int, int);
+static void OP_EX (int, int);
+static void OP_MS (int, int);
+static void OP_XS (int, int);
+static void OP_3DNowSuffix (int, int);
+static void OP_SIMD_Suffix (int, int);
+static void SIMD_Fixup (int, int);
+static void PNI_Fixup (int, int);
+static void BadOp (void);
struct dis_private {
/* Points to first byte not fetched. */
? 1 : fetch_data ((info), (addr)))
static int
-fetch_data (info, addr)
- struct disassemble_info *info;
- bfd_byte *addr;
+fetch_data (struct disassemble_info *info, bfd_byte *addr)
{
int status;
struct dis_private *priv = (struct dis_private *) info->private_data;
#define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0
-typedef void (*op_rtn) PARAMS ((int bytemode, int sizeflag));
+typedef void (*op_rtn) (int bytemode, int sizeflag);
struct dis386 {
const char *name;
#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
static void
-ckprefix ()
+ckprefix (void)
{
int newrex;
rex = 0;
prefix byte. */
static const char *
-prefix_name (pref, sizeflag)
- int pref;
- int sizeflag;
+prefix_name (int pref, int sizeflag)
{
switch (pref)
{
print_insn_i386_att and print_insn_i386_intel these functions can
disappear, and print_insn_i386 be merged into print_insn. */
int
-print_insn_i386_att (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_i386_att (bfd_vma pc, disassemble_info *info)
{
intel_syntax = 0;
}
int
-print_insn_i386_intel (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
{
intel_syntax = 1;
}
int
-print_insn_i386 (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_i386 (bfd_vma pc, disassemble_info *info)
{
intel_syntax = -1;
}
static int
-print_insn (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn (bfd_vma pc, disassemble_info *info)
{
const struct dis386 *dp;
int i;
puts most long word instructions on a single line. */
info->bytes_per_line = 7;
- info->private_data = (PTR) &priv;
+ info->private_data = &priv;
priv.max_fetched = priv.the_buffer;
priv.insn_start = pc;
};
static void
-dofloat (sizeflag)
- int sizeflag;
+dofloat (int sizeflag)
{
const struct dis386 *dp;
unsigned char floatop;
}
static void
-OP_ST (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
oappend ("%st");
}
static void
-OP_STi (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
sprintf (scratchbuf, "%%st(%d)", rm);
oappend (scratchbuf + intel_syntax);
/* Capital letters in template are macros. */
static int
-putop (template, sizeflag)
- const char *template;
- int sizeflag;
+putop (const char *template, int sizeflag)
{
const char *p;
int alt;
}
static void
-oappend (s)
- const char *s;
+oappend (const char *s)
{
strcpy (obufp, s);
obufp += strlen (s);
}
static void
-append_seg ()
+append_seg (void)
{
if (prefixes & PREFIX_CS)
{
}
static void
-OP_indirE (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_indirE (int bytemode, int sizeflag)
{
if (!intel_syntax)
oappend ("*");
}
static void
-print_operand_value (buf, hex, disp)
- char *buf;
- int hex;
- bfd_vma disp;
+print_operand_value (char *buf, int hex, bfd_vma disp)
{
if (mode_64bit)
{
}
static void
-OP_E (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_E (int bytemode, int sizeflag)
{
bfd_vma disp;
int add = 0;
}
static void
-OP_G (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_G (int bytemode, int sizeflag)
{
int add = 0;
USED_REX (REX_EXTX);
}
static bfd_vma
-get64 ()
+get64 (void)
{
bfd_vma x;
#ifdef BFD64
}
static bfd_signed_vma
-get32 ()
+get32 (void)
{
bfd_signed_vma x = 0;
}
static bfd_signed_vma
-get32s ()
+get32s (void)
{
bfd_signed_vma x = 0;
}
static int
-get16 ()
+get16 (void)
{
int x = 0;
}
static void
-set_op (op, riprel)
- bfd_vma op;
- int riprel;
+set_op (bfd_vma op, int riprel)
{
op_index[op_ad] = op_ad;
if (mode_64bit)
}
static void
-OP_REG (code, sizeflag)
- int code;
- int sizeflag;
+OP_REG (int code, int sizeflag)
{
const char *s;
int add = 0;
}
static void
-OP_IMREG (code, sizeflag)
- int code;
- int sizeflag;
+OP_IMREG (int code, int sizeflag)
{
const char *s;
}
static void
-OP_I (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_I (int bytemode, int sizeflag)
{
bfd_signed_vma op;
bfd_signed_vma mask = -1;
}
static void
-OP_I64 (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_I64 (int bytemode, int sizeflag)
{
bfd_signed_vma op;
bfd_signed_vma mask = -1;
}
static void
-OP_sI (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_sI (int bytemode, int sizeflag)
{
bfd_signed_vma op;
bfd_signed_vma mask = -1;
}
static void
-OP_J (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_J (int bytemode, int sizeflag)
{
bfd_vma disp;
bfd_vma mask = -1;
}
static void
-OP_SEG (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_SEG (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
oappend (names_seg[reg]);
}
static void
-OP_DIR (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag;
+OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
{
int seg, offset;
}
static void
-OP_OFF (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag;
+OP_OFF (int bytemode ATTRIBUTE_UNUSED, int sizeflag)
{
bfd_vma off;
}
static void
-OP_OFF64 (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_OFF64 (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
bfd_vma off;
}
static void
-ptr_reg (code, sizeflag)
- int code;
- int sizeflag;
+ptr_reg (int code, int sizeflag)
{
const char *s;
if (intel_syntax)
}
static void
-OP_ESreg (code, sizeflag)
- int code;
- int sizeflag;
+OP_ESreg (int code, int sizeflag)
{
oappend ("%es:" + intel_syntax);
ptr_reg (code, sizeflag);
}
static void
-OP_DSreg (code, sizeflag)
- int code;
- int sizeflag;
+OP_DSreg (int code, int sizeflag)
{
if ((prefixes
& (PREFIX_CS
}
static void
-OP_C (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
}
static void
-OP_D (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
}
static void
-OP_T (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
sprintf (scratchbuf, "%%tr%d", reg);
oappend (scratchbuf + intel_syntax);
}
static void
-OP_Rd (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_Rd (int bytemode, int sizeflag)
{
if (mod == 3)
OP_E (bytemode, sizeflag);
}
static void
-OP_MMX (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
}
static void
-OP_XMM (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
}
static void
-OP_EM (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_EM (int bytemode, int sizeflag)
{
int add = 0;
if (mod != 3)
}
static void
-OP_EX (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_EX (int bytemode, int sizeflag)
{
int add = 0;
if (mod != 3)
}
static void
-OP_MS (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_MS (int bytemode, int sizeflag)
{
if (mod == 3)
OP_EM (bytemode, sizeflag);
}
static void
-OP_XS (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_XS (int bytemode, int sizeflag)
{
if (mod == 3)
OP_EX (bytemode, sizeflag);
};
static void
-OP_3DNowSuffix (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
const char *mnemonic;
};
static void
-OP_SIMD_Suffix (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
unsigned int cmp_type;
}
static void
-SIMD_Fixup (extrachar, sizeflag)
- int extrachar;
- int sizeflag ATTRIBUTE_UNUSED;
+SIMD_Fixup (int extrachar, int sizeflag ATTRIBUTE_UNUSED)
{
/* Change movlps/movhps to movhlps/movlhps for 2 register operand
forms of these instructions. */
}
static void
-PNI_Fixup (extrachar, sizeflag)
- int extrachar ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
if (mod == 3 && reg == 1)
{
/* Disassemble i80960 instructions.
- Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
static FILE *stream; /* Output goes here */
static struct disassemble_info *info;
-static void print_addr PARAMS ((bfd_vma));
-static void ctrl PARAMS ((bfd_vma, unsigned long, unsigned long));
-static void cobr PARAMS ((bfd_vma, unsigned long, unsigned long));
-static void reg PARAMS ((unsigned long));
-static int mem PARAMS ((bfd_vma, unsigned long, unsigned long, int));
-static void ea PARAMS ((bfd_vma, int, const char *, const char *, int, unsigned int));
-static void dstop PARAMS ((int, int, int));
-static void regop PARAMS ((int, int, int, int));
-static void invalid PARAMS ((int));
-static int pinsn PARAMS ((bfd_vma, unsigned long, unsigned long));
-static void put_abs PARAMS ((unsigned long, unsigned long));
+static void print_addr (bfd_vma);
+static void ctrl (bfd_vma, unsigned long, unsigned long);
+static void cobr (bfd_vma, unsigned long, unsigned long);
+static void reg (unsigned long);
+static int mem (bfd_vma, unsigned long, unsigned long, int);
+static void ea (bfd_vma, int, const char *, const char *, int, unsigned int);
+static void dstop (int, int, int);
+static void regop (int, int, int, int);
+static void invalid (int);
+static int pinsn (bfd_vma, unsigned long, unsigned long);
+static void put_abs (unsigned long, unsigned long);
/* Print the i960 instruction at address 'memaddr' in debugged memory,
on INFO->STREAM. Returns length of the instruction, in bytes. */
int
-print_insn_i960 (memaddr, info_arg)
- bfd_vma memaddr;
- struct disassemble_info *info_arg;
+print_insn_i960 (bfd_vma memaddr, struct disassemble_info *info_arg)
{
unsigned int word1, word2 = 0xdeadbeef;
bfd_byte buffer[8];
};
static int
-pinsn (memaddr, word1, word2)
- bfd_vma memaddr;
- unsigned long word1, word2;
+pinsn (bfd_vma memaddr, unsigned long word1, unsigned long word2)
{
int instr_len;
-
+
instr_len = 4;
put_abs (word1, word2);
/* CTRL format.. */
static void
-ctrl (memaddr, word1, word2)
- bfd_vma memaddr;
- unsigned long word1;
- unsigned long word2 ATTRIBUTE_UNUSED;
+ctrl (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED)
{
int i;
static const struct tabent ctrl_tab[] = {
/* COBR format. */
static void
-cobr (memaddr, word1, word2)
- bfd_vma memaddr;
- unsigned long word1;
- unsigned long word2 ATTRIBUTE_UNUSED;
+cobr (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED)
{
int src1;
int src2;
int i;
-
+
static const struct tabent cobr_tab[] = {
{ "testno", 1, }, /* 0x20 */
{ "testg", 1, }, /* 0x21 */
/* Returns instruction length: 4 or 8. */
static int
-mem (memaddr, word1, word2, noprint)
- bfd_vma memaddr;
- unsigned long word1, word2;
- int noprint; /* If TRUE, return instruction length, but
- don't output any text. */
+mem (bfd_vma memaddr, unsigned long word1, unsigned long word2, int noprint)
{
int i, j;
int len;
int mode;
int offset;
const char *reg1, *reg2, *reg3;
-
+
/* This lookup table is too sparse to make it worth typing in, but not
so large as to make a sparse array necessary. We create the table
at runtime. */
&& ((mode == 5) || (mode >= 12)))
/* With 32-bit displacement. */
len = 8;
- else
+ else
len = 4;
if (noprint)
{ /* MEMA FORMAT */
(*info->fprintf_func) (stream, "0x%x", (unsigned) offset);
- if (mode & 8)
+ if (mode & 8)
(*info->fprintf_func) (stream, "(%s)", reg2);
(*info->fprintf_func)(stream, ",%s", reg1);
/* MEMA FORMAT */
(*info->fprintf_func) (stream, "%s,0x%x", reg1, (unsigned) offset);
- if (mode & 8)
+ if (mode & 8)
(*info->fprintf_func) (stream, "(%s)", reg2);
}
break;
/* REG format. */
static void
-reg (word1)
- unsigned long word1;
+reg (unsigned long word1)
{
int i, j;
int opcode;
at runtime. */
/* NOTE: In this table, the meaning of 'numops' is:
- 1: single operand, which is NOT a destination.
- -1: single operand, which IS a destination.
- 2: 2 operands, the 2nd of which is NOT a destination.
- -2: 2 operands, the 2nd of which IS a destination.
- 3: 3 operands
-
- If an opcode mnemonic begins with "F", it is a floating-point
- opcode (the "F" is not printed). */
+ 1: single operand, which is NOT a destination.
+ -1: single operand, which IS a destination.
+ 2: 2 operands, the 2nd of which is NOT a destination.
+ -2: 2 operands, the 2nd of which IS a destination.
+ 3: 3 operands
+
+ If an opcode mnemonic begins with "F", it is a floating-point
+ opcode (the "F" is not printed). */
static struct tabent *reg_tab;
static const struct sparse_tabent reg_init[] =
/* Print out effective address for memb instructions. */
static void
-ea (memaddr, mode, reg2, reg3, word1, word2)
- bfd_vma memaddr;
- int mode;
- const char *reg2;
- const char *reg3;
- int word1;
- unsigned int word2;
+ea (bfd_vma memaddr, int mode, const char *reg2, const char *reg3, int word1,
+ unsigned int word2)
{
int scale;
static const int scale_tab[] = { 1, 2, 4, 8, 16 };
/* Register Instruction Operand. */
static void
-regop (mode, spec, reg, fp)
- int mode, spec, reg, fp;
+regop (int mode, int spec, int reg, int fp)
{
if (fp)
{
/* Register Instruction Destination Operand. */
static void
-dstop (mode, reg, fp)
- int mode, reg, fp;
+dstop (int mode, int reg, int fp)
{
/* 'dst' operand can't be a literal. On non-FP instructions, register
mode is assumed and "m3" acts as if were "s3"; on FP-instructions,
}
static void
-invalid (word1)
- int word1;
+invalid (int word1)
{
(*info->fprintf_func) (stream, ".word\t0x%08x", (unsigned) word1);
}
static void
-print_addr (a)
- bfd_vma a;
+print_addr (bfd_vma a)
{
(*info->print_address_func) (a, info);
}
static void
-put_abs (word1, word2)
- unsigned long word1 ATTRIBUTE_UNUSED;
- unsigned long word2 ATTRIBUTE_UNUSED;
+put_abs (unsigned long word1 ATTRIBUTE_UNUSED,
+ unsigned long word2 ATTRIBUTE_UNUSED)
{
#ifdef IN_GDB
return;
/* ia64-opc.c -- Functions to access the compacted opcode table
- Copyright 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
Written by Bob Manson of Cygnus Solutions, <manson@cygnus.com>
This file is part of GDB, GAS, and the GNU binutils.
#include "ia64-asmtab.h"
#include "ia64-asmtab.c"
-static void get_opc_prefix PARAMS ((const char **, char *));
-static short int find_string_ent PARAMS ((const char *));
-static short int find_main_ent PARAMS ((short int));
-static short int find_completer PARAMS ((short int, short int, const char *));
-static ia64_insn apply_completer PARAMS ((ia64_insn, int));
-static int extract_op_bits PARAMS ((int, int, int));
-static int extract_op PARAMS ((int, int *, unsigned int *));
-static int opcode_verify PARAMS ((ia64_insn, int, enum ia64_insn_type));
-static int locate_opcode_ent PARAMS ((ia64_insn, enum ia64_insn_type));
+static void get_opc_prefix (const char **, char *);
+static short int find_string_ent (const char *);
+static short int find_main_ent (short int);
+static short int find_completer (short int, short int, const char *);
+static ia64_insn apply_completer (ia64_insn, int);
+static int extract_op_bits (int, int, int);
+static int extract_op (int, int *, unsigned int *);
+static int opcode_verify (ia64_insn, int, enum ia64_insn_type);
+static int locate_opcode_ent (ia64_insn, enum ia64_insn_type);
static struct ia64_opcode *make_ia64_opcode
- PARAMS ((ia64_insn, const char *, int, int));
+ (ia64_insn, const char *, int, int);
static struct ia64_opcode *ia64_find_matching_opcode
- PARAMS ((const char *, short int));
+ (const char *, short int);
const struct ia64_templ_desc ia64_templ_desc[16] =
{
of the opcode, or at the NUL character. */
static void
-get_opc_prefix (ptr, dest)
- const char **ptr;
- char *dest;
+get_opc_prefix (const char **ptr, char *dest)
{
char *c = strchr (*ptr, '.');
if (c != NULL)
STR; return -1 if one does not exist. */
static short
-find_string_ent (str)
- const char *str;
+find_string_ent (const char *str)
{
short start = 0;
short end = sizeof (ia64_strings) / sizeof (const char *);
return -1 if one does not exist. */
static short
-find_main_ent (nameindex)
- short nameindex;
+find_main_ent (short nameindex)
{
short start = 0;
short end = sizeof (main_table) / sizeof (struct ia64_main_table);
return -1 if one does not exist. */
static short
-find_completer (main_ent, prev_completer, name)
- short main_ent;
- short prev_completer;
- const char *name;
+find_completer (short main_ent, short prev_completer, const char *name)
{
short name_index = find_string_ent (name);
return the result. */
static ia64_insn
-apply_completer (opcode, completer_index)
- ia64_insn opcode;
- int completer_index;
+apply_completer (ia64_insn opcode, int completer_index)
{
ia64_insn mask = completer_table[completer_index].mask;
ia64_insn bits = completer_table[completer_index].bits;
first byte in OP_POINTER.) */
static int
-extract_op_bits (op_pointer, bitoffset, bits)
- int op_pointer;
- int bitoffset;
- int bits;
+extract_op_bits (int op_pointer, int bitoffset, int bits)
{
int res = 0;
state entry in bits is returned. */
static int
-extract_op (op_pointer, opval, op)
- int op_pointer;
- int *opval;
- unsigned int *op;
+extract_op (int op_pointer, int *opval, unsigned int *op)
{
int oplen = 5;
PLACE matches OPCODE and is of type TYPE. */
static int
-opcode_verify (opcode, place, type)
- ia64_insn opcode;
- int place;
- enum ia64_insn_type type;
+opcode_verify (ia64_insn opcode, int place, enum ia64_insn_type type)
{
if (main_table[place].opcode_type != type)
{
priority. */
static int
-locate_opcode_ent (opcode, type)
- ia64_insn opcode;
- enum ia64_insn_type type;
+locate_opcode_ent (ia64_insn opcode, enum ia64_insn_type type)
{
int currtest[41];
int bitpos[41];
/* Construct an ia64_opcode entry based on OPCODE, NAME and PLACE. */
static struct ia64_opcode *
-make_ia64_opcode (opcode, name, place, depind)
- ia64_insn opcode;
- const char *name;
- int place;
- int depind;
+make_ia64_opcode (ia64_insn opcode, const char *name, int place, int depind)
{
struct ia64_opcode *res =
(struct ia64_opcode *) xmalloc (sizeof (struct ia64_opcode));
/* Determine the ia64_opcode entry for the opcode specified by INSN
and TYPE. If a valid entry is not found, return NULL. */
struct ia64_opcode *
-ia64_dis_opcode (insn, type)
- ia64_insn insn;
- enum ia64_insn_type type;
+ia64_dis_opcode (ia64_insn insn, enum ia64_insn_type type)
{
int disent = locate_opcode_ent (insn, type);
matches NAME. Return NULL if one is not found. */
static struct ia64_opcode *
-ia64_find_matching_opcode (name, place)
- const char *name;
- short place;
+ia64_find_matching_opcode (const char *name, short place)
{
char op[129];
const char *suffix;
release any resources used by the returned entry. */
struct ia64_opcode *
-ia64_find_next_opcode (prev_ent)
- struct ia64_opcode *prev_ent;
+ia64_find_next_opcode (struct ia64_opcode *prev_ent)
{
return ia64_find_matching_opcode (prev_ent->name,
prev_ent->ent_index + 1);
release any resources used by the returned entry. */
struct ia64_opcode *
-ia64_find_opcode (name)
- const char *name;
+ia64_find_opcode (const char *name)
{
char op[129];
const char *suffix;
/* Free any resources used by ENT. */
void
-ia64_free_opcode (ent)
- struct ia64_opcode *ent;
+ia64_free_opcode (struct ia64_opcode *ent)
{
free ((void *)ent->name);
free (ent);
}
const struct ia64_dependency *
-ia64_find_dependency (index)
- int index;
+ia64_find_dependency (int index)
{
index = DEP(index);