OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [include/] [opcode/] [ppc.h] - Diff between revs 157 and 225

Show entire file | Details | Blame | View Log

Rev 157 Rev 225
Line 1... Line 1...
/* ppc.h -- Header file for PowerPC opcode table
/* ppc.h -- Header file for PowerPC opcode table
   Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
   Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
   2007 Free Software Foundation, Inc.
   2007, 2008, 2009 Free Software Foundation, Inc.
   Written by Ian Lance Taylor, Cygnus Support
   Written by Ian Lance Taylor, Cygnus Support
 
 
This file is part of GDB, GAS, and the GNU binutils.
This file is part of GDB, GAS, and the GNU binutils.
 
 
GDB, GAS, and the GNU binutils are free software; you can redistribute
GDB, GAS, and the GNU binutils are free software; you can redistribute
Line 20... Line 20...
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 
#ifndef PPC_H
#ifndef PPC_H
#define PPC_H
#define PPC_H
 
 
 
#include "bfd_stdint.h"
 
 
 
typedef uint64_t ppc_cpu_t;
 
 
/* The opcode table is an array of struct powerpc_opcode.  */
/* The opcode table is an array of struct powerpc_opcode.  */
 
 
struct powerpc_opcode
struct powerpc_opcode
{
{
  /* The opcode name.  */
  /* The opcode name.  */
Line 40... Line 44...
  unsigned long mask;
  unsigned long mask;
 
 
  /* One bit flags for the opcode.  These are used to indicate which
  /* One bit flags for the opcode.  These are used to indicate which
     specific processors support the instructions.  The defined values
     specific processors support the instructions.  The defined values
     are listed below.  */
     are listed below.  */
  unsigned long flags;
  ppc_cpu_t flags;
 
 
 
  /* One bit flags for the opcode.  These are used to indicate which
 
     specific processors no longer support the instructions.  The defined
 
     values are listed below.  */
 
  ppc_cpu_t deprecated;
 
 
  /* An array of operand codes.  Each code is an index into the
  /* An array of operand codes.  Each code is an index into the
     operand table.  They appear in the order which the operands must
     operand table.  They appear in the order which the operands must
     appear in assembly code, and are terminated by a zero.  */
     appear in assembly code, and are terminated by a zero.  */
  unsigned char operands[8];
  unsigned char operands[8];
Line 105... Line 114...
#define PPC_OPCODE_440              0x2000
#define PPC_OPCODE_440              0x2000
 
 
/* Opcode is only supported by Power4 architecture.  */
/* Opcode is only supported by Power4 architecture.  */
#define PPC_OPCODE_POWER4           0x4000
#define PPC_OPCODE_POWER4           0x4000
 
 
/* Opcode isn't supported by Power4 architecture.  */
/* Opcode is only supported by Power7 architecture.  */
#define PPC_OPCODE_NOPOWER4         0x8000
#define PPC_OPCODE_POWER7           0x8000
 
 
/* Opcode is only supported by POWERPC Classic architecture.  */
/* Opcode is only supported by POWERPC Classic architecture.  */
#define PPC_OPCODE_CLASSIC         0x10000
#define PPC_OPCODE_CLASSIC         0x10000
 
 
/* Opcode is only supported by e500x2 Core.  */
/* Opcode is only supported by e500x2 Core.  */
Line 147... Line 156...
#define PPC_OPCODE_CELL          0x8000000
#define PPC_OPCODE_CELL          0x8000000
 
 
/* Opcode is supported by CPUs with paired singles support.  */
/* Opcode is supported by CPUs with paired singles support.  */
#define PPC_OPCODE_PPCPS         0x10000000
#define PPC_OPCODE_PPCPS         0x10000000
 
 
 
/* Opcode is supported by Power E500MC */
 
#define PPC_OPCODE_E500MC        0x20000000
 
 
 
/* Opcode is supported by PowerPC 405 processor.  */
 
#define PPC_OPCODE_405           0x40000000
 
 
 
/* Opcode is supported by Vector-Scalar (VSX) Unit */
 
#define PPC_OPCODE_VSX           0x80000000
 
 
 
/* Opcode is supported by A2.  */
 
#define PPC_OPCODE_A2            0x100000000ULL
 
 
 
/* Opcode is supported by PowerPC 476 processor.  */
 
#define PPC_OPCODE_476           0x200000000ULL
 
 
/* A macro to extract the major opcode from an instruction.  */
/* A macro to extract the major opcode from an instruction.  */
#define PPC_OP(i) (((i) >> 26) & 0x3f)
#define PPC_OP(i) (((i) >> 26) & 0x3f)


/* The operands table is an array of struct powerpc_operand.  */
/* The operands table is an array of struct powerpc_operand.  */
 
 
Line 178... Line 202...
     the operand value is illegal, *ERRMSG will be set to a warning
     the operand value is illegal, *ERRMSG will be set to a warning
     string (the operand will be inserted in any case).  If the
     string (the operand will be inserted in any case).  If the
     operand value is legal, *ERRMSG will be unchanged (most operands
     operand value is legal, *ERRMSG will be unchanged (most operands
     can accept any value).  */
     can accept any value).  */
  unsigned long (*insert)
  unsigned long (*insert)
    (unsigned long instruction, long op, int dialect, const char **errmsg);
    (unsigned long instruction, long op, ppc_cpu_t dialect, const char **errmsg);
 
 
  /* Extraction function.  This is used by the disassembler.  To
  /* Extraction function.  This is used by the disassembler.  To
     extract this operand type from an instruction, check this field.
     extract this operand type from an instruction, check this field.
 
 
     If it is NULL, compute
     If it is NULL, compute
Line 196... Line 220...
     instruction value.  It will return the value of the operand.  If
     instruction value.  It will return the value of the operand.  If
     the INVALID argument is not NULL, *INVALID will be set to
     the INVALID argument is not NULL, *INVALID will be set to
     non-zero if this operand type can not actually be extracted from
     non-zero if this operand type can not actually be extracted from
     this operand (i.e., the instruction does not match).  If the
     this operand (i.e., the instruction does not match).  If the
     operand is valid, *INVALID will not be changed.  */
     operand is valid, *INVALID will not be changed.  */
  long (*extract) (unsigned long instruction, int dialect, int *invalid);
  long (*extract) (unsigned long instruction, ppc_cpu_t dialect, int *invalid);
 
 
  /* One bit syntax flags.  */
  /* One bit syntax flags.  */
  unsigned long flags;
  unsigned long flags;
};
};
 
 
Line 297... Line 321...
/* This operand is for the DQ field in a DQ form instruction.  */
/* This operand is for the DQ field in a DQ form instruction.  */
#define PPC_OPERAND_DQ (0x8000)
#define PPC_OPERAND_DQ (0x8000)
 
 
/* Valid range of operand is 0..n rather than 0..n-1.  */
/* Valid range of operand is 0..n rather than 0..n-1.  */
#define PPC_OPERAND_PLUS1 (0x10000)
#define PPC_OPERAND_PLUS1 (0x10000)
 
 
 
/* Xilinx APU and FSL related operands */
 
#define PPC_OPERAND_FSL (0x20000)
 
#define PPC_OPERAND_FCR (0x40000)
 
#define PPC_OPERAND_UDI (0x80000)
 
 
 
/* This operand names a vector-scalar unit register.  The disassembler
 
   prints these with a leading 'vs'.  */
 
#define PPC_OPERAND_VSR (0x100000)


/* The POWER and PowerPC assemblers use a few macros.  We keep them
/* The POWER and PowerPC assemblers use a few macros.  We keep them
   with the operands table for simplicity.  The macro table is an
   with the operands table for simplicity.  The macro table is an
   array of struct powerpc_macro.  */
   array of struct powerpc_macro.  */
 
 
Line 313... Line 346...
  unsigned int operands;
  unsigned int operands;
 
 
  /* One bit flags for the opcode.  These are used to indicate which
  /* One bit flags for the opcode.  These are used to indicate which
     specific processors support the instructions.  The values are the
     specific processors support the instructions.  The values are the
     same as those for the struct powerpc_opcode flags field.  */
     same as those for the struct powerpc_opcode flags field.  */
  unsigned long flags;
  ppc_cpu_t flags;
 
 
  /* A format string to turn the macro into a normal instruction.
  /* A format string to turn the macro into a normal instruction.
     Each %N in the string is replaced with operand number N (zero
     Each %N in the string is replaced with operand number N (zero
     based).  */
     based).  */
  const char *format;
  const char *format;
};
};
 
 
extern const struct powerpc_macro powerpc_macros[];
extern const struct powerpc_macro powerpc_macros[];
extern const int powerpc_num_macros;
extern const int powerpc_num_macros;
 
 
 
extern ppc_cpu_t ppc_parse_cpu (ppc_cpu_t, const char *);
 
 
#endif /* PPC_H */
#endif /* PPC_H */
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.