aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-03-15 14:31:24 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-03-15 14:31:24 +0000
commit0b1cf022c8646c5065eed31d3b2889d7a679f88c (patch)
tree783e3cc3c36fc3abd845672cce7d52d1367a2a3d /opcodes/i386-dis.c
parent187b3d5d7fbc4785ff07c9d35e5b3b534818102d (diff)
downloadgdb-0b1cf022c8646c5065eed31d3b2889d7a679f88c.zip
gdb-0b1cf022c8646c5065eed31d3b2889d7a679f88c.tar.gz
gdb-0b1cf022c8646c5065eed31d3b2889d7a679f88c.tar.bz2
gas/
2007-03-15 H.J. Lu <hongjiu.lu@intel.com> * Makefile.am: Run "make dep-am". * Makefile.in: Regenerated. * config/tc-i386.c: Include "opcodes/i386-opc.h" instead of "opcode/i386.h". (md_begin): Check reg_name != NULL for the last entry in i386_regtab. * config/tc-i386.h: Move many entries to opcode/i386.h and opcodes/i386-opc.h. * configure.in (need_opcodes): Set true for i386. * configure: Regenerated. include/opcode/ 2007-03-15 H.J. Lu <hongjiu.lu@intel.com> * i386.h: Add entries from config/tc-i386.h and move tables to opcodes/i386-opc.h. opcodes/ 2007-03-15 H.J. Lu <hongjiu.lu@intel.com> * Makefile.am (CFILES): Add i386-opc.c. (ALL_MACHINES): Add i386-opc.lo. Run "make dep-am". * Makefile.in: Regenerated. * configure.in: Add i386-opc.lo for bfd_i386_arch. * configure: Regenerated. * i386-dis.c: Include "opcode/i386.h". (MAXLEN): Renamed to MAX_MNEM_SIZE. Remove definition. (FWAIT_OPCODE): Remove definition. (UNIXWARE_COMPAT): Renamed to SYSV386_COMPAT. Remove definition. (MAX_OPERANDS): Remove definition. * i386-opc.c: New file. * i386-opc.h: Likewise.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 526627a..29db63d 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -34,17 +34,10 @@
#include "dis-asm.h"
#include "sysdep.h"
#include "opintl.h"
-
-#define MAXLEN 15
+#include "opcode/i386.h"
#include <setjmp.h>
-#ifndef UNIXWARE_COMPAT
-/* Set non-zero for broken, compatible instructions. Set to zero for
- non-broken opcodes. */
-#define UNIXWARE_COMPAT 1
-#endif
-
static int fetch_data (struct disassemble_info *, bfd_byte *);
static void ckprefix (void);
static const char *prefix_name (int, int);
@@ -109,16 +102,12 @@ static void CMPXCHG8B_Fixup (int, int);
struct dis_private {
/* Points to first byte not fetched. */
bfd_byte *max_fetched;
- bfd_byte the_buffer[MAXLEN];
+ bfd_byte the_buffer[MAX_MNEM_SIZE];
bfd_vma insn_start;
int orig_sizeflag;
jmp_buf bailout;
};
-/* The opcode for the fwait instruction, which we treat as a prefix
- when we can. */
-#define FWAIT_OPCODE (0x9b)
-
enum address_mode
{
mode_16bit,
@@ -183,7 +172,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
struct dis_private *priv = (struct dis_private *) info->private_data;
bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
- if (addr <= priv->the_buffer + MAXLEN)
+ if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
status = (*info->read_memory_func) (start,
priv->max_fetched,
addr - priv->max_fetched,
@@ -490,8 +479,6 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
typedef void (*op_rtn) (int bytemode, int sizeflag);
-#define MAX_OPERANDS 4
-
struct dis386 {
const char *name;
struct
@@ -3515,7 +3502,7 @@ static const struct dis386 float_reg[][8] = {
{ "fmul", { STi, ST } },
{ "(bad)", { XX } },
{ "(bad)", { XX } },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{ "fsub", { STi, ST } },
{ "fsubr", { STi, ST } },
{ "fdiv", { STi, ST } },
@@ -3544,7 +3531,7 @@ static const struct dis386 float_reg[][8] = {
{ "fmulp", { STi, ST } },
{ "(bad)", { XX } },
{ FGRPde_3 },
-#if UNIXWARE_COMPAT
+#if SYSV386_COMPAT
{ "fsubp", { STi, ST } },
{ "fsubrp", { STi, ST } },
{ "fdivp", { STi, ST } },