This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN 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]

Prototype all functions in opcodes/cgen-asm.c


Here are the prototype patches for opcodes/cgen-asm.c.  I checked it by
building the m32r, and rerunning the assembler make check option.

As before, I don't yet have the paperwork on file, so this is for reference and
for comments.

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

	* cgen-asm.c (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.

*** 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)
      {


-- 
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]