osprey/cygnus/opcodes/ia64-gen.c File Reference

#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "ansidecl.h"
#include "libiberty.h"
#include "safe-ctype.h"
#include "sysdep.h"
#include "getopt.h"
#include "ia64-opc.h"
#include "ia64-opc-a.c"
#include "ia64-opc-i.c"
#include "ia64-opc-m.c"
#include "ia64-opc-b.c"
#include "ia64-opc-f.c"
#include "ia64-opc-x.c"
#include "ia64-opc-d.c"
#include <libintl.h>

Include dependency graph for ia64-gen.c:

Go to the source code of this file.

Data Types

type  main_entry
type  completer_entry
type  disent
type  bittree
type  string_entry
type  rdep
type  iclass
type  opdep
type  deplist

Defines

#define _(String)   gettext (String)
#define NELEMS(a)   (sizeof (a) / sizeof ((a)[0]))
#define tmalloc(X)   (X *) xmalloc (sizeof (X))
#define IS_SKIP(ent)
#define IS_ONLY_IFZERO(ENT)
#define OPTION_SRCDIR   200

Functions/Subroutines

static void fail (const char *,...)
static void warn (const char *,...)
static struct rdepinsert_resource (const char *, enum ia64_dependency_mode)
static int deplist_equals (struct deplist *, struct deplist *)
static short insert_deplist (int, unsigned short *)
static short insert_dependencies (int, unsigned short *, int, unsigned short *)
static void mark_used (struct iclass *, int)
static int fetch_insn_class (const char *, int)
static int sub_compare (const void *, const void *)
static void load_insn_classes (void)
static void parse_resource_users (const char *, int **, int *, int **)
static int parse_semantics (char *)
static void add_dep (const char *, const char *, const char *, int, int, char *, int)
static void load_depfile (const char *, enum ia64_dependency_mode)
static void load_dependencies (void)
static int irf_operand (int, const char *)
static int in_iclass_mov_x (struct ia64_opcode *, struct iclass *, const char *, const char *)
static int in_iclass (struct ia64_opcode *, struct iclass *, const char *, const char *, int *)
static int lookup_regindex (const char *, int)
static int lookup_specifier (const char *)
static void print_dependency_table (void)
static struct string_entryinsert_string (char *)
static void gen_dis_table (struct bittree *)
static void print_dis_table (void)
static void generate_disassembler (void)
static void print_string_table (void)
static int completer_entries_eq (struct completer_entry *, struct completer_entry *)
static struct completer_entryinsert_gclist (struct completer_entry *)
static int get_prefix_len (const char *)
static void compute_completer_bits (struct main_entry *, struct completer_entry *)
static void collapse_redundant_completers (void)
static int insert_opcode_dependencies (struct ia64_opcode *, struct completer_entry *)
static void insert_completer_entry (struct ia64_opcode *, struct main_entry *, int)
static void print_completer_entry (struct completer_entry *)
static void print_completer_table (void)
static int opcodes_eq (struct ia64_opcode *, struct ia64_opcode *)
static void add_opcode_entry (struct ia64_opcode *)
static void print_main_table (void)
static void shrink (struct ia64_opcode *)
static void print_version (void)
static void usage (FILE *, int)
static void finish_distable (void)
static void insert_bit_table_ent (struct bittree *, int, ia64_insn, ia64_insn, int, int, int)
static void add_dis_entry (struct bittree *, ia64_insn, ia64_insn, int, struct completer_entry *, int)
static void compact_distree (struct bittree *)
static struct bittreemake_bittree_entry (void)
static struct disentadd_dis_table_ent (struct disent *, int, int, int)
static void parse_resource_users (char *ref, int **usersp, int *nusersp, int **notesp) const
static int get_prefix_len (char *name) const
static int insert_opcode_dependencies (struct ia64_opcode *opc, cmp)
int main (int argc, char **argv)

Variables

const char * program_name = NULL
int debug = 0
struct main_entrymaintable
struct main_entry ** ordered_table
int otlen = 0
int ottotlen = 0
int opcode_count = 0
struct disentdisinsntable
struct string_entry ** string_table
int strtablen = 0
int strtabtotlen = 0
struct rdep ** rdeps
static int rdepslen = 0
static int rdepstotlen = 0
struct iclass ** ics
static int iclen = 0
static int ictotlen = 0
struct opdep ** opdeps
static int opdeplen = 0
static int opdeptotlen = 0
struct deplist ** dlists
static int dlistlen = 0
static int dlisttotlen = 0
static unsigned char * insn_list
static int insn_list_len = 0
static int tot_insn_list_len = 0
static struct completer_entry ** glist
static int glistlen = 0
static int glisttotlen = 0
struct option long_options []


Define Documentation

#define _ ( String   )     gettext (String)

Definition at line 59 of file ia64-gen.c.

#define IS_ONLY_IFZERO ( ENT   ) 

Value:

((ENT)->bits[0] != NULL && (ENT)->bits[1] == NULL && (ENT)->bits[2] == NULL \
   && (ENT)->disent == NULL && (ENT)->skip_flag == 0)

Referenced by gen_dis_table().

#define IS_SKIP ( ent   ) 

Value:

((ent->bits[2] !=NULL) \
     && (ent->bits[0] == NULL && ent->bits[1] == NULL && ent->skip_flag == 0))

Referenced by compact_distree().

#define NELEMS ( a   )     (sizeof (a) / sizeof ((a)[0]))

Definition at line 64 of file ia64-gen.c.

#define OPTION_SRCDIR   200

Definition at line 2758 of file ia64-gen.c.

Referenced by main().

#define tmalloc ( X   )     (X *) xmalloc (sizeof (X))


Function Documentation

static void add_dep ( const char *  name,
const char *  chk,
const char *  reg,
int  semantics,
int  mode,
char *  extra,
int  flag 
) [static]

static void add_dis_entry ( struct bittree first,
ia64_insn  opcode,
ia64_insn  mask,
int  opcodenum,
struct completer_entry ent,
int  completer_index 
) [static]

static struct disent * add_dis_table_ent ( struct disent which,
int  insn,
int  order,
int  completer_index 
) [static, read]

static void add_opcode_entry ( struct ia64_opcode opc  )  [static]

static void collapse_redundant_completers ( void   )  [static]

static void compact_distree ( struct bittree ent  )  [static]

Definition at line 1825 of file ia64-gen.c.

References b, bittree::bits, bittree::disent, free(), i, IS_SKIP, next, NULL, and x.

Referenced by generate_disassembler().

static int completer_entries_eq ( struct completer_entry ent1,
struct completer_entry ent2 
) [static]

Definition at line 2202 of file ia64-gen.c.

References NULL.

Referenced by insert_gclist().

static void compute_completer_bits ( struct main_entry ment,
struct completer_entry ent 
) [static]

static int deplist_equals ( struct deplist d1,
struct deplist d2 
) [static]

Definition at line 340 of file ia64-gen.c.

References deplist::deps, i, and deplist::len.

Referenced by insert_deplist().

static void fail ( const char *  message,
  ... 
) [static]

Definition at line 296 of file ia64-gen.c.

References _, args, fprintf(), program_name, va_end, va_start, vfprintf(), and xexit().

static int fetch_insn_class ( const char *  full_name,
int  create 
) [static]

static void finish_distable ( void   )  [static]

Definition at line 1740 of file ia64-gen.c.

References disinsntable, disent::next_ent, disent::nextcnt, NULL, disent::ournum, and prev.

Referenced by generate_disassembler().

static void gen_dis_table ( struct bittree ent  )  [static]

static void generate_disassembler ( void   )  [static]

static int get_prefix_len ( char *  name  )  const [static]

Definition at line 2320 of file ia64-gen.c.

References c, NULL, strchr, and strlen().

static int get_prefix_len ( const char *   )  [static]

static int in_iclass ( struct ia64_opcode idesc,
struct iclass ic,
const char *  format,
const char *  field,
int *  notep 
) [static]

static int in_iclass_mov_x ( struct ia64_opcode idesc,
struct iclass ic,
const char *  format,
const char *  field 
) [static]

static void insert_bit_table_ent ( struct bittree curr_ent,
int  bit,
ia64_insn  opcode,
ia64_insn  mask,
int  opcodenum,
int  order,
int  completer_index 
) [static]

Definition at line 1754 of file ia64-gen.c.

References add_dis_table_ent(), b, bittree::bits, make_bittree_entry(), next, and NULL.

Referenced by add_dis_entry().

static void insert_completer_entry ( struct ia64_opcode opc,
struct main_entry tabent,
int  order 
) [static]

static short insert_dependencies ( int  nchks,
unsigned short *  chks,
int  nregs,
unsigned short *  regs 
) [static]

Definition at line 403 of file ia64-gen.c.

References opdep::chk, i, insert_deplist(), opdeplen, opdeps, opdeptotlen, opdep::reg, tmalloc, and xrealloc().

Referenced by insert_opcode_dependencies().

static short insert_deplist ( int  count,
unsigned short *  deps 
) [static]

static struct completer_entry * insert_gclist ( struct completer_entry ent  )  [static, read]

static int insert_opcode_dependencies ( struct ia64_opcode opc,
cmp   
) [static]

static int insert_opcode_dependencies ( struct ia64_opcode ,
struct completer_entry  
) [static]

Referenced by insert_completer_entry().

static struct rdep * insert_resource ( const char *  name,
enum ia64_dependency_mode  type 
) [static, read]

Definition at line 321 of file ia64-gen.c.

References memset, rdep::mode, rdep::name, rdeps, rdepslen, rdepstotlen, tmalloc, rdep::waw_special, xrealloc(), and xstrdup().

Referenced by add_dep().

static struct string_entry * insert_string ( char *  str  )  [static, read]

Definition at line 1614 of file ia64-gen.c.

References c, end, i, s, start, strcmp(), string_table, strtablen, strtabtotlen, tmalloc, x, xrealloc(), and xstrdup().

Referenced by add_opcode_entry(), and insert_completer_entry().

static int irf_operand ( int  op,
const char *  field 
) [static]

static void load_dependencies ( void   )  [static]

Definition at line 873 of file ia64-gen.c.

References debug, IA64_DV_RAW, IA64_DV_WAR, IA64_DV_WAW, load_depfile(), printf(), and rdepslen.

Referenced by main().

static void load_depfile ( const char *  filename,
enum ia64_dependency_mode  mode 
) [static]

static void load_insn_classes ( void   )  [static]

static int lookup_regindex ( const char *  name,
int  specifier 
) [static]

Definition at line 1260 of file ia64-gen.c.

References abort, IA64_RS_ARX, IA64_RS_CRX, IA64_RS_PSR, REG_NONE, and strstr().

Referenced by print_dependency_table().

static int lookup_specifier ( const char *  name  )  [static]

int main ( int argc  ,
char **  argv 
)

static struct bittree * make_bittree_entry ( void   )  [static, read]

static void mark_used ( struct iclass ic,
int  clear_terminals 
) [static]

static int opcodes_eq ( struct ia64_opcode opc1,
struct ia64_opcode opc2 
) [static]

static void parse_resource_users ( char *  ref,
int **  usersp,
int *  nusersp,
int **  notesp 
) const [static]

static void parse_resource_users ( const char *  ,
int **  ,
int *  ,
int **   
) [static]

Referenced by add_dep().

static int parse_semantics ( char *  sem  )  [static]

static void print_completer_entry ( struct completer_entry ent  )  [static]

Definition at line 2572 of file ia64-gen.c.

References abort, completer_entry::bits, completer_entry::mask, NULL, and printf().

Referenced by print_completer_table().

static void print_completer_table ( void   )  [static]

Definition at line 2603 of file ia64-gen.c.

References glistlen, print_completer_entry(), printf(), and x.

Referenced by main().

static void print_dependency_table ( void   )  [static]

static void print_dis_table ( void   )  [static]

static void print_main_table ( void   )  [static]

static void print_string_table ( void   )  [static]

Definition at line 2160 of file ia64-gen.c.

References abort, buf, len, printf(), s, sprintf(), strcat(), string_table, strlen(), strtablen, and x.

Referenced by main().

static void print_version ( void   )  [static]

static void shrink ( struct ia64_opcode table  )  [static]

static int sub_compare ( const void e1,
const void e2 
) [static]

Definition at line 588 of file ia64-gen.c.

References ics, iclass::is_class, iclass::name, and strcmp().

Referenced by load_insn_classes().

static void usage ( FILE stream,
int  status 
) [static]

Definition at line 2777 of file ia64-gen.c.

References fprintf(), program_name, and xexit().

static void warn ( const char *  message,
  ... 
) [static]


Variable Documentation

int debug = 0

Definition at line 62 of file ia64-gen.c.

int dlistlen = 0 [static]

Definition at line 242 of file ia64-gen.c.

Referenced by insert_deplist(), and print_dependency_table().

int dlisttotlen = 0 [static]

Definition at line 243 of file ia64-gen.c.

Referenced by insert_deplist().

int glistlen = 0 [static]

int glisttotlen = 0 [static]

Definition at line 2197 of file ia64-gen.c.

Referenced by insert_gclist().

int iclen = 0 [static]

Definition at line 222 of file ia64-gen.c.

Referenced by fetch_insn_class(), load_insn_classes(), and print_dependency_table().

int ictotlen = 0 [static]

Definition at line 223 of file ia64-gen.c.

Referenced by fetch_insn_class().

unsigned char* insn_list [static]

int insn_list_len = 0 [static]

Definition at line 1871 of file ia64-gen.c.

Referenced by gen_dis_table(), and print_dis_table().

Initial value:

 
{
  {"srcdir",  required_argument, NULL, OPTION_SRCDIR},
  {"debug",   no_argument,       NULL, 'd'},
  {"version", no_argument,       NULL, 'V'},
  {"help",    no_argument,       NULL, 'h'},
  {0,         no_argument,       NULL, 0}
}

Definition at line 2760 of file ia64-gen.c.

int opcode_count = 0

Definition at line 88 of file ia64-gen.c.

Referenced by add_dis_entry(), and add_opcode_entry().

int opdeplen = 0 [static]

Definition at line 232 of file ia64-gen.c.

Referenced by insert_dependencies(), and print_dependency_table().

int opdeptotlen = 0 [static]

Definition at line 233 of file ia64-gen.c.

Referenced by insert_dependencies().

int otlen = 0

Definition at line 86 of file ia64-gen.c.

Referenced by add_opcode_entry(), and generate_disassembler().

int ottotlen = 0

Definition at line 87 of file ia64-gen.c.

Referenced by add_opcode_entry().

const char* program_name = NULL

Definition at line 61 of file ia64-gen.c.

int rdepslen = 0 [static]

int rdepstotlen = 0 [static]

Definition at line 205 of file ia64-gen.c.

Referenced by insert_resource().

int strtablen = 0

Definition at line 178 of file ia64-gen.c.

Referenced by insert_string(), and print_string_table().

int strtabtotlen = 0

Definition at line 179 of file ia64-gen.c.

Referenced by insert_string().

int tot_insn_list_len = 0 [static]

Definition at line 1872 of file ia64-gen.c.

Referenced by gen_dis_table().


Generated on Wed Apr 8 15:05:25 2009 for Open64 by  doxygen 1.5.6