OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [itbl-ops.h] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
/* itbl-ops.h
/* itbl-ops.h
   Copyright 1997, 1999, 2000, 2003, 2006, 2007 Free Software Foundation, Inc.
   Copyright 1997, 1999, 2000, 2003, 2006, 2007 Free Software Foundation, Inc.
 
 
   This file is part of GAS, the GNU Assembler.
   This file is part of GAS, the GNU Assembler.
 
 
   GAS is free software; you can redistribute it and/or modify
   GAS is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   the Free Software Foundation; either version 3, or (at your option)
   any later version.
   any later version.
 
 
   GAS is distributed in the hope that it will be useful,
   GAS is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with GAS; see the file COPYING.  If not, write to the Free
   along with GAS; see the file COPYING.  If not, write to the Free
   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
   02110-1301, USA.  */
   02110-1301, USA.  */
 
 
/* External functions, constants and defines for itbl support */
/* External functions, constants and defines for itbl support */
 
 
#ifdef HAVE_ITBL_CPU
#ifdef HAVE_ITBL_CPU
#include "itbl-cpu.h"
#include "itbl-cpu.h"
#endif
#endif
 
 
/* Defaults for definitions required by generic code */
/* Defaults for definitions required by generic code */
#ifndef ITBL_NUMBER_OF_PROCESSORS
#ifndef ITBL_NUMBER_OF_PROCESSORS
#define ITBL_NUMBER_OF_PROCESSORS 1
#define ITBL_NUMBER_OF_PROCESSORS 1
#endif
#endif
 
 
#ifndef ITBL_MAX_BITPOS
#ifndef ITBL_MAX_BITPOS
#define ITBL_MAX_BITPOS 31
#define ITBL_MAX_BITPOS 31
#endif
#endif
 
 
#ifndef ITBL_TYPE
#ifndef ITBL_TYPE
#define ITBL_TYPE unsigned long
#define ITBL_TYPE unsigned long
#endif
#endif
 
 
#ifndef ITBL_IS_INSN
#ifndef ITBL_IS_INSN
#define ITBL_IS_INSN(insn) 1
#define ITBL_IS_INSN(insn) 1
#endif
#endif
 
 
#ifndef ITBL_DECODE_PNUM
#ifndef ITBL_DECODE_PNUM
#define ITBL_DECODE_PNUM(insn) 0
#define ITBL_DECODE_PNUM(insn) 0
#endif
#endif
 
 
#ifndef ITBL_ENCODE_PNUM
#ifndef ITBL_ENCODE_PNUM
#define ITBL_ENCODE_PNUM(pnum) 0
#define ITBL_ENCODE_PNUM(pnum) 0
#endif
#endif
 
 
typedef ITBL_TYPE t_insn;
typedef ITBL_TYPE t_insn;
 
 
/* types of entries */
/* types of entries */
typedef enum
typedef enum
  {
  {
    e_insn,
    e_insn,
    e_dreg,
    e_dreg,
    e_regtype0 = e_dreg,
    e_regtype0 = e_dreg,
    e_creg,
    e_creg,
    e_greg,
    e_greg,
    e_addr,
    e_addr,
    e_nregtypes = e_greg + 1,
    e_nregtypes = e_greg + 1,
    e_immed,
    e_immed,
    e_ntypes,
    e_ntypes,
    e_invtype                   /* invalid type */
    e_invtype                   /* invalid type */
  } e_type;
  } e_type;
 
 
typedef enum
typedef enum
  {
  {
    e_p0,
    e_p0,
    e_nprocs = ITBL_NUMBER_OF_PROCESSORS,
    e_nprocs = ITBL_NUMBER_OF_PROCESSORS,
    e_invproc                   /* invalid processor */
    e_invproc                   /* invalid processor */
  } e_processor;
  } e_processor;
 
 
/* 0 means an instruction table was not specified.  */
/* 0 means an instruction table was not specified.  */
extern int itbl_have_entries;
extern int itbl_have_entries;
 
 
/* These routines are visible to the main part of the assembler */
/* These routines are visible to the main part of the assembler */
 
 
int itbl_parse (char *insntbl);
int itbl_parse (char *insntbl);
void itbl_init (void);
void itbl_init (void);
char *itbl_get_field (char **s);
char *itbl_get_field (char **s);
unsigned long itbl_assemble (char *name, char *operands);
unsigned long itbl_assemble (char *name, char *operands);
int itbl_disassemble (char *str, unsigned long insn);
int itbl_disassemble (char *str, unsigned long insn);
int itbl_parse (char *tbl);     /* parses insn tbl */
int itbl_parse (char *tbl);     /* parses insn tbl */
int itbl_get_reg_val (char *name, unsigned long *pval);
int itbl_get_reg_val (char *name, unsigned long *pval);
int itbl_get_val (e_processor processor, e_type type, char *name,
int itbl_get_val (e_processor processor, e_type type, char *name,
                  unsigned long *pval);
                  unsigned long *pval);
char *itbl_get_name (e_processor processor, e_type type, unsigned long val);
char *itbl_get_name (e_processor processor, e_type type, unsigned long val);
 
 
/* These routines are called by the table parser used to build the
/* These routines are called by the table parser used to build the
   dynamic list of new processor instructions and registers.  */
   dynamic list of new processor instructions and registers.  */
 
 
struct itbl_entry *itbl_add_reg (int yyproc, int yytype,
struct itbl_entry *itbl_add_reg (int yyproc, int yytype,
                                 char *regname, int regnum);
                                 char *regname, int regnum);
struct itbl_entry *itbl_add_insn (int yyproc, char *name,
struct itbl_entry *itbl_add_insn (int yyproc, char *name,
             unsigned long value, int sbit, int ebit, unsigned long flags);
             unsigned long value, int sbit, int ebit, unsigned long flags);
struct itbl_field *itbl_add_operand (struct itbl_entry * e, int yytype,
struct itbl_field *itbl_add_operand (struct itbl_entry * e, int yytype,
                                  int sbit, int ebit, unsigned long flags);
                                  int sbit, int ebit, unsigned long flags);
 
 

powered by: WebSVN 2.1.0

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