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]
Other format: [Raw text]

Patches to move cgen files to C90 with prototypes


Enclosed is patches to 7 cgen related files to always use prototypes and to use
void * instead of PTR, since the binutils project now requires a C90 compiler.
I tested them by building a m32r toolchain (including running cgen to rebuild
the opcodes/m32r-*.{c,h} files), and doing a make check in gas to insure there
are no new regressions or warnings.

These changes were mechanical in nature, no calling sequence was changed at
this time.  I'm waiting for an answer from the FSF copyright assignment clerk
on a question before I can send in the paperwork from my new employer, so I
don't know whether this is just considered a mechanical change and not needing
the assignment or we have to wait until the assignment goes through the paper
trail.  If the patch is accepted, I will submit a patch updating all of the
generated files next.

(include/opcode directory)

2003-08-06  Michael Meissner  <gnu@the-meissners.org>

	* cgen.h: Remove PARAM macro usage in all prototypes.
	(CGEN_EXTRACT_INFO): Use void * instead of PTR.
	(cgen_print_fn): Ditto.
	(CGEN_HW_ENTRY): Ditto.
	(CGEN_MAYBE_MULTI_IFLD): Ditto.
	(struct cgen_insn): Ditto.
	(CGEN_CPU_TABLE): Ditto.

(opcodes directory)

2003-08-06  Michael Meissner  <gnu@the-meissners.org>

	* cgen-ibld.in (insert_normal): Remove PARAMS macro.
	(insn_insn_normal): Ditto.
	(extract_normal): Ditto.
	(extract_insn_normal): Ditto.
	(put_insn_int_value): Ditto.
	(insert_1): Ditto.
	(fill_cache): Ditto.
	(extract_1): Ditto.
	(insert_1): Prototype definition.
	(insert_normal): Ditto.
	(insert_insn_normal): Ditto.
	(put_insn_int_value): Ditto.
	(fill_cache): Ditto.
	(extract_1): Ditto.
	(extract_normal): Ditto.
	(extract_insn_normal): Ditto.

	* cgen-dis.in (print_normal): Remove PARAMS macro.  Use void *
	instead of PTR.
	(print_address): Ditto.
	(print_keyword): Ditto.
	(print_insn_normal): Ditto.
	(print_insn): Ditto.
	(default_print_insn): Ditto.
	(read_insn): Ditto.
	(print_normal): Prototype definition.  Use void * instead of PTR.
	(print_address): Ditto.
	(print_keyword): Ditto.
	(print_insn_normal): Ditto.
	(read_insn): Ditto.
	(print_insn): Ditto.
	(default_print_insn): Ditto.
	(print_insn_@arch@): Ditto.

	* cgen-asm.in (parse_insn_normal): Remove PARAMS macro.
	(@arch@_cgen_build_insn_regex): Prototype definition.
	(parse_insn_normal): Ditto.
	(@arch@_cgen_assemble_insn): Ditto.
	(@arch@_cgen_asm_hash_keywords): Ditto.

	* cgen-dis.c (hash_insn_array): Remove PARAMS macro.
	(hash_insn_list): Ditto.
	(build_dis_hash_table): Ditto.
	(count_decodable_bits): Ditto.
	(add_insn_to_hash_chain): Ditto.
	(count_decodable_bits): Prototype definition.
	(add_insn_to_hash_chain): Ditto.
	(hash_insn_array): Ditto.
	(hash_insn_list): Ditto.
	(build_dis_hash_table): Ditto.
	(cgen_dis_lookup_insn): Ditto.

	* cgen-opc.c (hash_keyword_name): Remove PARAMS macro.
	(hash_keyword_value): Ditto.
	(build_keyword_hash_tables): Ditto.
	(cgen_keyword_lookup_name): Prototype definition.
	(cgen_keyword_lookup_value): Ditto.
	(cgen_keyword_add): Ditto.
	(cgen_keyword_search_init): Ditto.
	(cgen_keyword_search_next): Ditto.
	(hash_keyword_name): Ditto.
	(hash_keyword_value): Ditto.
	(build_keyword_hash_tables): Ditto.
	(cgen_hw_lookup_by_name): Ditto.
	(cgen_hw_lookup_by_num): Ditto.
	(cgen_operand_lookup_by_name): Ditto.
	(cgen_operand_lookup_by_num): Ditto.
	(cgen_insn_count): Ditto.
	(cgen_macro_insn_count): Ditto.
	(cgen_get_insn_value): Ditto.
	(cgen_put_insn_value): Ditto.
	(cgen_lookup_insn): Ditto.
	(cgen_get_insn_operands): Ditto.
	(cgen_lookup_get_insn_operands): Ditto.
	(cgen_set_signed_overflow_ok): Ditto.
	(cgen_clear_signed_overflow_ok): Ditto.
	(cgen_signed_overflow_ok_p): Ditto.

	* cgen-asm.c (hash_insn_array): Remove PARAMS macro.
	(hash_insn_list): Ditto.
	(build_asm_hash_table): Ditto.
	(cgen_set_parse_operand_fn): Prototype definition.
	(cgen_init_parse_operand): Ditto.
	(hash_insn_array): Ditto.
	(hash_insn_list): Ditto.
	(build_asm_hash_table): Ditto.
	(cgen_asm_lookup_insn): Ditto.
	(cgen_parse_keyword): Ditto.
	(cgen_parse_signed_integer): Ditto.
	(cgen_parse_unsigned_integer): Ditto.
	(cgen_parse_address): Ditto.
	(cgen_validate_signed_integer): Ditto.
	(cgen_validate_unsigned_integer): Ditto.

*** include/opcode/cgen.h.~1.18.~	2002-12-02 16:51:52.000000000 -0500
--- include/opcode/cgen.h	2003-08-06 18:29:59.000000000 -0400
*************** typedef struct cgen_fields CGEN_FIELDS;
*** 242,250 ****
  
  typedef struct {
    /* A pointer to the disassemble_info struct.
!      We don't require dis-asm.h so we use PTR for the type here.
       If NULL, BYTES is full of valid data (VALID == -1).  */
!   PTR dis_info;
    /* Points to a working buffer of sufficient size.  */
    unsigned char *insn_bytes;
    /* Mask of bytes that are valid in INSN_BYTES.  */
--- 242,250 ----
  
  typedef struct {
    /* A pointer to the disassemble_info struct.
!      We don't require dis-asm.h so we use void * for the type here.
       If NULL, BYTES is full of valid data (VALID == -1).  */
!   void *dis_info;
    /* Points to a working buffer of sufficient size.  */
    unsigned char *insn_bytes;
    /* Mask of bytes that are valid in INSN_BYTES.  */
*************** typedef struct {
*** 265,272 ****
     If not it is left alone.
     The result is NULL if success or an error message.  */
  typedef const char * (cgen_parse_fn)
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
! 	      const char **strp_, CGEN_FIELDS *fields_));
  
  /* Insert handler.
     CD is a cpu table descriptor.
--- 265,272 ----
     If not it is left alone.
     The result is NULL if success or an error message.  */
  typedef const char * (cgen_parse_fn)
!   (CGEN_CPU_DESC, const CGEN_INSN *insn_,
!    const char **strp_, CGEN_FIELDS *fields_);
  
  /* Insert handler.
     CD is a cpu table descriptor.
*************** typedef const char * (cgen_parse_fn)
*** 279,287 ****
  
  #ifdef __BFD_H_SEEN__
  typedef const char * (cgen_insert_fn)
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
! 	      CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
! 	      bfd_vma pc_));
  #else
  typedef const char * (cgen_insert_fn) ();
  #endif
--- 279,287 ----
  
  #ifdef __BFD_H_SEEN__
  typedef const char * (cgen_insert_fn)
!   (CGEN_CPU_DESC, const CGEN_INSN *insn_,
!    CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
!    bfd_vma pc_);
  #else
  typedef const char * (cgen_insert_fn) ();
  #endif
*************** typedef const char * (cgen_insert_fn) ()
*** 300,308 ****
  
  #ifdef __BFD_H_SEEN__
  typedef int (cgen_extract_fn)
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
! 	      CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
! 	      CGEN_FIELDS *fields_, bfd_vma pc_));
  #else
  typedef int (cgen_extract_fn) ();
  #endif
--- 300,308 ----
  
  #ifdef __BFD_H_SEEN__
  typedef int (cgen_extract_fn)
!   (CGEN_CPU_DESC, const CGEN_INSN *insn_,
!    CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
!    CGEN_FIELDS *fields_, bfd_vma pc_);
  #else
  typedef int (cgen_extract_fn) ();
  #endif
*************** typedef int (cgen_extract_fn) ();
*** 319,326 ****
  
  #ifdef __BFD_H_SEEN__
  typedef void (cgen_print_fn)
!      PARAMS ((CGEN_CPU_DESC, PTR info_, const CGEN_INSN *insn_,
! 	      CGEN_FIELDS *fields_, bfd_vma pc_, int len_));
  #else
  typedef void (cgen_print_fn) ();
  #endif
--- 319,326 ----
  
  #ifdef __BFD_H_SEEN__
  typedef void (cgen_print_fn)
!   (CGEN_CPU_DESC, void * info_, const CGEN_INSN *insn_,
!    CGEN_FIELDS *fields_, bfd_vma pc_, int len_);
  #else
  typedef void (cgen_print_fn) ();
  #endif
*************** enum cgen_parse_operand_result
*** 384,392 ****
  
  #ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily.  */
  typedef const char * (cgen_parse_operand_fn)
!      PARAMS ((CGEN_CPU_DESC,
! 	      enum cgen_parse_operand_type, const char **, int, int,
! 	      enum cgen_parse_operand_result *, bfd_vma *));
  #else
  typedef const char * (cgen_parse_operand_fn) ();
  #endif
--- 384,392 ----
  
  #ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily.  */
  typedef const char * (cgen_parse_operand_fn)
!   (CGEN_CPU_DESC,
!    enum cgen_parse_operand_type, const char **, int, int,
!    enum cgen_parse_operand_result *, bfd_vma *);
  #else
  typedef const char * (cgen_parse_operand_fn) ();
  #endif
*************** typedef const char * (cgen_parse_operand
*** 394,404 ****
  /* Set the cgen_parse_operand_fn callback.  */
  
  extern void cgen_set_parse_operand_fn
!      PARAMS ((CGEN_CPU_DESC, cgen_parse_operand_fn));
  
  /* Called before trying to match a table entry with the insn.  */
  
! extern void cgen_init_parse_operand PARAMS ((CGEN_CPU_DESC));
  
  /* Operand values (keywords, integers, symbols, etc.)  */
  
--- 394,404 ----
  /* Set the cgen_parse_operand_fn callback.  */
  
  extern void cgen_set_parse_operand_fn
!   (CGEN_CPU_DESC, cgen_parse_operand_fn);
  
  /* Called before trying to match a table entry with the insn.  */
  
! extern void cgen_init_parse_operand (CGEN_CPU_DESC);
  
  /* Operand values (keywords, integers, symbols, etc.)  */
  
*************** typedef struct
*** 422,428 ****
    /* There is currently no example where both index specs and value specs
       are required, so for now both are clumped under "asm_data".  */
    enum cgen_asm_type asm_type;
!   PTR asm_data;
  #ifndef CGEN_HW_NBOOL_ATTRS
  #define CGEN_HW_NBOOL_ATTRS 1
  #endif
--- 422,428 ----
    /* There is currently no example where both index specs and value specs
       are required, so for now both are clumped under "asm_data".  */
    enum cgen_asm_type asm_type;
!   void *asm_data;
  #ifndef CGEN_HW_NBOOL_ATTRS
  #define CGEN_HW_NBOOL_ATTRS 1
  #endif
*************** typedef struct {
*** 453,461 ****
  } CGEN_HW_TABLE;
  
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
!      PARAMS ((CGEN_CPU_DESC, const char *));
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
!      PARAMS ((CGEN_CPU_DESC, unsigned int));
  
  /* This struct is used to describe things like register names, etc.  */
  
--- 453,461 ----
  } CGEN_HW_TABLE;
  
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
!   (CGEN_CPU_DESC, const char *);
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
!   (CGEN_CPU_DESC, unsigned int);
  
  /* This struct is used to describe things like register names, etc.  */
  
*************** typedef struct
*** 543,583 ****
  /* Lookup a keyword from its name.  */
  
  const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name
!   PARAMS ((CGEN_KEYWORD *, const char *));
  
  /* Lookup a keyword from its value.  */
  
  const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value
!   PARAMS ((CGEN_KEYWORD *, int));
  
  /* Add a keyword.  */
  
! void cgen_keyword_add PARAMS ((CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *));
  
  /* Keyword searching.
     This can be used to retrieve every keyword, or a subset.  */
  
  CGEN_KEYWORD_SEARCH cgen_keyword_search_init
!   PARAMS ((CGEN_KEYWORD *, const char *));
  const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
!   PARAMS ((CGEN_KEYWORD_SEARCH *));
  
  /* Operand value support routines.  */
  
  extern const char *cgen_parse_keyword
!      PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
  #ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily.  */
  extern const char *cgen_parse_signed_integer
!      PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
  extern const char *cgen_parse_unsigned_integer
!      PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *));
  extern const char *cgen_parse_address
!      PARAMS ((CGEN_CPU_DESC, const char **, int, int,
! 	      enum cgen_parse_operand_result *, bfd_vma *));
  extern const char *cgen_validate_signed_integer
!      PARAMS ((long, long, long));
  extern const char *cgen_validate_unsigned_integer
!      PARAMS ((unsigned long, unsigned long, unsigned long));
  #endif
  
  /* Operand modes.  */
--- 543,583 ----
  /* Lookup a keyword from its name.  */
  
  const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name
!   (CGEN_KEYWORD *, const char *);
  
  /* Lookup a keyword from its value.  */
  
  const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value
!   (CGEN_KEYWORD *, int);
  
  /* Add a keyword.  */
  
! void cgen_keyword_add (CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *);
  
  /* Keyword searching.
     This can be used to retrieve every keyword, or a subset.  */
  
  CGEN_KEYWORD_SEARCH cgen_keyword_search_init
!   (CGEN_KEYWORD *, const char *);
  const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
!   (CGEN_KEYWORD_SEARCH *);
  
  /* Operand value support routines.  */
  
  extern const char *cgen_parse_keyword
!   (CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *);
  #ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily.  */
  extern const char *cgen_parse_signed_integer
!   (CGEN_CPU_DESC, const char **, int, long *);
  extern const char *cgen_parse_unsigned_integer
!   (CGEN_CPU_DESC, const char **, int, unsigned long *);
  extern const char *cgen_parse_address
!   (CGEN_CPU_DESC, const char **, int, int,
!    enum cgen_parse_operand_result *, bfd_vma *);
  extern const char *cgen_validate_signed_integer
!   (long, long, long);
  extern const char *cgen_validate_unsigned_integer
!   (unsigned long, unsigned long, unsigned long);
  #endif
  
  /* Operand modes.  */
*************** typedef struct cgen_maybe_multi_ifield
*** 621,627 ****
  		n: indexed by array of more cgen_maybe_multi_ifields.  */
    union
    {
!     const PTR p;
      const struct cgen_maybe_multi_ifield * multi;
      const struct cgen_ifld * leaf;
    } val;
--- 621,627 ----
  		n: indexed by array of more cgen_maybe_multi_ifields.  */
    union
    {
!     const void *p;
      const struct cgen_maybe_multi_ifield * multi;
      const struct cgen_ifld * leaf;
    } val;
*************** typedef struct {
*** 705,713 ****
  } CGEN_OPERAND_TABLE;
  
  extern const CGEN_OPERAND * cgen_operand_lookup_by_name
!      PARAMS ((CGEN_CPU_DESC, const char *));
  extern const CGEN_OPERAND * cgen_operand_lookup_by_num
!      PARAMS ((CGEN_CPU_DESC, int));
  
  /* Instruction operand instances.
  
--- 705,713 ----
  } CGEN_OPERAND_TABLE;
  
  extern const CGEN_OPERAND * cgen_operand_lookup_by_name
!   (CGEN_CPU_DESC, const char *);
  extern const CGEN_OPERAND * cgen_operand_lookup_by_num
!   (CGEN_CPU_DESC, int);
  
  /* Instruction operand instances.
  
*************** typedef struct
*** 1061,1068 ****
  
  /* Return number of instructions.  This includes any added at run-time.  */
  
! extern int cgen_insn_count PARAMS ((CGEN_CPU_DESC));
! extern int cgen_macro_insn_count PARAMS ((CGEN_CPU_DESC));
  
  /* Macros to access the other insn elements not recorded in CGEN_IBASE.  */
  
--- 1061,1068 ----
  
  /* Return number of instructions.  This includes any added at run-time.  */
  
! extern int cgen_insn_count (CGEN_CPU_DESC);
! extern int cgen_macro_insn_count (CGEN_CPU_DESC);
  
  /* Macros to access the other insn elements not recorded in CGEN_IBASE.  */
  
*************** typedef struct cgen_minsn_expansion {
*** 1126,1134 ****
       If the expansion fails (e.g. "no match") NULL is returned.
       Space for the expansion is obtained with malloc.
       It is up to the caller to free it.  */
!   const char * (* fn) PARAMS ((const struct cgen_minsn_expansion *,
! 			       const char *, const char **, int *,
! 			       CGEN_OPERAND **));
  #define CGEN_MIEXPN_FN(ex) ((ex)->fn)
  
    /* Instruction(s) the macro expands to.
--- 1126,1135 ----
       If the expansion fails (e.g. "no match") NULL is returned.
       Space for the expansion is obtained with malloc.
       It is up to the caller to free it.  */
!   const char * (* fn)
!      (const struct cgen_minsn_expansion *,
!       const char *, const char **, int *,
!       CGEN_OPERAND **);
  #define CGEN_MIEXPN_FN(ex) ((ex)->fn)
  
    /* Instruction(s) the macro expands to.
*************** typedef struct cgen_minsn_expansion {
*** 1146,1160 ****
     may contain further macro invocations.  */
  
  extern const char * cgen_expand_macro_insn
!      PARAMS ((CGEN_CPU_DESC, const struct cgen_minsn_expansion *,
! 	      const char *, const char **, int *, CGEN_OPERAND **));
  
  /* The assembler insn table is hashed based on some function of the mnemonic
     (the actually hashing done is up to the target, but we provide a few
     examples like the first letter or a function of the entire mnemonic).  */
  
  extern CGEN_INSN_LIST * cgen_asm_lookup_insn
!      PARAMS ((CGEN_CPU_DESC, const char *));
  #define CGEN_ASM_LOOKUP_INSN(cd, string) cgen_asm_lookup_insn ((cd), (string))
  #define CGEN_ASM_NEXT_INSN(insn) ((insn)->next)
  
--- 1147,1161 ----
     may contain further macro invocations.  */
  
  extern const char * cgen_expand_macro_insn
!   (CGEN_CPU_DESC, const struct cgen_minsn_expansion *,
!    const char *, const char **, int *, CGEN_OPERAND **);
  
  /* The assembler insn table is hashed based on some function of the mnemonic
     (the actually hashing done is up to the target, but we provide a few
     examples like the first letter or a function of the entire mnemonic).  */
  
  extern CGEN_INSN_LIST * cgen_asm_lookup_insn
!   (CGEN_CPU_DESC, const char *);
  #define CGEN_ASM_LOOKUP_INSN(cd, string) cgen_asm_lookup_insn ((cd), (string))
  #define CGEN_ASM_NEXT_INSN(insn) ((insn)->next)
  
*************** extern CGEN_INSN_LIST * cgen_asm_lookup_
*** 1162,1168 ****
     instruction (the actually hashing done is up to the target).  */
  
  extern CGEN_INSN_LIST * cgen_dis_lookup_insn
!      PARAMS ((CGEN_CPU_DESC, const char *, CGEN_INSN_INT));
  /* FIXME: delete these two */
  #define CGEN_DIS_LOOKUP_INSN(cd, buf, value) cgen_dis_lookup_insn ((cd), (buf), (value))
  #define CGEN_DIS_NEXT_INSN(insn) ((insn)->next)
--- 1163,1169 ----
     instruction (the actually hashing done is up to the target).  */
  
  extern CGEN_INSN_LIST * cgen_dis_lookup_insn
!   (CGEN_CPU_DESC, const char *, CGEN_INSN_INT);
  /* FIXME: delete these two */
  #define CGEN_DIS_LOOKUP_INSN(cd, buf, value) cgen_dis_lookup_insn ((cd), (buf), (value))
  #define CGEN_DIS_NEXT_INSN(insn) ((insn)->next)
*************** typedef struct cgen_cpu_desc
*** 1246,1270 ****
    int int_insn_p;
  
    /* Called to rebuild the tables after something has changed.  */
!   void (*rebuild_tables) PARAMS ((CGEN_CPU_DESC));
  
    /* Operand parser callback.  */
    cgen_parse_operand_fn * parse_operand_fn;
  
    /* Parse/insert/extract/print cover fns for operands.  */
    const char * (*parse_operand)
!      PARAMS ((CGEN_CPU_DESC, int opindex_, const char **,
! 	      CGEN_FIELDS *fields_));
  #ifdef __BFD_H_SEEN__
    const char * (*insert_operand)
!      PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
! 	      CGEN_INSN_BYTES_PTR, bfd_vma pc_));
    int (*extract_operand)
!      PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
! 	      CGEN_FIELDS *fields_, bfd_vma pc_));
    void (*print_operand)
!      PARAMS ((CGEN_CPU_DESC, int opindex_, PTR info_, CGEN_FIELDS * fields_,
! 	      void const *attrs_, bfd_vma pc_, int length_));
  #else
    const char * (*insert_operand) ();
    int (*extract_operand) ();
--- 1247,1270 ----
    int int_insn_p;
  
    /* Called to rebuild the tables after something has changed.  */
!   void (*rebuild_tables) (CGEN_CPU_DESC);
  
    /* Operand parser callback.  */
    cgen_parse_operand_fn * parse_operand_fn;
  
    /* Parse/insert/extract/print cover fns for operands.  */
    const char * (*parse_operand)
!     (CGEN_CPU_DESC, int opindex_, const char **, CGEN_FIELDS *fields_);
  #ifdef __BFD_H_SEEN__
    const char * (*insert_operand)
!     (CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
!      CGEN_INSN_BYTES_PTR, bfd_vma pc_);
    int (*extract_operand)
!     (CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
!      CGEN_FIELDS *fields_, bfd_vma pc_);
    void (*print_operand)
!     (CGEN_CPU_DESC, int opindex_, void * info_, CGEN_FIELDS * fields_,
!      void const *attrs_, bfd_vma pc_, int length_);
  #else
    const char * (*insert_operand) ();
    int (*extract_operand) ();
*************** typedef struct cgen_cpu_desc
*** 1280,1298 ****
  #define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields)
  
    /* Set the bitsize field.  */
!   void (*set_fields_bitsize) PARAMS ((CGEN_FIELDS *fields_, int size_));
  #define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize)
  
    /* CGEN_FIELDS accessors.  */
    int (*get_int_operand)
!        PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
    void (*set_int_operand)
!        PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_));
  #ifdef __BFD_H_SEEN__
    bfd_vma (*get_vma_operand)
!        PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
    void (*set_vma_operand)
!        PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_));
  #else
    long (*get_vma_operand) ();
    void (*set_vma_operand) ();
--- 1280,1298 ----
  #define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields)
  
    /* Set the bitsize field.  */
!   void (*set_fields_bitsize) (CGEN_FIELDS *fields_, int size_);
  #define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize)
  
    /* CGEN_FIELDS accessors.  */
    int (*get_int_operand)
!     (CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_);
    void (*set_int_operand)
!     (CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_);
  #ifdef __BFD_H_SEEN__
    bfd_vma (*get_vma_operand)
!     (CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_);
    void (*set_vma_operand)
!     (CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_);
  #else
    long (*get_vma_operand) ();
    void (*set_vma_operand) ();
*************** typedef struct cgen_cpu_desc
*** 1314,1332 ****
  #define CGEN_PRINT_FN(cd, insn)   (cd->print_handlers[(insn)->opcode->handlers.print])
  
    /* Return non-zero if insn should be added to hash table.  */
!   int (* asm_hash_p) PARAMS ((const CGEN_INSN *));
  
    /* Assembler hash function.  */
!   unsigned int (* asm_hash) PARAMS ((const char *));
  
    /* Number of entries in assembler hash table.  */
    unsigned int asm_hash_size;
  
    /* Return non-zero if insn should be added to hash table.  */
!   int (* dis_hash_p) PARAMS ((const CGEN_INSN *));
  
    /* Disassembler hash function.  */
!   unsigned int (* dis_hash) PARAMS ((const char *, CGEN_INSN_INT));
  
    /* Number of entries in disassembler hash table.  */
    unsigned int dis_hash_size;
--- 1314,1332 ----
  #define CGEN_PRINT_FN(cd, insn)   (cd->print_handlers[(insn)->opcode->handlers.print])
  
    /* Return non-zero if insn should be added to hash table.  */
!   int (* asm_hash_p) (const CGEN_INSN *);
  
    /* Assembler hash function.  */
!   unsigned int (* asm_hash) (const char *);
  
    /* Number of entries in assembler hash table.  */
    unsigned int asm_hash_size;
  
    /* Return non-zero if insn should be added to hash table.  */
!   int (* dis_hash_p) (const CGEN_INSN *);
  
    /* Disassembler hash function.  */
!   unsigned int (* dis_hash) (const char *, CGEN_INSN_INT);
  
    /* Number of entries in disassembler hash table.  */
    unsigned int dis_hash_size;
*************** extern CGEN_CPU_DESC CGEN_SYM (cpu_open)
*** 1381,1461 ****
  
  /* Cover fn to handle simple case.  */
  
! extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1) PARAMS ((const char *mach_name_,
! 						    enum cgen_endian endian_));
  
  /* Close it.  */
  
! extern void CGEN_SYM (cpu_close) PARAMS ((CGEN_CPU_DESC));
  
  /* Initialize the opcode table for use.
     Called by init_asm/init_dis.  */
  
! extern void CGEN_SYM (init_opcode_table) PARAMS ((CGEN_CPU_DESC cd_));
  
  /* build the insn selection regex.
     called by init_opcode_table */
  
! extern char * CGEN_SYM(build_insn_regex) PARAMS ((CGEN_INSN *insn_));
  
  /* Initialize the ibld table for use.
     Called by init_asm/init_dis.  */
  
! extern void CGEN_SYM (init_ibld_table) PARAMS ((CGEN_CPU_DESC cd_));
  
  /* Initialize an cpu table for assembler or disassembler use.
     These must be called immediately after cpu_open.  */
  
! extern void CGEN_SYM (init_asm) PARAMS ((CGEN_CPU_DESC));
! extern void CGEN_SYM (init_dis) PARAMS ((CGEN_CPU_DESC));
  
  /* Initialize the operand instance table for use.  */
  
! extern void CGEN_SYM (init_opinst_table) PARAMS ((CGEN_CPU_DESC cd_));
  
  /* Assemble an instruction.  */
  
  extern const CGEN_INSN * CGEN_SYM (assemble_insn)
!      PARAMS ((CGEN_CPU_DESC, const char *, CGEN_FIELDS *,
! 	      CGEN_INSN_BYTES_PTR, char **));
  
  extern const CGEN_KEYWORD CGEN_SYM (operand_mach);
! extern int CGEN_SYM (get_mach) PARAMS ((const char *));
  
  /* Operand index computation.  */
  extern const CGEN_INSN * cgen_lookup_insn
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_,
! 	      CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
! 	      int length_, CGEN_FIELDS *fields_, int alias_p_));
  extern void cgen_get_insn_operands
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_,
! 	      const CGEN_FIELDS *fields_, int *indices_));
  extern const CGEN_INSN * cgen_lookup_get_insn_operands
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
! 	      CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
! 	      int length_, int *indices_, CGEN_FIELDS *fields_));
  
  /* Cover fns to bfd_get/set.  */
  
  extern CGEN_INSN_INT cgen_get_insn_value
!      PARAMS ((CGEN_CPU_DESC, unsigned char *, int));
  extern void cgen_put_insn_value
!      PARAMS ((CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT));
  
  /* Read in a cpu description file.
     ??? For future concerns, including adding instructions to the assembler/
     disassembler at run-time.  */
  
! extern const char * cgen_read_cpu_file
!      PARAMS ((CGEN_CPU_DESC, const char * filename_));
  
  /* Allow signed overflow of instruction fields.  */
! extern void cgen_set_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
  
  /* Generate an error message if a signed field in an instruction overflows.  */
! extern void cgen_clear_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
  
  /* Will an error message be generated if a signed field in an instruction overflows ? */
! extern unsigned int cgen_signed_overflow_ok_p PARAMS ((CGEN_CPU_DESC));
  
  #endif /* CGEN_H */
--- 1381,1460 ----
  
  /* Cover fn to handle simple case.  */
  
! extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1)
!    (const char *mach_name_, enum cgen_endian endian_);
  
  /* Close it.  */
  
! extern void CGEN_SYM (cpu_close) (CGEN_CPU_DESC);
  
  /* Initialize the opcode table for use.
     Called by init_asm/init_dis.  */
  
! extern void CGEN_SYM (init_opcode_table) (CGEN_CPU_DESC cd_);
  
  /* build the insn selection regex.
     called by init_opcode_table */
  
! extern char * CGEN_SYM(build_insn_regex) (CGEN_INSN *insn_);
  
  /* Initialize the ibld table for use.
     Called by init_asm/init_dis.  */
  
! extern void CGEN_SYM (init_ibld_table) (CGEN_CPU_DESC cd_);
  
  /* Initialize an cpu table for assembler or disassembler use.
     These must be called immediately after cpu_open.  */
  
! extern void CGEN_SYM (init_asm) (CGEN_CPU_DESC);
! extern void CGEN_SYM (init_dis) (CGEN_CPU_DESC);
  
  /* Initialize the operand instance table for use.  */
  
! extern void CGEN_SYM (init_opinst_table) (CGEN_CPU_DESC cd_);
  
  /* Assemble an instruction.  */
  
  extern const CGEN_INSN * CGEN_SYM (assemble_insn)
!   (CGEN_CPU_DESC, const char *, CGEN_FIELDS *,
!    CGEN_INSN_BYTES_PTR, char **);
  
  extern const CGEN_KEYWORD CGEN_SYM (operand_mach);
! extern int CGEN_SYM (get_mach) (const char *);
  
  /* Operand index computation.  */
  extern const CGEN_INSN * cgen_lookup_insn
!   (CGEN_CPU_DESC, const CGEN_INSN * insn_,
!    CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
!    int length_, CGEN_FIELDS *fields_, int alias_p_);
  extern void cgen_get_insn_operands
!   (CGEN_CPU_DESC, const CGEN_INSN * insn_,
!    const CGEN_FIELDS *fields_, int *indices_);
  extern const CGEN_INSN * cgen_lookup_get_insn_operands
!   (CGEN_CPU_DESC, const CGEN_INSN *insn_,
!    CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
!    int length_, int *indices_, CGEN_FIELDS *fields_);
  
  /* Cover fns to bfd_get/set.  */
  
  extern CGEN_INSN_INT cgen_get_insn_value
!   (CGEN_CPU_DESC, unsigned char *, int);
  extern void cgen_put_insn_value
!   (CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT);
  
  /* Read in a cpu description file.
     ??? For future concerns, including adding instructions to the assembler/
     disassembler at run-time.  */
  
! extern const char * cgen_read_cpu_file (CGEN_CPU_DESC, const char * filename_);
  
  /* Allow signed overflow of instruction fields.  */
! extern void cgen_set_signed_overflow_ok (CGEN_CPU_DESC);
  
  /* Generate an error message if a signed field in an instruction overflows.  */
! extern void cgen_clear_signed_overflow_ok (CGEN_CPU_DESC);
  
  /* Will an error message be generated if a signed field in an instruction overflows ? */
! extern unsigned int cgen_signed_overflow_ok_p (CGEN_CPU_DESC);
  
  #endif /* CGEN_H */

*** opcodes/cgen-asm.c.~1.9.~	2002-12-19 23:54:30.000000000 -0500
--- opcodes/cgen-asm.c	2003-08-06 16:58:07.000000000 -0400
***************
*** 28,43 ****
  #include "opcode/cgen.h"
  #include "opintl.h"
  
! static CGEN_INSN_LIST *  hash_insn_array      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
! static CGEN_INSN_LIST *  hash_insn_list       PARAMS ((CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
! static void              build_asm_hash_table PARAMS ((CGEN_CPU_DESC));
  
  /* Set the cgen_parse_operand_fn callback.  */
  
  void
! cgen_set_parse_operand_fn (cd, fn)
!      CGEN_CPU_DESC cd;
!      cgen_parse_operand_fn fn;
  {
    cd->parse_operand_fn = fn;
  }
--- 28,41 ----
  #include "opcode/cgen.h"
  #include "opintl.h"
  
! static CGEN_INSN_LIST *  hash_insn_array      (CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
! static CGEN_INSN_LIST *  hash_insn_list       (CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
! static void              build_asm_hash_table (CGEN_CPU_DESC);
  
  /* Set the cgen_parse_operand_fn callback.  */
  
  void
! cgen_set_parse_operand_fn (CGEN_CPU_DESC cd, cgen_parse_operand_fn fn)
  {
    cd->parse_operand_fn = fn;
  }
*************** cgen_set_parse_operand_fn (cd, fn)
*** 45,52 ****
  /* Called whenever starting to parse an insn.  */
  
  void
! cgen_init_parse_operand (cd)
!      CGEN_CPU_DESC cd;
  {
    /* This tells the callback to re-initialize.  */
    (void) (* cd->parse_operand_fn)
--- 43,49 ----
  /* Called whenever starting to parse an insn.  */
  
  void
! cgen_init_parse_operand (CGEN_CPU_DESC cd)
  {
    /* This tells the callback to re-initialize.  */
    (void) (* cd->parse_operand_fn)
*************** cgen_init_parse_operand (cd)
*** 66,78 ****
     list and we want earlier ones to be prefered.  */
  
  static CGEN_INSN_LIST *
! hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN *insns;
!      int count;
!      int entsize ATTRIBUTE_UNUSED;
!      CGEN_INSN_LIST **htable;
!      CGEN_INSN_LIST *hentbuf;
  {
    int i;
  
--- 63,74 ----
     list and we want earlier ones to be prefered.  */
  
  static CGEN_INSN_LIST *
! hash_insn_array (CGEN_CPU_DESC cd,
! 		 const CGEN_INSN *insns,
! 		 int count,
! 		 int entsize ATTRIBUTE_UNUSED,
! 		 CGEN_INSN_LIST **htable,
! 		 CGEN_INSN_LIST *hentbuf)
  {
    int i;
  
*************** hash_insn_array (cd, insns, count, entsi
*** 97,107 ****
     in a list.  */
  
  static CGEN_INSN_LIST *
! hash_insn_list (cd, insns, htable, hentbuf)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN_LIST *insns;
!      CGEN_INSN_LIST **htable;
!      CGEN_INSN_LIST *hentbuf;
  {
    const CGEN_INSN_LIST *ilist;
  
--- 93,102 ----
     in a list.  */
  
  static CGEN_INSN_LIST *
! hash_insn_list (CGEN_CPU_DESC cd,
! 		const CGEN_INSN_LIST *insns,
! 		CGEN_INSN_LIST **htable,
! 		CGEN_INSN_LIST *hentbuf)
  {
    const CGEN_INSN_LIST *ilist;
  
*************** hash_insn_list (cd, insns, htable, hentb
*** 123,130 ****
  /* Build the assembler instruction hash table.  */
  
  static void
! build_asm_hash_table (cd)
!      CGEN_CPU_DESC cd;
  {
    int count = cgen_insn_count (cd) + cgen_macro_insn_count (cd);
    CGEN_INSN_TABLE *insn_table = &cd->insn_table;
--- 118,124 ----
  /* Build the assembler instruction hash table.  */
  
  static void
! build_asm_hash_table (CGEN_CPU_DESC cd)
  {
    int count = cgen_insn_count (cd) + cgen_macro_insn_count (cd);
    CGEN_INSN_TABLE *insn_table = &cd->insn_table;
*************** build_asm_hash_table (cd)
*** 179,187 ****
  /* Return the first entry in the hash list for INSN.  */
  
  CGEN_INSN_LIST *
! cgen_asm_lookup_insn (cd, insn)
!      CGEN_CPU_DESC cd;
!      const char *insn;
  {
    unsigned int hash;
  
--- 173,179 ----
  /* Return the first entry in the hash list for INSN.  */
  
  CGEN_INSN_LIST *
! cgen_asm_lookup_insn (CGEN_CPU_DESC cd, const char *insn)
  {
    unsigned int hash;
  
*************** cgen_asm_lookup_insn (cd, insn)
*** 201,211 ****
     recording something in the keyword table].  */
  
  const char *
! cgen_parse_keyword (cd, strp, keyword_table, valuep)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      const char **strp;
!      CGEN_KEYWORD *keyword_table;
!      long *valuep;
  {
    const CGEN_KEYWORD_ENTRY *ke;
    char buf[256];
--- 193,202 ----
     recording something in the keyword table].  */
  
  const char *
! cgen_parse_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 		    const char **strp,
! 		    CGEN_KEYWORD *keyword_table,
! 		    long *valuep)
  {
    const CGEN_KEYWORD_ENTRY *ke;
    char buf[256];
*************** cgen_parse_keyword (cd, strp, keyword_ta
*** 262,272 ****
     cgen_parse_address.  */
  
  const char *
! cgen_parse_signed_integer (cd, strp, opindex, valuep)
!      CGEN_CPU_DESC cd;
!      const char **strp;
!      int opindex;
!      long *valuep;
  {
    bfd_vma value;
    enum cgen_parse_operand_result result;
--- 253,262 ----
     cgen_parse_address.  */
  
  const char *
! cgen_parse_signed_integer (CGEN_CPU_DESC cd,
! 			   const char **strp,
! 			   int opindex,
! 			   long *valuep)
  {
    bfd_vma value;
    enum cgen_parse_operand_result result;
*************** cgen_parse_signed_integer (cd, strp, opi
*** 287,297 ****
     cgen_parse_address.  */
  
  const char *
! cgen_parse_unsigned_integer (cd, strp, opindex, valuep)
!      CGEN_CPU_DESC cd;
!      const char **strp;
!      int opindex;
!      unsigned long *valuep;
  {
    bfd_vma value;
    enum cgen_parse_operand_result result;
--- 277,286 ----
     cgen_parse_address.  */
  
  const char *
! cgen_parse_unsigned_integer (CGEN_CPU_DESC cd,
! 			     const char **strp,
! 			     int opindex,
! 			     unsigned long *valuep)
  {
    bfd_vma value;
    enum cgen_parse_operand_result result;
*************** cgen_parse_unsigned_integer (cd, strp, o
*** 309,321 ****
  /* Address parser.  */
  
  const char *
! cgen_parse_address (cd, strp, opindex, opinfo, resultp, valuep)
!      CGEN_CPU_DESC cd;
!      const char **strp;
!      int opindex;
!      int opinfo;
!      enum cgen_parse_operand_result *resultp;
!      bfd_vma *valuep;
  {
    bfd_vma value;
    enum cgen_parse_operand_result result_type;
--- 298,309 ----
  /* Address parser.  */
  
  const char *
! cgen_parse_address (CGEN_CPU_DESC cd,
! 		    const char **strp,
! 		    int opindex,
! 		    int opinfo,
! 		    enum cgen_parse_operand_result *resultp,
! 		    bfd_vma *valuep)
  {
    bfd_vma value;
    enum cgen_parse_operand_result result_type;
*************** cgen_parse_address (cd, strp, opindex, o
*** 337,344 ****
  /* Signed integer validation routine.  */
  
  const char *
! cgen_validate_signed_integer (value, min, max)
!      long value, min, max;
  {
    if (value < min || value > max)
      {
--- 325,331 ----
  /* Signed integer validation routine.  */
  
  const char *
! cgen_validate_signed_integer (long value, long min, long max)
  {
    if (value < min || value > max)
      {
*************** cgen_validate_signed_integer (value, min
*** 358,365 ****
     cases where min != 0 (and max > LONG_MAX).  */
  
  const char *
! cgen_validate_unsigned_integer (value, min, max)
!      unsigned long value, min, max;
  {
    if (value < min || value > max)
      {
--- 345,353 ----
     cases where min != 0 (and max > LONG_MAX).  */
  
  const char *
! cgen_validate_unsigned_integer (unsigned long value,
! 				unsigned long min,
! 				unsigned long max)
  {
    if (value < min || value > max)
      {

*** opcodes/cgen-opc.c.~1.11.~	2001-09-19 01:33:36.000000000 -0400
--- opcodes/cgen-opc.c	2003-08-06 17:23:00.000000000 -0400
***************
*** 33,43 ****
  #endif
  
  static unsigned int hash_keyword_name
!   PARAMS ((const CGEN_KEYWORD *, const char *, int));
  static unsigned int hash_keyword_value
!   PARAMS ((const CGEN_KEYWORD *, unsigned int));
  static void build_keyword_hash_tables
!   PARAMS ((CGEN_KEYWORD *));
  
  /* Return number of hash table entries to use for N elements.  */
  #define KEYWORD_HASH_SIZE(n) ((n) <= 31 ? 17 : 31)
--- 33,43 ----
  #endif
  
  static unsigned int hash_keyword_name
!   (const CGEN_KEYWORD *, const char *, int);
  static unsigned int hash_keyword_value
!   (const CGEN_KEYWORD *, unsigned int);
  static void build_keyword_hash_tables
!   (CGEN_KEYWORD *);
  
  /* Return number of hash table entries to use for N elements.  */
  #define KEYWORD_HASH_SIZE(n) ((n) <= 31 ? 17 : 31)
*************** static void build_keyword_hash_tables
*** 46,54 ****
     The result is the keyword entry or NULL if not found.  */
  
  const CGEN_KEYWORD_ENTRY *
! cgen_keyword_lookup_name (kt, name)
!      CGEN_KEYWORD *kt;
!      const char *name;
  {
    const CGEN_KEYWORD_ENTRY *ke;
    const char *p,*n;
--- 46,52 ----
     The result is the keyword entry or NULL if not found.  */
  
  const CGEN_KEYWORD_ENTRY *
! cgen_keyword_lookup_name (CGEN_KEYWORD *kt, const char *name)
  {
    const CGEN_KEYWORD_ENTRY *ke;
    const char *p,*n;
*************** cgen_keyword_lookup_name (kt, name)
*** 87,95 ****
     The result is the keyword entry or NULL if not found.  */
  
  const CGEN_KEYWORD_ENTRY *
! cgen_keyword_lookup_value (kt, value)
!      CGEN_KEYWORD *kt;
!      int value;
  {
    const CGEN_KEYWORD_ENTRY *ke;
  
--- 85,91 ----
     The result is the keyword entry or NULL if not found.  */
  
  const CGEN_KEYWORD_ENTRY *
! cgen_keyword_lookup_value (CGEN_KEYWORD *kt, int value)
  {
    const CGEN_KEYWORD_ENTRY *ke;
  
*************** cgen_keyword_lookup_value (kt, value)
*** 111,119 ****
  /* Add an entry to a keyword table.  */
  
  void
! cgen_keyword_add (kt, ke)
!      CGEN_KEYWORD *kt;
!      CGEN_KEYWORD_ENTRY *ke;
  {
    unsigned int hash;
    size_t i;
--- 107,113 ----
  /* Add an entry to a keyword table.  */
  
  void
! cgen_keyword_add (CGEN_KEYWORD *kt, CGEN_KEYWORD_ENTRY *ke)
  {
    unsigned int hash;
    size_t i;
*************** cgen_keyword_add (kt, ke)
*** 159,167 ****
     It is passed to each call to cgen_keyword_search_next.  */
  
  CGEN_KEYWORD_SEARCH
! cgen_keyword_search_init (kt, spec)
!      CGEN_KEYWORD *kt;
!      const char *spec;
  {
    CGEN_KEYWORD_SEARCH search;
  
--- 153,159 ----
     It is passed to each call to cgen_keyword_search_next.  */
  
  CGEN_KEYWORD_SEARCH
! cgen_keyword_search_init (CGEN_KEYWORD *kt, const char *spec)
  {
    CGEN_KEYWORD_SEARCH search;
  
*************** cgen_keyword_search_init (kt, spec)
*** 183,190 ****
     The result is the next entry or NULL if there are no more.  */
  
  const CGEN_KEYWORD_ENTRY *
! cgen_keyword_search_next (search)
!      CGEN_KEYWORD_SEARCH *search;
  {
    /* Has search finished?  */
    if (search->current_hash == search->table->hash_table_size)
--- 175,181 ----
     The result is the next entry or NULL if there are no more.  */
  
  const CGEN_KEYWORD_ENTRY *
! cgen_keyword_search_next (CGEN_KEYWORD_SEARCH *search)
  {
    /* Has search finished?  */
    if (search->current_hash == search->table->hash_table_size)
*************** cgen_keyword_search_next (search)
*** 218,227 ****
     If CASE_SENSITIVE_P is non-zero, return a case sensitive hash.  */
  
  static unsigned int
! hash_keyword_name (kt, name, case_sensitive_p)
!      const CGEN_KEYWORD *kt;
!      const char *name;
!      int case_sensitive_p;
  {
    unsigned int hash;
  
--- 209,217 ----
     If CASE_SENSITIVE_P is non-zero, return a case sensitive hash.  */
  
  static unsigned int
! hash_keyword_name (const CGEN_KEYWORD *kt,
! 		   const char *name,
! 		   int case_sensitive_p)
  {
    unsigned int hash;
  
*************** hash_keyword_name (kt, name, case_sensit
*** 237,245 ****
  /* Return first entry in hash chain for VALUE.  */
  
  static unsigned int
! hash_keyword_value (kt, value)
!      const CGEN_KEYWORD *kt;
!      unsigned int value;
  {
    return value % kt->hash_table_size;
  }
--- 227,233 ----
  /* Return first entry in hash chain for VALUE.  */
  
  static unsigned int
! hash_keyword_value (const CGEN_KEYWORD *kt, unsigned int value)
  {
    return value % kt->hash_table_size;
  }
*************** hash_keyword_value (kt, value)
*** 249,256 ****
     we're using the disassembler, but we keep things simple.  */
  
  static void
! build_keyword_hash_tables (kt)
!      CGEN_KEYWORD *kt;
  {
    int i;
    /* Use the number of compiled in entries as an estimate for the
--- 237,243 ----
     we're using the disassembler, but we keep things simple.  */
  
  static void
! build_keyword_hash_tables (CGEN_KEYWORD *kt)
  {
    int i;
    /* Use the number of compiled in entries as an estimate for the
*************** build_keyword_hash_tables (kt)
*** 278,286 ****
     mach/isa.  */
  
  const CGEN_HW_ENTRY *
! cgen_hw_lookup_by_name (cd, name)
!      CGEN_CPU_DESC cd;
!      const char *name;
  {
    unsigned int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
--- 265,271 ----
     mach/isa.  */
  
  const CGEN_HW_ENTRY *
! cgen_hw_lookup_by_name (CGEN_CPU_DESC cd, const char *name)
  {
    unsigned int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
*************** cgen_hw_lookup_by_name (cd, name)
*** 298,306 ****
     Returns NULL if HWNUM is not supported by the currently selected mach.  */
  
  const CGEN_HW_ENTRY *
! cgen_hw_lookup_by_num (cd, hwnum)
!      CGEN_CPU_DESC cd;
!      unsigned int hwnum;
  {
    unsigned int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
--- 283,289 ----
     Returns NULL if HWNUM is not supported by the currently selected mach.  */
  
  const CGEN_HW_ENTRY *
! cgen_hw_lookup_by_num (CGEN_CPU_DESC cd, unsigned int hwnum)
  {
    unsigned int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
*************** cgen_hw_lookup_by_num (cd, hwnum)
*** 320,328 ****
     mach/isa.  */
  
  const CGEN_OPERAND *
! cgen_operand_lookup_by_name (cd, name)
!      CGEN_CPU_DESC cd;
!      const char *name;
  {
    unsigned int i;
    const CGEN_OPERAND **op = cd->operand_table.entries;
--- 303,309 ----
     mach/isa.  */
  
  const CGEN_OPERAND *
! cgen_operand_lookup_by_name (CGEN_CPU_DESC cd, const char *name)
  {
    unsigned int i;
    const CGEN_OPERAND **op = cd->operand_table.entries;
*************** cgen_operand_lookup_by_name (cd, name)
*** 341,349 ****
     mach/isa.  */
  
  const CGEN_OPERAND *
! cgen_operand_lookup_by_num (cd, opnum)
!      CGEN_CPU_DESC cd;
!      int opnum;
  {
    return cd->operand_table.entries[opnum];
  }
--- 322,328 ----
     mach/isa.  */
  
  const CGEN_OPERAND *
! cgen_operand_lookup_by_num (CGEN_CPU_DESC cd, int opnum)
  {
    return cd->operand_table.entries[opnum];
  }
*************** cgen_operand_lookup_by_num (cd, opnum)
*** 353,360 ****
  /* Return number of instructions.  This includes any added at runtime.  */
  
  int
! cgen_insn_count (cd)
!      CGEN_CPU_DESC cd;
  {
    int count = cd->insn_table.num_init_entries;
    CGEN_INSN_LIST *rt_insns = cd->insn_table.new_entries;
--- 332,338 ----
  /* Return number of instructions.  This includes any added at runtime.  */
  
  int
! cgen_insn_count (CGEN_CPU_DESC cd)
  {
    int count = cd->insn_table.num_init_entries;
    CGEN_INSN_LIST *rt_insns = cd->insn_table.new_entries;
*************** cgen_insn_count (cd)
*** 369,376 ****
     This includes any added at runtime.  */
  
  int
! cgen_macro_insn_count (cd)
!      CGEN_CPU_DESC cd;
  {
    int count = cd->macro_insn_table.num_init_entries;
    CGEN_INSN_LIST *rt_insns = cd->macro_insn_table.new_entries;
--- 347,353 ----
     This includes any added at runtime.  */
  
  int
! cgen_macro_insn_count (CGEN_CPU_DESC cd)
  {
    int count = cd->macro_insn_table.num_init_entries;
    CGEN_INSN_LIST *rt_insns = cd->macro_insn_table.new_entries;
*************** cgen_macro_insn_count (cd)
*** 384,393 ****
  /* Cover function to read and properly byteswap an insn value.  */
  
  CGEN_INSN_INT
! cgen_get_insn_value (cd, buf, length)
!      CGEN_CPU_DESC cd;
!      unsigned char *buf;
!      int length;
  {
    int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
    int insn_chunk_bitsize = cd->insn_chunk_bitsize;
--- 361,367 ----
  /* Cover function to read and properly byteswap an insn value.  */
  
  CGEN_INSN_INT
! cgen_get_insn_value (CGEN_CPU_DESC cd, unsigned char *buf, int length)
  {
    int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
    int insn_chunk_bitsize = cd->insn_chunk_bitsize;
*************** cgen_get_insn_value (cd, buf, length)
*** 423,433 ****
  /* Cover function to store an insn value properly byteswapped.  */
  
  void
! cgen_put_insn_value (cd, buf, length, value)
!      CGEN_CPU_DESC cd;
!      unsigned char *buf;
!      int length;
!      CGEN_INSN_INT value;
  {
    int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
    int insn_chunk_bitsize = cd->insn_chunk_bitsize;
--- 397,406 ----
  /* Cover function to store an insn value properly byteswapped.  */
  
  void
! cgen_put_insn_value (CGEN_CPU_DESC cd,
! 		     unsigned char *buf,
! 		     int length,
! 		     CGEN_INSN_INT value)
  {
    int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
    int insn_chunk_bitsize = cd->insn_chunk_bitsize;
*************** cgen_put_insn_value (cd, buf, length, va
*** 472,487 ****
  /* ??? Will need to be revisited for VLIW architectures.  */
  
  const CGEN_INSN *
! cgen_lookup_insn (cd, insn, insn_int_value, insn_bytes_value, length, fields,
! 		  alias_p)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN *insn;
!      CGEN_INSN_INT insn_int_value;
!      /* ??? CGEN_INSN_BYTES would be a nice type name to use here.  */
!      unsigned char *insn_bytes_value;
!      int length;
!      CGEN_FIELDS *fields;
!      int alias_p;
  {
    unsigned char *buf;
    CGEN_INSN_INT base_insn;
--- 445,458 ----
  /* ??? Will need to be revisited for VLIW architectures.  */
  
  const CGEN_INSN *
! cgen_lookup_insn (CGEN_CPU_DESC cd,
! 		  const CGEN_INSN *insn,
! 		  CGEN_INSN_INT insn_int_value,
! 		  /* ??? CGEN_INSN_BYTES would be a nice type name to use here.  */
! 		  unsigned char *insn_bytes_value,
! 		  int length,
! 		  CGEN_FIELDS *fields,
! 		  int alias_p)
  {
    unsigned char *buf;
    CGEN_INSN_INT base_insn;
*************** cgen_lookup_insn (cd, insn, insn_int_val
*** 571,581 ****
     in.  */
  
  void
! cgen_get_insn_operands (cd, insn, fields, indices)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN *insn;
!      const CGEN_FIELDS *fields;
!      int *indices;
  {
    const CGEN_OPINST *opinst;
    int i;
--- 542,551 ----
     in.  */
  
  void
! cgen_get_insn_operands (CGEN_CPU_DESC cd,
! 			const CGEN_INSN *insn,
! 			const CGEN_FIELDS *fields,
! 			int *indices)
  {
    const CGEN_OPINST *opinst;
    int i;
*************** cgen_get_insn_operands (cd, insn, fields
*** 603,618 ****
     recognized.  */
  
  const CGEN_INSN *
! cgen_lookup_get_insn_operands (cd, insn, insn_int_value, insn_bytes_value,
! 			       length, indices, fields)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN *insn;
!      CGEN_INSN_INT insn_int_value;
!      /* ??? CGEN_INSN_BYTES would be a nice type name to use here.  */
!      unsigned char *insn_bytes_value;
!      int length;
!      int *indices;
!      CGEN_FIELDS *fields;
  {
    /* Pass non-zero for ALIAS_P only if INSN != NULL.
       If INSN == NULL, we want a real insn.  */
--- 573,586 ----
     recognized.  */
  
  const CGEN_INSN *
! cgen_lookup_get_insn_operands (CGEN_CPU_DESC cd,
! 			       const CGEN_INSN *insn,
! 			       CGEN_INSN_INT insn_int_value,
! 			       /* ??? CGEN_INSN_BYTES would be a nice type name to use here.  */
! 			       unsigned char *insn_bytes_value,
! 			       int length,
! 			       int *indices,
! 			       CGEN_FIELDS *fields)
  {
    /* Pass non-zero for ALIAS_P only if INSN != NULL.
       If INSN == NULL, we want a real insn.  */
*************** cgen_lookup_get_insn_operands (cd, insn,
*** 627,650 ****
  
  /* Allow signed overflow of instruction fields.  */
  void
! cgen_set_signed_overflow_ok (cd)
!      CGEN_CPU_DESC cd;
  {
    cd->signed_overflow_ok_p = 1;
  }
  
  /* Generate an error message if a signed field in an instruction overflows.  */
  void
! cgen_clear_signed_overflow_ok (cd)
!      CGEN_CPU_DESC cd;
  {
    cd->signed_overflow_ok_p = 0;
  }
  
  /* Will an error message be generated if a signed field in an instruction overflows ? */
  unsigned int
! cgen_signed_overflow_ok_p (cd)
!      CGEN_CPU_DESC cd;
  {
    return cd->signed_overflow_ok_p;
  }
--- 595,615 ----
  
  /* Allow signed overflow of instruction fields.  */
  void
! cgen_set_signed_overflow_ok (CGEN_CPU_DESC cd)
  {
    cd->signed_overflow_ok_p = 1;
  }
  
  /* Generate an error message if a signed field in an instruction overflows.  */
  void
! cgen_clear_signed_overflow_ok (CGEN_CPU_DESC cd)
  {
    cd->signed_overflow_ok_p = 0;
  }
  
  /* Will an error message be generated if a signed field in an instruction overflows ? */
  unsigned int
! cgen_signed_overflow_ok_p (CGEN_CPU_DESC cd)
  {
    return cd->signed_overflow_ok_p;
  }

*** opcodes/cgen-dis.c.~1.7.~	2002-02-10 14:03:14.000000000 -0500
--- opcodes/cgen-dis.c	2003-08-06 17:35:27.000000000 -0400
***************
*** 27,45 ****
  #include "symcat.h"
  #include "opcode/cgen.h"
  
! static CGEN_INSN_LIST *  hash_insn_array      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
! static CGEN_INSN_LIST *  hash_insn_list       PARAMS ((CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
! static void              build_dis_hash_table PARAMS ((CGEN_CPU_DESC));
! static int		 count_decodable_bits PARAMS ((const CGEN_INSN *));
! static void		 add_insn_to_hash_chain PARAMS ((CGEN_INSN_LIST *,
! 							 const CGEN_INSN *,
! 							 CGEN_INSN_LIST **,
! 							 unsigned int));
  
  /* Return the number of decodable bits in this insn.  */
  static int
! count_decodable_bits (insn)
!   const CGEN_INSN *insn;
  {
    unsigned mask = CGEN_INSN_BASE_MASK (insn);
    int bits = 0;
--- 27,44 ----
  #include "symcat.h"
  #include "opcode/cgen.h"
  
! static CGEN_INSN_LIST *  hash_insn_array        (CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
! static CGEN_INSN_LIST *  hash_insn_list         (CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
! static void              build_dis_hash_table   (CGEN_CPU_DESC);
! static int		 count_decodable_bits   (const CGEN_INSN *);
! static void		 add_insn_to_hash_chain (CGEN_INSN_LIST *,
! 						 const CGEN_INSN *,
! 						 CGEN_INSN_LIST **,
! 						 unsigned int);
  
  /* Return the number of decodable bits in this insn.  */
  static int
! count_decodable_bits (const CGEN_INSN *insn)
  {
    unsigned mask = CGEN_INSN_BASE_MASK (insn);
    int bits = 0;
*************** count_decodable_bits (insn)
*** 54,64 ****
  
  /* Add an instruction to the hash chain.  */     
  static void
! add_insn_to_hash_chain (hentbuf, insn, htable, hash)
!      CGEN_INSN_LIST *hentbuf;
!      const CGEN_INSN *insn;
!      CGEN_INSN_LIST **htable;
!      unsigned int hash;
  {
    CGEN_INSN_LIST *current_buf;
    CGEN_INSN_LIST *previous_buf;
--- 53,62 ----
  
  /* Add an instruction to the hash chain.  */     
  static void
! add_insn_to_hash_chain (CGEN_INSN_LIST *hentbuf,
! 			const CGEN_INSN *insn,
! 			CGEN_INSN_LIST **htable,
! 			unsigned int hash)
  {
    CGEN_INSN_LIST *current_buf;
    CGEN_INSN_LIST *previous_buf;
*************** add_insn_to_hash_chain (hentbuf, insn, h
*** 100,112 ****
     list and we want earlier ones to be prefered.  */
  
  static CGEN_INSN_LIST *
! hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN * insns;
!      int count;
!      int entsize ATTRIBUTE_UNUSED;
!      CGEN_INSN_LIST ** htable;
!      CGEN_INSN_LIST * hentbuf;
  {
    int big_p = CGEN_CPU_ENDIAN (cd) == CGEN_ENDIAN_BIG;
    int i;
--- 98,109 ----
     list and we want earlier ones to be prefered.  */
  
  static CGEN_INSN_LIST *
! hash_insn_array (CGEN_CPU_DESC cd,
! 		 const CGEN_INSN * insns,
! 		 int count,
! 		 int entsize ATTRIBUTE_UNUSED,
! 		 CGEN_INSN_LIST ** htable,
! 		 CGEN_INSN_LIST * hentbuf)
  {
    int big_p = CGEN_CPU_ENDIAN (cd) == CGEN_ENDIAN_BIG;
    int i;
*************** hash_insn_array (cd, insns, count, entsi
*** 141,151 ****
     in a list.  */
  
  static CGEN_INSN_LIST *
! hash_insn_list (cd, insns, htable, hentbuf)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN_LIST *insns;
!      CGEN_INSN_LIST **htable;
!      CGEN_INSN_LIST *hentbuf;
  {
    int big_p = CGEN_CPU_ENDIAN (cd) == CGEN_ENDIAN_BIG;
    const CGEN_INSN_LIST *ilist;
--- 138,147 ----
     in a list.  */
  
  static CGEN_INSN_LIST *
! hash_insn_list (CGEN_CPU_DESC cd,
! 		const CGEN_INSN_LIST *insns,
! 		CGEN_INSN_LIST **htable,
! 		CGEN_INSN_LIST *hentbuf)
  {
    int big_p = CGEN_CPU_ENDIAN (cd) == CGEN_ENDIAN_BIG;
    const CGEN_INSN_LIST *ilist;
*************** hash_insn_list (cd, insns, htable, hentb
*** 177,184 ****
  /* Build the disassembler instruction hash table.  */
  
  static void
! build_dis_hash_table (cd)
!      CGEN_CPU_DESC cd;
  {
    int count = cgen_insn_count (cd) + cgen_macro_insn_count (cd);
    CGEN_INSN_TABLE *insn_table = & cd->insn_table;
--- 173,179 ----
  /* Build the disassembler instruction hash table.  */
  
  static void
! build_dis_hash_table (CGEN_CPU_DESC cd)
  {
    int count = cgen_insn_count (cd) + cgen_macro_insn_count (cd);
    CGEN_INSN_TABLE *insn_table = & cd->insn_table;
*************** build_dis_hash_table (cd)
*** 233,242 ****
  /* Return the first entry in the hash list for INSN.  */
  
  CGEN_INSN_LIST *
! cgen_dis_lookup_insn (cd, buf, value)
!      CGEN_CPU_DESC cd;
!      const char * buf;
!      CGEN_INSN_INT value;
  {
    unsigned int hash;
  
--- 228,234 ----
  /* Return the first entry in the hash list for INSN.  */
  
  CGEN_INSN_LIST *
! cgen_dis_lookup_insn (CGEN_CPU_DESC cd, const char * buf, CGEN_INSN_INT value)
  {
    unsigned int hash;
  
*** opcodes/cgen-asm.in.~1.12.~	2003-06-10 18:08:43.000000000 -0400
--- opcodes/cgen-asm.in	2003-08-06 17:42:49.000000000 -0400
*************** along with this program; if not, write t
*** 43,49 ****
  #define max(a,b) ((a) > (b) ? (a) : (b))
  
  static const char * parse_insn_normal
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
  
  /* -- assembler routines inserted here.  */
  
--- 43,49 ----
  #define max(a,b) ((a) > (b) ? (a) : (b))
  
  static const char * parse_insn_normal
!   (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
  
  /* -- assembler routines inserted here.  */
  
*************** static const char * parse_insn_normal
*** 60,67 ****
     Returns NULL for success, an error message for failure.  */
  
  char * 
! @arch@_cgen_build_insn_regex (insn)
!      CGEN_INSN *insn;
  {  
    CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
    const char *mnem = CGEN_INSN_MNEMONIC (insn);
--- 60,66 ----
     Returns NULL for success, an error message for failure.  */
  
  char * 
! @arch@_cgen_build_insn_regex (CGEN_INSN *insn)
  {  
    CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
    const char *mnem = CGEN_INSN_MNEMONIC (insn);
*************** char * 
*** 184,194 ****
     Returns NULL for success, an error message for failure.  */
  
  static const char *
! parse_insn_normal (cd, insn, strp, fields)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN *insn;
!      const char **strp;
!      CGEN_FIELDS *fields;
  {
    /* ??? Runtime added insns not handled yet.  */
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
--- 183,192 ----
     Returns NULL for success, an error message for failure.  */
  
  static const char *
! parse_insn_normal (CGEN_CPU_DESC cd,
! 		   const CGEN_INSN *insn,
! 		   const char **strp,
! 		   CGEN_FIELDS *fields)
  {
    /* ??? Runtime added insns not handled yet.  */
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
*************** parse_insn_normal (cd, insn, strp, field
*** 326,337 ****
     mind helps keep the design clean.  */
  
  const CGEN_INSN *
! @arch@_cgen_assemble_insn (cd, str, fields, buf, errmsg)
!      CGEN_CPU_DESC cd;
!      const char *str;
!      CGEN_FIELDS *fields;
!      CGEN_INSN_BYTES_PTR buf;
!      char **errmsg;
  {
    const char *start;
    CGEN_INSN_LIST *ilist;
--- 324,334 ----
     mind helps keep the design clean.  */
  
  const CGEN_INSN *
! @arch@_cgen_assemble_insn (CGEN_CPU_DESC cd,
! 			   const char *str,
! 			   CGEN_FIELDS *fields,
! 			   CGEN_INSN_BYTES_PTR buf,
! 			   char **errmsg)
  {
    const char *start;
    CGEN_INSN_LIST *ilist;
*************** const CGEN_INSN *
*** 435,443 ****
     FIXME: Not currently used.  */
  
  void
! @arch@_cgen_asm_hash_keywords (cd, opvals)
!      CGEN_CPU_DESC cd;
!      CGEN_KEYWORD *opvals;
  {
    CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
    const CGEN_KEYWORD_ENTRY * ke;
--- 432,438 ----
     FIXME: Not currently used.  */
  
  void
! @arch@_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
  {
    CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
    const CGEN_KEYWORD_ENTRY * ke;

*** opcodes/cgen-dis.in.~1.16.~	2002-12-02 16:58:18.000000000 -0500
--- opcodes/cgen-dis.in	2003-08-06 18:27:17.000000000 -0400
*************** along with this program; if not, write t
*** 41,74 ****
  #define UNKNOWN_INSN_MSG _("*unknown*")
  
  static void print_normal
!      PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
  static void print_address
!      PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
  static void print_keyword
!      PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
  static void print_insn_normal
!      PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
! 	      bfd_vma, int));
  static int print_insn
!      PARAMS ((CGEN_CPU_DESC, bfd_vma,  disassemble_info *, char *, unsigned));
  static int default_print_insn
!      PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
  static int read_insn
!      PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
! 	      CGEN_EXTRACT_INFO *, unsigned long *));
  
  /* -- disassembler routines inserted here */
  
  /* Default print handler.  */
  
  static void
! print_normal (cd, dis_info, value, attrs, pc, length)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      PTR dis_info;
!      long value;
!      unsigned int attrs;
!      bfd_vma pc ATTRIBUTE_UNUSED;
!      int length ATTRIBUTE_UNUSED;
  {
    disassemble_info *info = (disassemble_info *) dis_info;
  
--- 41,72 ----
  #define UNKNOWN_INSN_MSG _("*unknown*")
  
  static void print_normal
!   (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
  static void print_address
!   (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
  static void print_keyword
!   (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
  static void print_insn_normal
!   (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
  static int print_insn
!   (CGEN_CPU_DESC, bfd_vma,  disassemble_info *, char *, unsigned);
  static int default_print_insn
!   (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
  static int read_insn
!   (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
!    unsigned long *);
  
  /* -- disassembler routines inserted here */
  
  /* Default print handler.  */
  
  static void
! print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 	      void *dis_info,
! 	      long value,
! 	      unsigned int attrs,
! 	      bfd_vma pc ATTRIBUTE_UNUSED,
! 	      int length ATTRIBUTE_UNUSED)
  {
    disassemble_info *info = (disassemble_info *) dis_info;
  
*************** print_normal (cd, dis_info, value, attrs
*** 88,100 ****
  /* Default address handler.  */
  
  static void
! print_address (cd, dis_info, value, attrs, pc, length)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      PTR dis_info;
!      bfd_vma value;
!      unsigned int attrs;
!      bfd_vma pc ATTRIBUTE_UNUSED;
!      int length ATTRIBUTE_UNUSED;
  {
    disassemble_info *info = (disassemble_info *) dis_info;
  
--- 86,97 ----
  /* Default address handler.  */
  
  static void
! print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 	       void *dis_info,
! 	       bfd_vma value,
! 	       unsigned int attrs,
! 	       bfd_vma pc ATTRIBUTE_UNUSED,
! 	       int length ATTRIBUTE_UNUSED)
  {
    disassemble_info *info = (disassemble_info *) dis_info;
  
*************** print_address (cd, dis_info, value, attr
*** 118,129 ****
  /* Keyword print handler.  */
  
  static void
! print_keyword (cd, dis_info, keyword_table, value, attrs)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      PTR dis_info;
!      CGEN_KEYWORD *keyword_table;
!      long value;
!      unsigned int attrs ATTRIBUTE_UNUSED;
  {
    disassemble_info *info = (disassemble_info *) dis_info;
    const CGEN_KEYWORD_ENTRY *ke;
--- 115,125 ----
  /* Keyword print handler.  */
  
  static void
! print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 	       void *dis_info,
! 	       CGEN_KEYWORD *keyword_table,
! 	       long value,
! 	       unsigned int attrs ATTRIBUTE_UNUSED)
  {
    disassemble_info *info = (disassemble_info *) dis_info;
    const CGEN_KEYWORD_ENTRY *ke;
*************** print_keyword (cd, dis_info, keyword_tab
*** 137,153 ****
  
  /* Default insn printer.
  
!    DIS_INFO is defined as `PTR' so the disassembler needn't know anything
     about disassemble_info.  */
  
  static void
! print_insn_normal (cd, dis_info, insn, fields, pc, length)
!      CGEN_CPU_DESC cd;
!      PTR dis_info;
!      const CGEN_INSN *insn;
!      CGEN_FIELDS *fields;
!      bfd_vma pc;
!      int length;
  {
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
    disassemble_info *info = (disassemble_info *) dis_info;
--- 133,148 ----
  
  /* Default insn printer.
  
!    DIS_INFO is defined as `void *' so the disassembler needn't know anything
     about disassemble_info.  */
  
  static void
! print_insn_normal (CGEN_CPU_DESC cd,
! 		   void *dis_info,
! 		   const CGEN_INSN *insn,
! 		   CGEN_FIELDS *fields,
! 		   bfd_vma pc,
! 		   int length)
  {
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
    disassemble_info *info = (disassemble_info *) dis_info;
*************** print_insn_normal (cd, dis_info, insn, f
*** 179,192 ****
     Returns 0 if all is well, non-zero otherwise.  */
  
  static int
! read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      bfd_vma pc;
!      disassemble_info *info;
!      char *buf;
!      int buflen;
!      CGEN_EXTRACT_INFO *ex_info;
!      unsigned long *insn_value;
  {
    int status = (*info->read_memory_func) (pc, buf, buflen, info);
    if (status != 0)
--- 174,186 ----
     Returns 0 if all is well, non-zero otherwise.  */
  
  static int
! read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 	   bfd_vma pc,
! 	   disassemble_info *info,
! 	   char *buf,
! 	   int buflen,
! 	   CGEN_EXTRACT_INFO *ex_info,
! 	   unsigned long *insn_value)
  {
    int status = (*info->read_memory_func) (pc, buf, buflen, info);
    if (status != 0)
*************** read_insn (cd, pc, info, buf, buflen, ex
*** 210,221 ****
     been called).  */
  
  static int
! print_insn (cd, pc, info, buf, buflen)
!      CGEN_CPU_DESC cd;
!      bfd_vma pc;
!      disassemble_info *info;
!      char *buf;
!      unsigned int buflen;
  {
    CGEN_INSN_INT insn_value;
    const CGEN_INSN_LIST *insn_list;
--- 204,214 ----
     been called).  */
  
  static int
! print_insn (CGEN_CPU_DESC cd,
! 	    bfd_vma pc,
! 	    disassemble_info *info,
! 	    char *buf,
! 	    unsigned int buflen)
  {
    CGEN_INSN_INT insn_value;
    const CGEN_INSN_LIST *insn_list;
*************** print_insn (cd, pc, info, buf, buflen)
*** 320,329 ****
  #endif
  
  static int
! default_print_insn (cd, pc, info)
!      CGEN_CPU_DESC cd;
!      bfd_vma pc;
!      disassemble_info *info;
  {
    char buf[CGEN_MAX_INSN_SIZE];
    int buflen;
--- 313,319 ----
  #endif
  
  static int
! default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
  {
    char buf[CGEN_MAX_INSN_SIZE];
    int buflen;
*************** typedef struct cpu_desc_list {
*** 362,370 ****
  } cpu_desc_list;
  
  int
! print_insn_@arch@ (pc, info)
!      bfd_vma pc;
!      disassemble_info *info;
  {
    static cpu_desc_list *cd_list = 0;
    cpu_desc_list *cl = 0;
--- 352,358 ----
  } cpu_desc_list;
  
  int
! print_insn_@arch@ (bfd_vma pc, disassemble_info *info)
  {
    static cpu_desc_list *cd_list = 0;
    cpu_desc_list *cl = 0;

*** opcodes/cgen-ibld.in.~1.14.~	2001-11-09 05:21:22.000000000 -0500
--- opcodes/cgen-ibld.in	2003-08-06 18:16:59.000000000 -0400
*************** along with this program; if not, write t
*** 44,73 ****
  #define FLD(f) (fields->f)
  
  static const char * insert_normal
!      PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
! 	      unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
  static const char * insert_insn_normal
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
! 	      CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
  static int extract_normal
!      PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
! 	      unsigned int, unsigned int, unsigned int, unsigned int,
! 	      unsigned int, unsigned int, bfd_vma, long *));
  static int extract_insn_normal
!      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
! 	      CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
  #if CGEN_INT_INSN_P
  static void put_insn_int_value
!      PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
  #endif
  #if ! CGEN_INT_INSN_P
  static CGEN_INLINE void insert_1
!      PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
  static CGEN_INLINE int fill_cache
!      PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *,  int, int, bfd_vma));
  static CGEN_INLINE long extract_1
!      PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
! 	      unsigned char *, bfd_vma));
  #endif
  
  /* Operand insertion.  */
--- 44,72 ----
  #define FLD(f) (fields->f)
  
  static const char * insert_normal
!   (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
!    unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
  static const char * insert_insn_normal
!   (CGEN_CPU_DESC, const CGEN_INSN *,
!    CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
  static int extract_normal
!   (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
!    unsigned int, unsigned int, unsigned int, unsigned int,
!    unsigned int, unsigned int, bfd_vma, long *);
  static int extract_insn_normal
!   (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
!    CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
  #if CGEN_INT_INSN_P
  static void put_insn_int_value
!   (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
  #endif
  #if ! CGEN_INT_INSN_P
  static CGEN_INLINE void insert_1
!   (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
  static CGEN_INLINE int fill_cache
!   (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *,  int, int, bfd_vma);
  static CGEN_INLINE long extract_1
!   (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
  #endif
  
  /* Operand insertion.  */
*************** static CGEN_INLINE long extract_1
*** 77,87 ****
  /* Subroutine of insert_normal.  */
  
  static CGEN_INLINE void
! insert_1 (cd, value, start, length, word_length, bufp)
!      CGEN_CPU_DESC cd;
!      unsigned long value;
!      int start,length,word_length;
!      unsigned char *bufp;
  {
    unsigned long x,mask;
    int shift;
--- 76,85 ----
  /* Subroutine of insert_normal.  */
  
  static CGEN_INLINE void
! insert_1 (CGEN_CPU_DESC cd,
! 	  unsigned long value,
! 	  int start,length,word_length,
! 	  unsigned char *bufp)
  {
    unsigned long x,mask;
    int shift;
*************** insert_1 (cd, value, start, length, word
*** 118,130 ****
     necessary.  */
  
  static const char *
! insert_normal (cd, value, attrs, word_offset, start, length, word_length,
! 	       total_length, buffer)
!      CGEN_CPU_DESC cd;
!      long value;
!      unsigned int attrs;
!      unsigned int word_offset, start, length, word_length, total_length;
!      CGEN_INSN_BYTES_PTR buffer;
  {
    static char errbuf[100];
    /* Written this way to avoid undefined behaviour.  */
--- 116,130 ----
     necessary.  */
  
  static const char *
! insert_normal (CGEN_CPU_DESC cd,
! 	       long value,
! 	       unsigned int attrs,
! 	       unsigned int word_offset,
! 	       unsigned int start,
! 	       unsigned int length,
! 	       unsigned int word_length,
! 	       unsigned int total_length,
! 	       CGEN_INSN_BYTES_PTR buffer)
  {
    static char errbuf[100];
    /* Written this way to avoid undefined behaviour.  */
*************** insert_normal (cd, value, attrs, word_of
*** 232,243 ****
     The result is an error message or NULL if success.  */
  
  static const char *
! insert_insn_normal (cd, insn, fields, buffer, pc)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN * insn;
!      CGEN_FIELDS * fields;
!      CGEN_INSN_BYTES_PTR buffer;
!      bfd_vma pc;
  {
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
    unsigned long value;
--- 232,242 ----
     The result is an error message or NULL if success.  */
  
  static const char *
! insert_insn_normal (CGEN_CPU_DESC cd,
! 		    const CGEN_INSN * insn,
! 		    CGEN_FIELDS * fields,
! 		    CGEN_INSN_BYTES_PTR buffer,
! 		    bfd_vma pc)
  {
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
    unsigned long value;
*************** insert_insn_normal (cd, insn, fields, bu
*** 288,299 ****
   because it needs <prefix>-desc.h for CGEN_INT_INSN_P.  */
  
  static void
! put_insn_int_value (cd, buf, length, insn_length, value)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      CGEN_INSN_BYTES_PTR buf;
!      int length;
!      int insn_length;
!      CGEN_INSN_INT value;
  {
    /* For architectures with insns smaller than the base-insn-bitsize,
       length may be too big.  */
--- 287,297 ----
   because it needs <prefix>-desc.h for CGEN_INT_INSN_P.  */
  
  static void
! put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 		    CGEN_INSN_BYTES_PTR buf,
! 		    int length,
! 		    int insn_length,
! 		    CGEN_INSN_INT value)
  {
    /* For architectures with insns smaller than the base-insn-bitsize,
       length may be too big.  */
*************** put_insn_int_value (cd, buf, length, ins
*** 320,330 ****
     Returns 1 for success, 0 for failure.  */
  
  static CGEN_INLINE int
! fill_cache (cd, ex_info, offset, bytes, pc)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
!      CGEN_EXTRACT_INFO *ex_info;
!      int offset, bytes;
!      bfd_vma pc;
  {
    /* It's doubtful that the middle part has already been fetched so
       we don't optimize that case.  kiss.  */
--- 318,327 ----
     Returns 1 for success, 0 for failure.  */
  
  static CGEN_INLINE int
! fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
! 	    CGEN_EXTRACT_INFO *ex_info,
! 	    int offset, bytes,
! 	    bfd_vma pc)
  {
    /* It's doubtful that the middle part has already been fetched so
       we don't optimize that case.  kiss.  */
*************** fill_cache (cd, ex_info, offset, bytes, 
*** 364,375 ****
  /* Subroutine of extract_normal.  */
  
  static CGEN_INLINE long
! extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
!      CGEN_CPU_DESC cd;
!      CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
!      int start,length,word_length;
!      unsigned char *bufp;
!      bfd_vma pc ATTRIBUTE_UNUSED;
  {
    unsigned long x;
    int shift;
--- 361,373 ----
  /* Subroutine of extract_normal.  */
  
  static CGEN_INLINE long
! extract_1 (CGEN_CPU_DESC cd,
! 	   CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
! 	   int start,
! 	   int length,
! 	   int word_length,
! 	   unsigned char *bufp,
! 	   bfd_vma pc ATTRIBUTE_UNUSED)
  {
    unsigned long x;
    int shift;
*************** extract_1 (cd, ex_info, start, length, w
*** 408,430 ****
     necessary.  */
  
  static int
! extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
! 		word_length, total_length, pc, valuep)
!      CGEN_CPU_DESC cd;
  #if ! CGEN_INT_INSN_P
!      CGEN_EXTRACT_INFO *ex_info;
  #else
!      CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
  #endif
!      CGEN_INSN_INT insn_value;
!      unsigned int attrs;
!      unsigned int word_offset, start, length, word_length, total_length;
  #if ! CGEN_INT_INSN_P
!      bfd_vma pc;
  #else
!      bfd_vma pc ATTRIBUTE_UNUSED;
  #endif
!      long *valuep;
  {
    long value, mask;
  
--- 406,430 ----
     necessary.  */
  
  static int
! extract_normal (CGEN_CPU_DESC cd;
  #if ! CGEN_INT_INSN_P
! 		CGEN_EXTRACT_INFO *ex_info,
  #else
! 		CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
  #endif
! 		CGEN_INSN_INT insn_value,
! 		unsigned int attrs,
! 		unsigned int word_offset,
! 		unsigned int start,
! 		unsigned int length,
! 		unsigned int word_length,
! 		unsigned int total_length,
  #if ! CGEN_INT_INSN_P
! 		bfd_vma pc,
  #else
! 		bfd_vma pc ATTRIBUTE_UNUSED,
  #endif
! 		long *valuep)
  {
    long value, mask;
  
*************** extract_normal (cd, ex_info, insn_value,
*** 505,517 ****
     been called).  */
  
  static int
! extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
!      CGEN_CPU_DESC cd;
!      const CGEN_INSN *insn;
!      CGEN_EXTRACT_INFO *ex_info;
!      CGEN_INSN_INT insn_value;
!      CGEN_FIELDS *fields;
!      bfd_vma pc;
  {
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
    const CGEN_SYNTAX_CHAR_TYPE *syn;
--- 505,516 ----
     been called).  */
  
  static int
! extract_insn_normal (CGEN_CPU_DESC cd,
! 		     const CGEN_INSN *insn,
! 		     CGEN_EXTRACT_INFO *ex_info,
! 		     CGEN_INSN_INT insn_value,
! 		     CGEN_FIELDS *fields,
! 		     bfd_vma pc)
  {
    const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
    const CGEN_SYNTAX_CHAR_TYPE *syn;

-- 
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org


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