This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

MMIX port, part 3/10: include files.


Ok to commit?

Part 3/10, include/ subdirectories:

include/elf:
	* mmix.h: New file.

include/opcode:
	* mmix.h: New file.

include:
	* dis-asm.h (print_insn_mmix): Add prototype.

Index: dis-asm.h
===================================================================
RCS file: /cvs/src/src/include/dis-asm.h,v
retrieving revision 1.24
diff -p -c -r1.24 dis-asm.h
*** dis-asm.h	2001/04/27 13:33:26	1.24
--- dis-asm.h	2001/09/30 17:05:29
*************** extern int print_insn_tic80		PARAMS ((bf
*** 227,232 ****
--- 227,233 ----
  extern int print_insn_pj		PARAMS ((bfd_vma, disassemble_info*));
  extern int print_insn_avr		PARAMS ((bfd_vma, disassemble_info*));
  extern int print_insn_s390            PARAMS ((bfd_vma, disassemble_info*));
+ extern int print_insn_mmix		PARAMS ((bfd_vma, disassemble_info*));

  extern void print_arm_disassembler_options PARAMS ((FILE *));
  extern void parse_arm_disassembler_option  PARAMS ((char *));
*** /dev/null	Tue Jan  1 05:00:00 1980
--- opcode/mmix.h	Sun Sep 30 19:48:45 2001
***************
*** 0 ****
--- 1,185 ----
+ /* mmix.h -- Header file for MMIX opcode table
+    Copyright (C) 2001 Free Software Foundation, Inc.
+    Written by Hans-Peter Nilsson (hp@bitrange.com)
+
+ 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 2,
+ 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.  */
+
+ /* We could have just a char*[] table indexed by the register number, but
+    that would not allow for synonyms.  The table is terminated with an
+    entry with a NULL name.  */
+ struct mmix_spec_reg
+ {
+   const char *name;
+   unsigned int number;
+ };
+
+ /* General indication of the type of instruction.  */
+ enum mmix_insn_type
+  {
+    mmix_type_pseudo,
+    mmix_type_normal,
+    mmix_type_branch,
+    mmix_type_condbranch,
+    mmix_type_memaccess_octa,
+    mmix_type_memaccess_tetra,
+    mmix_type_memaccess_wyde,
+    mmix_type_memaccess_byte,
+    mmix_type_memaccess_block,
+    mmix_type_jsr
+  };
+
+ /* Type of operands an instruction takes.  Use when parsing assembly code
+    and disassembling.  */
+ enum mmix_operands_type
+  {
+    mmix_operands_none = 0,
+
+    /* All operands are registers: "$X,$Y,$Z".  */
+    mmix_operands_regs,
+
+    /* "$X,YZ", like SETH.  */
+    mmix_operands_reg_yz,
+
+    /* The regular "$X,$Y,$Z|Z".
+       The Z is optional; if only "$X,$Y" is given, then "$X,$Y,0" is
+       assumed.  */
+    mmix_operands_regs_z_opt,
+
+    /* The regular "$X,$Y,$Z|Z".  */
+    mmix_operands_regs_z,
+
+    /* "Address"; only JMP.  Zero operands allowed unless GNU syntax.  */
+    mmix_operands_jmp,
+
+    /* "$X|X,$Y,$Z|Z": PUSHGO; like "3", but X can be expressed as an
+       integer.  */
+    mmix_operands_pushgo,
+
+    /* Two registers or a register and a byte, like FLOT, possibly with
+       rounding: "$X,$Z|Z" or "$X,ROUND_MODE,$Z|Z".  */
+    mmix_operands_roundregs_z,
+
+    /* "X,YZ", POP.  Unless GNU syntax, zero or one operand is allowed.  */
+    mmix_operands_pop,
+
+    /* Two registers, possibly with rounding: "$X,$Z" or
+       "$X,ROUND_MODE,$Z".  */
+    mmix_operands_roundregs,
+
+    /* "XYZ", like SYNC.  */
+    mmix_operands_sync,
+
+    /* "X,$Y,$Z|Z", like SYNCD.  */
+    mmix_operands_x_regs_z,
+
+    /* "$X,Y,$Z|Z", like NEG and NEGU.  The Y field is optional, default 0.  */
+    mmix_operands_neg,
+
+    /* "$X,Address, like GETA or branches.  */
+    mmix_operands_regaddr,
+
+    /* "$X|X,Address, like PUSHJ.  */
+    mmix_operands_pushj,
+
+    /* "$X,spec_reg"; GET.  */
+    mmix_operands_get,
+
+    /* "spec_reg,$Z|Z"; PUT.  */
+    mmix_operands_put,
+
+    /* Two registers, "$X,$Y".  */
+    mmix_operands_set,
+
+    /* "$X,0"; SAVE.  */
+    mmix_operands_save,
+
+    /* "0,$Z"; UNSAVE. */
+    mmix_operands_unsave,
+
+    /* "X,Y,Z"; like SWYM or TRAP.  Zero (or 1 if GNU syntax) to three
+       operands, interpreted as 0; XYZ; X, YZ and X, Y, Z.  */
+    mmix_operands_xyz_opt,
+
+    /* Just "Z", like RESUME.  Unless GNU syntax, the operand can be omitted
+       and will then be assumed zero.  */
+    mmix_operands_resume,
+
+    /* These are specials to handle that pseudo-directives are specified
+       like ordinary insns when being mmixal-compatible.  They signify the
+       specific pseudo-directive rather than the operands type.  */
+
+    /* LOC.  */
+    mmix_operands_loc,
+
+    /* PREFIX.  */
+    mmix_operands_prefix,
+
+    /* BYTE.  */
+    mmix_operands_byte,
+
+    /* WYDE.  */
+    mmix_operands_wyde,
+
+    /* TETRA.  */
+    mmix_operands_tetra,
+
+    /* OCTA.  */
+    mmix_operands_octa,
+
+    /* LOCAL.  */
+    mmix_operands_local,
+
+    /* BSPEC.  */
+    mmix_operands_bspec,
+
+    /* ESPEC.  */
+    mmix_operands_espec,
+  };
+
+ struct mmix_opcode
+  {
+    const char *name;
+    unsigned long match;
+    unsigned long lose;
+    enum mmix_operands_type operands;
+
+    /* This is used by the disassembly function.  */
+    enum mmix_insn_type type;
+  };
+
+ /* Declare the actual tables.  */
+ extern const struct mmix_opcode mmix_opcodes[];
+
+ /* This one is terminated with an entry with a NULL name.  */
+ extern const struct mmix_spec_reg mmix_spec_regs[];
+
+ /* Some insn values we use when padding and synthesizing address loads.  */
+ #define IMM_OFFSET_BIT 1
+ #define COND_INV_BIT 0x8
+ #define PRED_INV_BIT 0x10
+
+ #define PUSHGO_INSN_BYTE 0xbe
+ #define GO_INSN_BYTE 0x9e
+ #define SETL_INSN_BYTE 0xe3
+ #define INCML_INSN_BYTE 0xe6
+ #define INCMH_INSN_BYTE 0xe5
+ #define INCH_INSN_BYTE 0xe4
+ #define SWYM_INSN_BYTE 0xfd
+
+ /* We can have 256 - 32 (local registers) - 1 ($255 is not allocatable)
+    global registers.  */
+ #define MAX_GREGS 223
*** /dev/null	Tue Jan  1 05:00:00 1980
--- elf/mmix.h	Sun Sep 30 19:49:47 2001
***************
*** 0 ****
--- 1,151 ----
+ /* MMIX support for BFD.
+    Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ 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.  */
+
+ /* This file holds definitions specific to the MMIX ELF ABI. */
+ #ifndef ELF_MMIX_H
+ #define ELF_MMIX_H
+
+ #include "elf/reloc-macros.h"
+
+ /* Relocations.  */
+ START_RELOC_NUMBERS (elf_mmix_reloc_type)
+   RELOC_NUMBER (R_MMIX_NONE, 0)
+
+   /* Standard absolute relocations.  */
+   RELOC_NUMBER (R_MMIX_8, 1)
+   RELOC_NUMBER (R_MMIX_16, 2)
+   RELOC_NUMBER (R_MMIX_24, 3)
+   RELOC_NUMBER (R_MMIX_32, 4)
+   RELOC_NUMBER (R_MMIX_64, 5)
+
+   /* Standard relative relocations.  */
+   RELOC_NUMBER (R_MMIX_PC_8, 6)
+   RELOC_NUMBER (R_MMIX_PC_16, 7)
+   RELOC_NUMBER (R_MMIX_PC_24, 8)
+   RELOC_NUMBER (R_MMIX_PC_32, 9)
+   RELOC_NUMBER (R_MMIX_PC_64, 10)
+
+   /* GNU extensions for C++ vtables.  */
+   RELOC_NUMBER (R_MMIX_GNU_VTINHERIT, 11)
+   RELOC_NUMBER (R_MMIX_GNU_VTENTRY, 12)
+
+   /* A GETA instruction.  */
+   RELOC_NUMBER (R_MMIX_GETA, 13)
+   RELOC_NUMBER (R_MMIX_GETA_1, 14)
+   RELOC_NUMBER (R_MMIX_GETA_2, 15)
+   RELOC_NUMBER (R_MMIX_GETA_3, 16)
+
+   /* A conditional branch instruction.  */
+   RELOC_NUMBER (R_MMIX_CBRANCH, 17)
+   RELOC_NUMBER (R_MMIX_CBRANCH_J, 18)
+   RELOC_NUMBER (R_MMIX_CBRANCH_1, 19)
+   RELOC_NUMBER (R_MMIX_CBRANCH_2, 20)
+   RELOC_NUMBER (R_MMIX_CBRANCH_3, 21)
+
+   /* A PUSHJ instruction.  */
+   RELOC_NUMBER (R_MMIX_PUSHJ, 22)
+   RELOC_NUMBER (R_MMIX_PUSHJ_1, 23)
+   RELOC_NUMBER (R_MMIX_PUSHJ_2, 24)
+   RELOC_NUMBER (R_MMIX_PUSHJ_3, 25)
+
+   /* A JMP instruction.  */
+   RELOC_NUMBER (R_MMIX_JMP, 26)
+   RELOC_NUMBER (R_MMIX_JMP_1, 27)
+   RELOC_NUMBER (R_MMIX_JMP_2, 28)
+   RELOC_NUMBER (R_MMIX_JMP_3, 29)
+
+   /* A relative address such as in a GETA or a branch.  */
+   RELOC_NUMBER (R_MMIX_ADDR19, 30)
+
+   /* A relative address such as in a JMP (only).  */
+   RELOC_NUMBER (R_MMIX_ADDR27, 31)
+
+   /* A general register or a number 0..255.  */
+   RELOC_NUMBER (R_MMIX_REG_OR_BYTE, 32)
+
+   /* A general register. */
+   RELOC_NUMBER (R_MMIX_REG, 33)
+
+   /* A global register and an offset, equivalent of the expression.  */
+   RELOC_NUMBER (R_MMIX_BASE_PLUS_OFFSET, 34)
+
+   /* A LOCAL assertion.  */
+   RELOC_NUMBER (R_MMIX_LOCAL, 35)
+ END_RELOC_NUMBERS (R_MMIX_max)
+
+
+ /* Section Attributes.  */
+ /* A section containing necessary information for relaxation.  */
+ #define SHF_MMIX_CANRELAX	0x80000000
+
+ /* Symbol attributes.  */
+ /* A symbol with this section-index is a register.  */
+ #define SHN_REGISTER	SHN_LOPROC
+
+ /* This section holds contents for each initialized register, at VMA
+    regno*8.  A symbol relative to this section will be transformed to an
+    absolute symbol with the value corresponding to the register number at
+    final link time.  A symbol with a value outside the inclusive range
+    32*8 .. 254*8 is an error.  It is highly recommended to only use an
+    upper bound of 253*8 or lower as specified in the (currently
+    unspecified) ABI.  */
+ #define MMIX_REG_CONTENTS_SECTION_NAME ".MMIX.reg_contents"
+
+ /* This is a faked section holding symbols with SHN_REGISTER.  Don't
+    confuse it with MMIX_REG_CONTENTS_SECTION_NAME; this one has no
+    contents, just values.  It is an error for a value in this section to
+    be outside the range 32..255 and it must never become an actual section
+    in an object file.  */
+ #define MMIX_REG_SECTION_NAME "*REG*"
+
+ /* Appended with a number N=0..65535, this is a representation of the
+    mmixal "BSPEC N" ... "ESPEC" directive pair; the contents go into an
+    ELF section by name ".MMIX.spec_data.N".  */
+ #define MMIX_OTHER_SPEC_SECTION_PREFIX ".MMIX.spec_data."
+
+ /* A section SECNAME is noted to start at "__.MMIX.start.SECNAME" by the
+    presence of this symbol.  Currently only implemented for ".text"
+    through the symbol "__.MMIX.start..text".  */
+ #define MMIX_LOC_SECTION_START_SYMBOL_PREFIX "__.MMIX.start."
+
+ /* This symbol is always a function.  */
+ #define MMIX_START_SYMBOL_NAME "Main"
+
+
+ /* We smuggle in a few MMO specifics here.  We don't make a specific MMO
+    file, since we can't reasonably support MMO without ELF; we have to
+    include this file anyway.  */
+
+ #define MMO_TEXT_SECTION_NAME ".text"
+ #define MMO_DATA_SECTION_NAME ".data"
+
+ /* A definition for the flags we put in spec data in files.  A copy of our
+    own of some flags to keep immune to BFD flag changes.  See section.c of
+    2001-07-18 for flag documentation.  */
+ #define MMO_SEC_ALLOC      0x001
+ #define MMO_SEC_LOAD       0x002
+ #define MMO_SEC_RELOC      0x004
+ #define MMO_SEC_READONLY   0x010
+ #define MMO_SEC_CODE       0x020
+ #define MMO_SEC_DATA       0x040
+ #define MMO_SEC_NEVER_LOAD 0x400
+ #define MMO_SEC_IS_COMMON 0x8000
+ #define MMO_SEC_DEBUGGING 0x10000
+
+ #endif /* ELF_MMIX_H */

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]