* dvp-dis.c, dvp-opc.c: New files.

* configure.in: Compile them if bfd_dvp_arch, as well as mips.
	* configure: Regenerate.
	* Makefile.am (ALL_MACHINES): Add dvp-{dis,opc}.lo.
	(dvp-dis.lo,dvp-opc.lo): Add rules for.
	(mips-dis.lo): Compile with @archdefs@.
	* Makefile.in: Regenerate.
	* disassemble.c: Define ARCH_mips ifdef ARCH_dvp.
	* mips-dis.c (print_insn_little_mips): Check for DVP insns.
plus delete old txvu stuff
This commit is contained in:
Doug Evans 1998-01-28 21:58:23 +00:00
parent 0040c1e966
commit 37130f1153
10 changed files with 49 additions and 3006 deletions

View File

@ -39,7 +39,7 @@ else
lose_these_too="${tic80_files} ${lose_these_too}"
fi
sky_files="txvu-opc.c txvu-dis.c"
sky_files="dvp-opc.c dvp-dis.c"
if ( echo $* | grep keep\-sky > /dev/null ) ; then
keep_these_too="${sky_files} ${keep_these_too}"
@ -409,7 +409,7 @@ else
done
fi
sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
if ( echo $* | grep keep\-sky > /dev/null ) ; then
for i in $sky_files ; do
if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then

View File

@ -1,3 +1,16 @@
start-sanitize-sky
Wed Jan 28 13:46:19 1998 Doug Evans <devans@canuck.cygnus.com>
* dvp-dis.c, dvp-opc.c: New files.
* configure.in: Compile them if bfd_dvp_arch, as well as mips.
* configure: Regenerate.
* Makefile.am (ALL_MACHINES): Add dvp-{dis,opc}.lo.
(dvp-dis.lo,dvp-opc.lo): Add rules for.
* Makefile.in: Regenerate.
* disassemble.c: Define ARCH_mips ifdef ARCH_dvp.
* mips-dis.c (print_insn_little_mips): Check for DVP insns.
end-sanitize-sky
Wed Jan 28 09:55:03 1998 Nick Clifton <nickc@cygnus.com>
* v850-opc.c (insertion routines): If both alignment and size is
@ -8,42 +21,6 @@ Tue Jan 27 21:52:59 1998 Jeffrey A Law (law@cygnus.com)
* mips-dis.c (_print_insn_mips): Set target_processor as appropriate.
Only recognize instructions for the current target_processor.
start-sanitize-sky
Tue Jan 27 14:11:04 1998 Doug Evans <devans@seba.cygnus.com>
* txvu-dis.c (*): Update to use new arguments in
parse/insert/extract/print fns.
* txvu-opc.c (*): Likewise.
Mon Jan 26 16:25:51 1998 Doug Evans <devans@seba.cygnus.com>
* txvu-dis.c (print_insn): Extract/print fns take pointer to
insn now and not insn itself.
* txvu-opc.c: insert/extract/print fns take pointer to
insn now and not insn itself. Add initial dma,pke,gpuif support.
Parse fn no longer needs to set errmsg = NULL for success.
(lookup_keyword_{value,name}): New functions.
(scan_symbol): New function.
(issymchar,SKIP_BLANKS): New macros.
Fri Jan 23 01:49:24 1998 Doug Evans <devans@seba.cygnus.com>
* txvu-opc.c (txvu_operands, UBC): Add extract entry.
(txvu_operands, UACCDEST): Not a fake operand.
(txvu_operands, UXYZ): Move parse entry to insert entry.
(txvu_operands, LVI01): Not a fake operand.
(txvu_upper_opcodes): Fix spelling of minii instruction.
(printf_vfreg): Print register number with "%02ld".
(print_bcftreg): Likewise.
(print_accdest): Pass `dest' to _print_dest.
(insert_xyz): Renamed from parse_xyz.
(parse_dest1,insert_luimm12up6): New functions.
(txvu_operands): New operands LUIMM12UP6, LDEST1.
(txvu_lower_opcodes): Clean up pass over table.
(parse_dotdest1): Fix dest calculation.
(_parse_sdest): Fix typo.
end-sanitize-sky
Thu Jan 22 16:20:17 1998 Fred Fish <fnf@cygnus.com>
* d10v-dis.c (PC_MASK): Correct value.
@ -91,28 +68,6 @@ start-sanitize-cygnus
* cgen.sh, cgen-asm.in, cgen-dis.in: New files.
end-sanitize-cygnus
start-sanitize-sky
Tue Jan 6 13:08:14 1998 Doug Evans <devans@seba.cygnus.com>
* txvu-dis.c (print_insn_txvu): Handle no separator between
upper and lower insn #ifndef VERTICAL_BAR_SEPARATOR.
Mon Jan 5 13:41:07 1998 Doug Evans <devans@seba.cygnus.com>
* txvu-dis.c, txvu-opc.c: New files.
* configure.in: Compile them.
* configure: Regenerate.
* Makefile.am (ALL_MACHINES): Add txvu-{dis,opc}.lo.
(txvu-dis.lo,txvu-opc.lo): Add rules for.
* Makefile.in: Regenerate.
Mon Dec 22 17:17:03 1997 Doug Evans <devans@canuck.cygnus.com>
* configure.in: Add txvu support.
* configure: Regenerate.
* disassemble.c: Add txvu support.
end-sanitize-sky
Mon Dec 22 12:37:06 1997 Ian Lance Taylor <ian@cygnus.com>
* mips-opc.c: Add FP_D to s.d instruction flags.

View File

@ -104,8 +104,8 @@ ALL_MACHINES = \
tic80-opc.lo \
$(end-sanitize-tic80) \
$(start-sanitize-sky) \
txvu-dis.lo \
txvu-opc.lo \
dvp-dis.lo \
dvp-opc.lo \
$(end-sanitize-sky) \
v850-dis.lo \
v850-opc.lo \
@ -184,9 +184,12 @@ tic80-opc.lo: tic80-opc.c $(INCDIR)/opcode/tic80.h
# end-sanitize-tic80
# start-sanitize-sky
txvu-dis.lo: txvu-dis.c $(INCDIR)/dis-asm.h ../bfd/bfd.h \
$(INCDIR)/opcode/txvu.h
txvu-opc.lo: txvu-opc.c $(INCDIR)/opcode/txvu.h
dvp-dis.lo: txvu-dvp.c $(INCDIR)/dis-asm.h ../bfd/bfd.h \
$(INCDIR)/opcode/dvp.h
dvp-opc.lo: dvp-opc.c $(INCDIR)/opcode/dvp.h
mips-dis.lo: mips-dis.c
$(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/mips-dis.c
# end-sanitize-sky
# This dependency stuff is copied from BFD.

View File

@ -174,8 +174,8 @@ ALL_MACHINES = \
tic80-opc.lo \
$(end-sanitize-tic80) \
$(start-sanitize-sky) \
txvu-dis.lo \
txvu-opc.lo \
dvp-dis.lo \
dvp-opc.lo \
$(end-sanitize-sky) \
v850-dis.lo \
v850-opc.lo \
@ -540,9 +540,12 @@ tic80-opc.lo: tic80-opc.c $(INCDIR)/opcode/tic80.h
# end-sanitize-tic80
# start-sanitize-sky
txvu-dis.lo: txvu-dis.c $(INCDIR)/dis-asm.h ../bfd/bfd.h \
$(INCDIR)/opcode/txvu.h
txvu-opc.lo: txvu-opc.c $(INCDIR)/opcode/txvu.h
dvp-dis.lo: txvu-dvp.c $(INCDIR)/dis-asm.h ../bfd/bfd.h \
$(INCDIR)/opcode/dvp.h
dvp-opc.lo: dvp-opc.c $(INCDIR)/opcode/dvp.h
mips-dis.lo: mips-dis.c
$(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/mips-dis.c
# end-sanitize-sky
# This dependency stuff is copied from BFD.

2
opcodes/configure vendored
View File

@ -1885,7 +1885,7 @@ if test x${all_targets} = xfalse ; then
bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;;
# end-sanitize-tic80
# start-sanitize-sky
bfd_txvu_arch) ta="$ta txvu-dis.lo txvu-opc.lo" ;;
bfd_dvp_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo dvp-dis.lo dvp-opc.lo" ;;
# end-sanitize-sky
bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
# start-sanitize-v850e

View File

@ -154,7 +154,7 @@ if test x${all_targets} = xfalse ; then
bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;;
# end-sanitize-tic80
# start-sanitize-sky
bfd_txvu_arch) ta="$ta txvu-dis.lo txvu-opc.lo" ;;
bfd_dvp_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo dvp-dis.lo dvp-opc.lo" ;;
# end-sanitize-sky
bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
# start-sanitize-v850e

View File

@ -46,14 +46,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* start-sanitize-tic80 */
#define ARCH_tic80
/* end-sanitize-tic80 */
/* start-sanitize-sky */
#define ARCH_txvu
/* end-sanitize-sky */
#define ARCH_v850
#define ARCH_w65
#define ARCH_z8k
#endif
/* start-sanitize-sky */
#if defined (ARCH_dvp) && ! defined (ARCH_mips)
#define ARCH_mips
#endif
/* end-sanitize-sky */
disassembler_ftype
disassembler (abfd)
bfd *abfd;
@ -205,13 +208,6 @@ disassembler (abfd)
break;
#endif
/* end-sanitize-tic80 */
/* start-sanitize-sky */
#ifdef ARCH_txvu
case bfd_arch_txvu:
disassemble = print_insn_txvu;
break;
#endif
/* end-sanitize-sky */
#ifdef ARCH_v850
case bfd_arch_v850:
disassemble = print_insn_v850;

View File

@ -467,6 +467,16 @@ print_insn_little_mips (memaddr, info)
bfd_byte buffer[4];
int status;
/* start-sanitize-sky */
#ifdef ARCH_dvp
if (bfd_mach_dvp_p (info->mach)
|| (info->flavour == bfd_target_elf_flavour
&& info->symbol != NULL
&& MIPS_STO_DVP_P (((elf_symbol_type *) info->symbol)->internal_elf_sym.st_other)))
return print_insn_dvp (memaddr, info);
#endif
/* end-sanitize-sky */
if (info->mach == 16
|| (info->flavour == bfd_target_elf_flavour
&& info->symbol != NULL

View File

@ -1,202 +0,0 @@
/* Instruction printing code for the TXVU
Copyright (C) 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "dis-asm.h"
#include "opcode/txvu.h"
#include "elf-bfd.h"
#include "elf/txvu.h"
static void print_insn PARAMS ((bfd_vma, disassemble_info *, TXVU_INSN, int));
/* Print one instruction from PC on INFO->STREAM.
Return the size of the instruction. */
int
print_insn_txvu (pc, info)
bfd_vma pc;
disassemble_info *info;
{
bfd_byte buffer[8];
void *stream = info->stream;
fprintf_ftype func = info->fprintf_func;
int status;
/* First element is upper, second is lower. */
TXVU_INSN upper,lower;
static int initialized = 0;
if (!initialized)
{
initialized = 1;
txvu_opcode_init_tables (0);
}
status = (*info->read_memory_func) (pc, buffer, 8, info);
if (status != 0)
{
(*info->memory_error_func) (status, pc, info);
return -1;
}
/* The lower instruction has the lower address. */
upper = bfd_getl32 (buffer + 4);
lower = bfd_getl32 (buffer);
/* FIXME: This will need revisiting. */
print_insn (pc, info, upper, 0);
#ifdef VERTICAL_BAR_SEPARATOR
(*func) (stream, " | ");
#else
/* Not sure how much whitespace to print here.
At least two spaces, not more than 9, and having columns line up somewhat
seems reasonable. */
(*func) (stream, " \t");
#endif
print_insn (pc, info, lower, 1);
return 8;
}
/* Print one instruction.
LOWER_P is non-zero if disassembling a lower slot insn. */
static void
print_insn (pc, info, insn, lower_p)
bfd_vma pc;
disassemble_info *info;
TXVU_INSN insn;
int lower_p;
{
const txvu_opcode *opcode;
void *stream = info->stream;
fprintf_ftype func = info->fprintf_func;
/* The instructions are stored in lists hashed by the insn code
(though we needn't care how they're hashed). */
if (lower_p)
opcode = txvu_lower_opcode_lookup_dis (insn);
else
opcode = txvu_upper_opcode_lookup_dis (insn);
for ( ; opcode != NULL; opcode = TXVU_OPCODE_NEXT_DIS (opcode))
{
const unsigned char *syn;
int mods,invalid,num_operands;
long value;
const txvu_operand *operand;
/* Basic bit mask must be correct. */
if ((insn & opcode->mask) != opcode->value)
continue;
/* Make two passes over the operands. First see if any of them
have extraction functions, and, if they do, make sure the
instruction is valid. */
txvu_opcode_init_print ();
invalid = 0;
for (syn = opcode->syntax; *syn; ++syn)
{
int index;
if (*syn < 128)
continue;
mods = 0;
index = TXVU_OPERAND_INDEX (*syn);
while (TXVU_MOD_P (txvu_operands[index].flags))
{
mods |= txvu_operands[index].flags & TXVU_MOD_BITS;
++syn;
index = TXVU_OPERAND_INDEX (*syn);
}
operand = txvu_operands + index;
if (operand->extract)
(*operand->extract) (opcode, operand, mods, &insn, &invalid);
}
if (invalid)
continue;
/* The instruction is valid. */
(*func) (stream, "%s", opcode->mnemonic);
num_operands = 0;
for (syn = opcode->syntax; *syn; ++syn)
{
int index;
if (*syn < 128)
{
(*func) (stream, "%c", *syn);
continue;
}
/* We have an operand. Fetch any special modifiers. */
mods = 0;
index = TXVU_OPERAND_INDEX (*syn);
while (TXVU_MOD_P (txvu_operands[index].flags))
{
mods |= txvu_operands[index].flags & TXVU_MOD_BITS;
++syn;
index = TXVU_OPERAND_INDEX (*syn);
}
operand = txvu_operands + index;
/* Extract the value from the instruction. */
if (operand->extract)
{
value = (*operand->extract) (opcode, operand, mods,
&insn, (int *) NULL);
}
else
{
value = (insn >> operand->shift) & ((1 << operand->bits) - 1);
if ((operand->flags & TXVU_OPERAND_SIGNED) != 0
&& (value & (1 << (operand->bits - 1))))
value -= 1 << operand->bits;
}
#if 0 /* commas are part of the syntax string now */
/* If second or later operand, print a comma. */
if (num_operands > 0)
(*func) (stream, ",");
#endif
/* Print the operand as directed by the flags. */
if (operand->print)
(*operand->print) (opcode, operand, mods, &insn, info, value);
else if (operand->flags & TXVU_OPERAND_FAKE)
; /* nothing to do (??? at least not yet) */
else if (operand->flags & TXVU_OPERAND_RELATIVE_BRANCH)
(*info->print_address_func) (pc + (value << 3), info);
/* ??? Not all cases of this are currently caught. */
else if (operand->flags & TXVU_OPERAND_ABSOLUTE_BRANCH)
(*info->print_address_func) ((bfd_vma) value & 0xffffffff, info);
else if (operand->flags & TXVU_OPERAND_ADDRESS)
(*info->print_address_func) ((bfd_vma) value & 0xffffffff, info);
else
(*func) (stream, "%ld", value);
if (! (operand->flags & TXVU_OPERAND_SUFFIX))
++num_operands;
}
/* We have found and printed an instruction; return. */
return;
}
(*func) (stream, "*unknown*");
}

File diff suppressed because it is too large Load Diff