From: Martin Hunt Date: Thu, 18 Jul 1996 00:40:48 +0000 (+0000) Subject: start-sanitize-d10v X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3d1d21b02813eaf7b62779e0ae99b4321d15a6f0;p=deliverable%2Fbinutils-gdb.git start-sanitize-d10v Wed Jul 17 14:46:38 1996 Martin M. Hunt * d10v.h: New file. end-sanitize-d10v --- diff --git a/include/opcode/.Sanitize b/include/opcode/.Sanitize index c47d80dcd7..b5a4ca85d3 100644 --- a/include/opcode/.Sanitize +++ b/include/opcode/.Sanitize @@ -23,6 +23,14 @@ else lose_these_too="${arc_files} ${lose_these_too}" fi +d10v_files="d10v.h" + +if ( echo $* | grep keep\-d10v > /dev/null ) ; then + keep_these_too="${d10v_files} ${keep_these_too}" +else + lose_these_too="${d10v_files} ${lose_these_too}" +fi + # All files listed between the "Things-to-keep:" line and the # "Files-to-sed:" line will be kept. All other files will be removed. @@ -86,6 +94,35 @@ else done fi + +d10v_files="ChangeLog" +if ( echo $* | grep keep\-d10v > /dev/null ) ; then + for i in $d10v_files ; do + if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Keeping d10v stuff in $i + fi + fi + done +else + for i in $d10v_files ; do + if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then + if [ -n "${verbose}" ] ; then + echo Removing traces of \"d10v\" from $i... + fi + cp $i new + sed '/start\-sanitize\-d10v/,/end-\sanitize\-d10v/d' < $i > new + if [ -n "${safe}" -a ! -f .Recover/$i ] ; then + if [ -n "${verbose}" ] ; then + echo Caching $i in .Recover... + fi + mv $i .Recover + fi + mv new $i + fi + done +fi + for i in * ; do if test ! -d $i && (grep sanitize $i > /dev/null) ; then echo '***' Some mentions of Sanitize are still left in $i! 1>&2 diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index a6b8d09e0e..6cf159f3db 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,9 @@ +start-sanitize-d10v + Wed Jul 17 14:46:38 1996 Martin M. Hunt + + * d10v.h: New file. +end-sanitize-d10v + Thu Jul 11 12:09:15 1996 Jeffrey A Law (law@cygnus.com) * h8300.h (band, bclr): Force high bit of immediate nibble to zero. diff --git a/include/opcode/d10v.h b/include/opcode/d10v.h new file mode 100644 index 0000000000..86085a5481 --- /dev/null +++ b/include/opcode/d10v.h @@ -0,0 +1,150 @@ +/* d10v.h -- Header file for D10V opcode table + Copyright 1996 Free Software Foundation, Inc. + Written by Martin Hunt (hunt@cygnus.com), Cygnus Support + +This file is part of GDB, GAS, and the GNU binutils. + +GDB, GAS, and the GNU binutils are free software; you can redistribute +them and/or modify them under the terms of the GNU General Public +License as published by the Free Software Foundation; either version +1, or (at your option) any later version. + +GDB, GAS, and the GNU binutils are distributed in the hope that they +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 file; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef D10V_H +#define D10V_H + +/* Format Specifier */ +#define FM00 0 +#define FM01 0x40000000 +#define FM10 0x80000000 +#define FM11 0xC0000000 + +#define NOP 0x5e00 + +/* The opcode table is an array of struct d10v_opcode. */ + +struct d10v_opcode +{ + /* The opcode name. */ + const char *name; + + /* the opcode format */ + int format; + + /* opcode types. these numbers were picked so we can do + if( i & SHORT_OPCODE) */ + +#define SHORT_OPCODE 1 +#define LONG_OPCODE 8 +#define SHORT_2 1 /* short with 2 operands */ +#define SHORT_B 3 /* short with 8-bit branch */ +#define LONG_B 8 /* long with 16-bit branch */ +#define LONG_L 10 /* long with 3 operands */ +#define LONG_R 12 /* reserved */ + + /* the number of cycles */ + int cycles; + + /* the execution unit(s) used */ + int unit; +#define EITHER 0 +#define IU 1 +#define MU 2 +#define BOTH 3 + + /* execution type; parallel or sequential */ + int exec_type; +#define PAR 1 +#define SEQ 2 +#define BRANCH_LINK 3 + + /* the opcode */ + long opcode; + + /* mask. if( (i & mask) == opcode ) then match */ + long mask; + + /* An array of operand codes. Each code is an index into the + operand table. They appear in the order which the operands must + appear in assembly code, and are terminated by a zero. */ + unsigned char operands[6]; +}; + +/* The table itself is sorted by major opcode number, and is otherwise + in the order in which the disassembler should consider + instructions. */ +extern const struct d10v_opcode d10v_opcodes[]; +extern const int d10v_num_opcodes; + +/* The operands table is an array of struct d10v_operand. */ +struct d10v_operand +{ + /* The number of bits in the operand. */ + int bits; + + /* How far the operand is left shifted in the instruction. */ + int shift; + + /* One bit syntax flags. */ + int flags; +}; + +/* Elements in the table are retrieved by indexing with values from + the operands field of the d10v_opcodes table. */ + +extern const struct d10v_operand d10v_operands[]; + +/* Values defined for the flags field of a struct d10v_operand. */ + +/* the operand must be an even number */ +#define OPERAND_EVEN (1) + +/* the operand must be an odd number */ +#define OPERAND_ODD (2) + +/* this is the destination register; it will be modified */ +/* this is used by the optimizer */ +#define OPERAND_DEST (4) + +/* number or symbol */ +#define OPERAND_NUM (8) + +/* address or label */ +#define OPERAND_ADDR (0x10) + +/* register */ +#define OPERAND_REG (0x20) + +/* postincrement + */ +#define OPERAND_PLUS (0x40) + +/* postdecrement - */ +#define OPERAND_MINUS (0x80) + +/* @ */ +#define OPERAND_ATSIGN (0x100) + +/* @( */ +#define OPERAND_ATPAR (0x200) + +/* accumulator */ +#define OPERAND_ACC (0x400) + +/* flag register */ +#define OPERAND_FLAG (0x800) + +/* control register */ +#define OPERAND_CONTROL (0x1000) + +/* predecrement mode '@-sp' */ +#define OPERAND_ATMINUS (0x2000) + +#endif /* D10V_H */