This is the mail archive of the binutils@sourceware.cygnus.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]

patches for IA-64 disassembler


These patches fix a number of errors with the IA-64 disassembler.


Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/opcodes/ChangeLog,v
retrieving revision 1.116
diff -d -c -p -b -w -r1.116 ChangeLog
*** ChangeLog	2000/04/21 22:04:29	1.116
--- ChangeLog	2000/04/23 02:38:28
***************
*** 1,3 ****
--- 1,20 ----
+ 2000-04-22  Timothy Wall  <twall@cygnus.com>
+ 
+ 	* ia64-gen.c (general): Add an ordered table of primary
+ 	opcode names, as well as priority fields to disassembly data
+ 	structures to enforce a preferred disassembly format based on the
+ 	ordering of the opcode tables.
+ 	(load_insn_classes): Show a useful message if IC tables are missing.
+ 	(load_depfile): Ditto.
+ 	* ia64-asmtab.h (struct ia64_dis_names ): Add priority flag to
+ 	distinguish preferred disassembly.
+ 	* ia64-opc-f.c: Reorder some insn for preferred disassembly
+ 	format.  Fix incorrect flag on fma.s/fma.s.s0.
+ 	* ia64-opc.c: Scan *all* disassembly matches and use the one with
+ 	the highest priority.
+ 	* ia64-opc-b.c: Use more abbreviations.
+ 	* ia64-asmtab.c: Regenerate.
+ 	
  Fri Apr 21 16:03:39 2000  Jason Eckhardt  <jle@cygnus.com>
  
  	* hppa-dis.c (extract_16): New function.
Index: ia64-gen.c
===================================================================
RCS file: /cvs/src/src/opcodes/ia64-gen.c,v
retrieving revision 1.1
diff -d -c -p -b -w -r1.1 ia64-gen.c
*** ia64-gen.c	2000/04/21 20:22:23	1.1
--- ia64-gen.c	2000/04/23 02:38:28
*************** struct main_entry
*** 68,74 ****
    struct completer_entry *completers;
    /* Next entry in the chain. */
    struct main_entry *next;
! } *maintable;
  
  /* The set of possible completers for an opcode. */
  struct completer_entry
--- 68,79 ----
    struct completer_entry *completers;
    /* Next entry in the chain. */
    struct main_entry *next;
!   /* Index in the  main table. */
!   int main_index;
! } *maintable, **ordered_table;
! int otlen = 0;
! int ottotlen = 0;
! int opcode_count = 0;
  
  /* The set of possible completers for an opcode. */
  struct completer_entry
*************** struct completer_entry
*** 104,111 ****
       list).  This field is filled in by compute_completer_bits (). */
    ia64_insn mask;
  
!   /* Index into the opcode dependency list, or -1 if none */
    int dependencies;
  };
  
  /* One entry in the disassembler name table. */
--- 109,119 ----
       list).  This field is filled in by compute_completer_bits (). */
    ia64_insn mask;
  
!   /* Index into the opcode dependency list, or -1 if none. */
    int dependencies;
+ 
+   /* Remember the order encountered in the opcode tables.  */
+   int order;
  };
  
  /* One entry in the disassembler name table. */
*************** struct disent
*** 117,122 ****
--- 125,133 ----
    /* The index into the main_table[] array. */
    int insn;
  
+   /* The disassmbly priority of this entry. */
+   int priority;
+ 
    /* The completer_index value for this entry. */
    int completer_index;
  
*************** struct disent
*** 135,141 ****
  struct bittree
  {
    struct disent *disent;
!   struct bittree *bits[3];
    int bits_to_skip;
    int skip_flag;
  } *bittree;
--- 146,152 ----
  struct bittree
  {
    struct disent *disent;
!   struct bittree *bits[3]; /* 0, 1, and X (don't care) */
    int bits_to_skip;
    int skip_flag;
  } *bittree;
*************** load_insn_classes()
*** 502,507 ****
--- 513,523 ----
    FILE *fp = fopen("ia64-ic.tbl", "r");
    char buf[2048];
  
+   if (fp == NULL){
+     fprintf (stderr, "Can't find ia64-ic.tbl for reading\n");
+     exit(1);
+   }
+ 
    /* discard first line */
    fgets (buf, sizeof(buf), fp);
  
*************** load_depfile (const char *filename, enum
*** 707,712 ****
--- 723,733 ----
    FILE *fp = fopen(filename, "r");
    char buf[1024];
  
+   if (fp == NULL){
+     fprintf (stderr, "Can't find %s for reading\n", filename);
+     exit(1);
+   }
+ 
    fgets(buf, sizeof(buf), fp);
    while (!feof(fp))
      {
*************** make_bittree_entry ()
*** 1577,1585 ****
  }
  
  struct disent *
! add_dis_table_ent (which, insn, completer_index)
       struct disent *which;
       int insn;
       int completer_index;
  {
    int ci = 0;
--- 1598,1607 ----
  }
  
  struct disent *
! add_dis_table_ent (which, insn, order, completer_index)
       struct disent *which;
       int insn;
+      int order;
       int completer_index;
  {
    int ci = 0;
*************** add_dis_table_ent (which, insn, complete
*** 1606,1611 ****
--- 1628,1635 ----
    ent->nextcnt = 0;
    ent->nexte = NULL;
    ent->insn = insn;
+   ent->priority = order;
+ 
    while (completer_index != 1)
      {
        ci = (ci << 1) | (completer_index & 1);
*************** finish_distable ()
*** 1630,1641 ****
  }
  
  void
! insert_bit_table_ent (curr_ent, bit, opcode, mask, opcodenum, completer_index)
       struct bittree *curr_ent;
       int bit;
       ia64_insn opcode; 
       ia64_insn mask;
       int opcodenum;
       int completer_index;
  {
    ia64_insn m;
--- 1654,1667 ----
  }
  
  void
! insert_bit_table_ent (curr_ent, bit, opcode, mask, 
!                       opcodenum, order, completer_index)
       struct bittree *curr_ent;
       int bit;
       ia64_insn opcode; 
       ia64_insn mask;
       int opcodenum;
+      int order;
       int completer_index;
  {
    ia64_insn m;
*************** insert_bit_table_ent (curr_ent, bit, opc
*** 1644,1650 ****
  
    if (bit == -1)
      {
!       struct disent *nent = add_dis_table_ent (curr_ent->disent, opcodenum,
  					       completer_index);
        curr_ent->disent = nent;
        return;
--- 1670,1677 ----
  
    if (bit == -1)
      {
!       struct disent *nent = add_dis_table_ent (curr_ent->disent, 
!                                                opcodenum, order,
  					       completer_index);
        curr_ent->disent = nent;
        return;
*************** insert_bit_table_ent (curr_ent, bit, opc
*** 1666,1678 ****
        next = make_bittree_entry ();
        curr_ent->bits[b] = next;
      }
!   insert_bit_table_ent (next, bit - 1, opcode, mask, opcodenum,
  			completer_index);
  }
  
  void
  add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
!      int first;
       ia64_insn opcode;
       ia64_insn mask;
       int opcodenum;
--- 1693,1705 ----
        next = make_bittree_entry ();
        curr_ent->bits[b] = next;
      }
!   insert_bit_table_ent (next, bit - 1, opcode, mask, opcodenum, order,
  			completer_index);
  }
  
  void
  add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
!      struct bittree *first;
       ia64_insn opcode;
       ia64_insn mask;
       int opcodenum;
*************** add_dis_entry (first, opcode, mask, opco
*** 1690,1696 ****
  		     (completer_index << 1) | 1);
        if (ent->is_terminal)
  	{
! 	  insert_bit_table_ent (bittree, 40, newopcode, mask, opcodenum, 
  				(completer_index << 1) | 1);
  	}
        completer_index <<= 1;
--- 1717,1724 ----
  		     (completer_index << 1) | 1);
        if (ent->is_terminal)
  	{
! 	  insert_bit_table_ent (bittree, 40, newopcode, mask, 
!                                 opcodenum, opcode_count - ent->order - 1, 
  				(completer_index << 1) | 1);
  	}
        completer_index <<= 1;
*************** print_dis_table ()
*** 2035,2043 ****
  
        while (ent != NULL)
  	{
! 	  printf ("{ 0x%x, %d, %d },\n", ent->completer_index,
! 		  ent->insn,
! 		  (ent->nexte != NULL ? 1 : 0));
  	  ent = ent->nexte;
  	}
        cent = cent->next_ent;
--- 2063,2071 ----
  
        while (ent != NULL)
  	{
! 	  printf ("{ 0x%x, %d, %d, %d },\n", ent->completer_index,
! 		  ent->insn, (ent->nexte != NULL ? 1 : 0),
!                   ent->priority);
  	  ent = ent->nexte;
  	}
        cent = cent->next_ent;
*************** print_dis_table ()
*** 2048,2068 ****
  void
  generate_disassembler ()
  {
!   int mainnum = 0;
!   struct main_entry *ptr = maintable;
  
    bittree = make_bittree_entry ();
  
!   while (ptr != NULL)
      {
        if (ptr->opcode->type != IA64_TYPE_DYN)
  	{
  	  add_dis_entry (bittree,
! 			 ptr->opcode->opcode, ptr->opcode->mask, mainnum,
  			 ptr->completers, 1);
  	}
-       mainnum++;
-       ptr = ptr->next;
      }
  
    compact_distree (bittree);
--- 2076,2096 ----
  void
  generate_disassembler ()
  {
!   int i;
  
    bittree = make_bittree_entry ();
  
!   for (i=0; i < otlen;i++)
      {
+       struct main_entry *ptr = ordered_table[i];
+ 
        if (ptr->opcode->type != IA64_TYPE_DYN)
  	{
  	  add_dis_entry (bittree,
! 			 ptr->opcode->opcode, ptr->opcode->mask, 
!                          ptr->main_index,
  			 ptr->completers, 1);
  	}
      }
  
    compact_distree (bittree);
*************** completer_entries_eq (ent1, ent2)
*** 2123,2129 ****
  	  || ent1->bits != ent2->bits
  	  || ent1->mask != ent2->mask
  	  || ent1->is_terminal != ent2->is_terminal
!           || ent1->dependencies != ent2->dependencies)
  	{
  	  return 0;
  	}
--- 2151,2158 ----
  	  || ent1->bits != ent2->bits
  	  || ent1->mask != ent2->mask
  	  || ent1->is_terminal != ent2->is_terminal
!           || ent1->dependencies != ent2->dependencies
!           || ent1->order != ent2->order)
  	{
  	  return 0;
  	}
*************** insert_opcode_dependencies (opc, cmp)
*** 2448,2456 ****
  }
  
  void
! insert_completer_entry (opc, tabent)
       struct ia64_opcode *opc;
       struct main_entry *tabent;
  {
    struct completer_entry **ptr = &tabent->completers;
    struct completer_entry *parent = NULL;
--- 2477,2486 ----
  }
  
  void
! insert_completer_entry (opc, tabent, order)
       struct ia64_opcode *opc;
       struct main_entry *tabent;
+      int order;
  {
    struct completer_entry **ptr = &tabent->completers;
    struct completer_entry *parent = NULL;
*************** insert_completer_entry (opc, tabent)
*** 2487,2496 ****
  	      need_new_ent = 0;
  	      break;
  	    }
- 	  else if (cmpres < 0)
- 	    {
- 	      break;
- 	    }
  	  else
  	    {
  	      ptr = &((*ptr)->alternative);
--- 2517,2522 ----
*************** insert_completer_entry (opc, tabent)
*** 2526,2531 ****
--- 2552,2558 ----
    (*ptr)->bits = opc->opcode;
  
    (*ptr)->dependencies = insert_opcode_dependencies (opc, *ptr);
+   (*ptr)->order = order;
  }
  
  void
*************** add_opcode_entry (opc)
*** 2622,2628 ****
    name = insert_string (prefix);
  
    /* Walk the list of opcode table entries.  If it's a new
!      instruction, allocate and fill in a new entry.  */
  
    while (*place != NULL)
      {
--- 2649,2656 ----
    name = insert_string (prefix);
  
    /* Walk the list of opcode table entries.  If it's a new
!      instruction, allocate and fill in a new entry.  Note 
!      the main table is alphabetical by opcode name. */
  
    while (*place != NULL)
      {
*************** add_opcode_entry (opc)
*** 2647,2660 ****
        nent->next = *place;
        nent->completers = 0;
        *place = nent;
      }
!   insert_completer_entry (opc, *place);
  }
  
  void
  print_main_table ()
  {
    struct main_entry *ptr = maintable;
  
    printf ("static const struct ia64_main_table\nmain_table[] = {\n");
    while (ptr != NULL)
--- 2675,2697 ----
        nent->next = *place;
        nent->completers = 0;
        *place = nent;
+ 
+       if (otlen == ottotlen)
+         {
+           ottotlen += 20;
+           ordered_table = (struct main_entry **)
+             xrealloc (ordered_table, sizeof (struct main_entry *) * ottotlen);
          }
!       ordered_table[otlen++] = nent;
      }
+   insert_completer_entry (opc, *place, opcode_count++);
+ }
  
  void
  print_main_table ()
  {
    struct main_entry *ptr = maintable;
+   int index = 0;
  
    printf ("static const struct ia64_main_table\nmain_table[] = {\n");
    while (ptr != NULL)
*************** print_main_table ()
*** 2672,2677 ****
--- 2709,2716 ----
  	      ptr->opcode->operands[4],
  	      ptr->opcode->flags,
  	      ptr->completers->num);
+ 
+       ptr->main_index = index++;
  
        ptr = ptr->next;
      }
Index: ia64-asmtab.h
===================================================================
RCS file: /cvs/src/src/opcodes/ia64-asmtab.h,v
retrieving revision 1.1
diff -d -c -p -b -w -r1.1 ia64-asmtab.h
*** ia64-asmtab.h	2000/04/21 20:22:23	1.1
--- ia64-asmtab.h	2000/04/23 02:38:28
*************** struct ia64_dis_names 
*** 140,145 ****
--- 140,148 ----
       for this instruction encoding.  Which one to use is determined by
       the instruction type and other factors (see opcode_verify ()).  */
    unsigned int next_flag : 1;
+ 
+   /* The disassembly priority of this entry among instructions. */
+   unsigned short priority;
  };
  
  #endif
Index: ia64-opc-f.c
===================================================================
RCS file: /cvs/src/src/opcodes/ia64-opc-f.c,v
retrieving revision 1.1
diff -d -c -p -b -w -r1.1 ia64-opc-f.c
*** ia64-opc-f.c	2000/04/21 20:22:23	1.1
--- ia64-opc-f.c	2000/04/23 02:38:28
*************** struct ia64_opcode ia64_opcodes_f[] =
*** 113,121 ****
  
      {"mov",		f, OpXbX6 (0, 0, 0x10), {F1, F3}, PSEUDO | F2_EQ_F3},
      {"fabs",		f, OpXbX6F2 (0, 0, 0x10, 0), {F1, F3}, PSEUDO},
-     {"fmerge.s",	f, OpXbX6   (0, 0, 0x10), {F1, F2, F3}},
      {"fneg",		f, OpXbX6   (0, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3},
      {"fnegabs",		f, OpXbX6F2 (0, 0, 0x11, 0), {F1, F3}, PSEUDO},
      {"fmerge.ns",	f, OpXbX6   (0, 0, 0x11), {F1, F2, F3}},
  
      {"fmerge.se",	f, OpXbX6 (0, 0, 0x12), {F1, F2, F3}},
--- 113,121 ----
  
      {"mov",		f, OpXbX6 (0, 0, 0x10), {F1, F3}, PSEUDO | F2_EQ_F3},
      {"fabs",		f, OpXbX6F2 (0, 0, 0x10, 0), {F1, F3}, PSEUDO},
      {"fneg",		f, OpXbX6   (0, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3},
      {"fnegabs",		f, OpXbX6F2 (0, 0, 0x11, 0), {F1, F3}, PSEUDO},
+     {"fmerge.s",	f, OpXbX6   (0, 0, 0x10), {F1, F2, F3}},
      {"fmerge.ns",	f, OpXbX6   (0, 0, 0x11), {F1, F2, F3}},
  
      {"fmerge.se",	f, OpXbX6 (0, 0, 0x12), {F1, F2, F3}},
*************** struct ia64_opcode ia64_opcodes_f[] =
*** 249,257 ****
      {"fpcmp.ord.s3",	f, OpXbX6Sf (1, 0, 0x37, 3), {F1, F2, F3}},
  
      {"fpabs",		f, OpXbX6F2 (1, 0, 0x10, 0), {F1, F3}, PSEUDO},
-     {"fpmerge.s",	f, OpXbX6   (1, 0, 0x10), {F1, F2, F3}},
      {"fpneg",		f, OpXbX6   (1, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3},
      {"fpnegabs",	f, OpXbX6F2 (1, 0, 0x11, 0), {F1, F3}, PSEUDO},
      {"fpmerge.ns",	f, OpXbX6   (1, 0, 0x11), {F1, F2, F3}},
      {"fpmerge.se",	f, OpXbX6 (1, 0, 0x12), {F1, F2, F3}},
  
--- 249,257 ----
      {"fpcmp.ord.s3",	f, OpXbX6Sf (1, 0, 0x37, 3), {F1, F2, F3}},
  
      {"fpabs",		f, OpXbX6F2 (1, 0, 0x10, 0), {F1, F3}, PSEUDO},
      {"fpneg",		f, OpXbX6   (1, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3},
      {"fpnegabs",	f, OpXbX6F2 (1, 0, 0x11, 0), {F1, F3}, PSEUDO},
+     {"fpmerge.s",	f, OpXbX6   (1, 0, 0x10), {F1, F2, F3}},
      {"fpmerge.ns",	f, OpXbX6   (1, 0, 0x11), {F1, F2, F3}},
      {"fpmerge.se",	f, OpXbX6 (1, 0, 0x12), {F1, F2, F3}},
  
*************** struct ia64_opcode ia64_opcodes_f[] =
*** 450,457 ****
      {"fma.s1",		f, OpXaSf (0x8, 0, 1), {F1, F3, F4, F2}},
      {"fma.s2",		f, OpXaSf (0x8, 0, 2), {F1, F3, F4, F2}},
      {"fma.s3",		f, OpXaSf (0x8, 0, 3), {F1, F3, F4, F2}},
!     {"fma.s.s0",	f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}, PSEUDO},
!     {"fma.s",		f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}},
      {"fma.s.s1",	f, OpXaSf (0x8, 1, 1), {F1, F3, F4, F2}},
      {"fma.s.s2",	f, OpXaSf (0x8, 1, 2), {F1, F3, F4, F2}},
      {"fma.s.s3",	f, OpXaSf (0x8, 1, 3), {F1, F3, F4, F2}},
--- 450,457 ----
      {"fma.s1",		f, OpXaSf (0x8, 0, 1), {F1, F3, F4, F2}},
      {"fma.s2",		f, OpXaSf (0x8, 0, 2), {F1, F3, F4, F2}},
      {"fma.s3",		f, OpXaSf (0x8, 0, 3), {F1, F3, F4, F2}},
!     {"fma.s.s0",	f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}},
!     {"fma.s",		f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}, PSEUDO},
      {"fma.s.s1",	f, OpXaSf (0x8, 1, 1), {F1, F3, F4, F2}},
      {"fma.s.s2",	f, OpXaSf (0x8, 1, 2), {F1, F3, F4, F2}},
      {"fma.s.s3",	f, OpXaSf (0x8, 1, 3), {F1, F3, F4, F2}},
*************** struct ia64_opcode ia64_opcodes_f[] =
*** 529,534 ****
--- 529,540 ----
      {"fpms.s1",		f, OpXaSf (0xb, 1, 1), {F1, F3, F4, F2}},
      {"fpms.s2",		f, OpXaSf (0xb, 1, 2), {F1, F3, F4, F2}},
      {"fpms.s3",		f, OpXaSf (0xb, 1, 3), {F1, F3, F4, F2}},
+ 
+     {"fpsub.s0",        f, OpXaSfF4 (0xb, 1, 0, 1), {F1, F3, F2}, PSEUDO},
+     {"fpsub",		f, OpXaSfF4 (0xb, 1, 0, 1), {F1, F3, F2}, PSEUDO},
+     {"fpsub.s1",	f, OpXaSfF4 (0xb, 1, 1, 1), {F1, F3, F2}, PSEUDO},
+     {"fpsub.s2",	f, OpXaSfF4 (0xb, 1, 2, 1), {F1, F3, F2}, PSEUDO},
+     {"fpsub.s3",	f, OpXaSfF4 (0xb, 1, 3, 1), {F1, F3, F2}, PSEUDO},
  
      {"fnmpy.s0",	f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO},
      {"fnmpy",		f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO},
Index: ia64-opc-b.c
===================================================================
RCS file: /cvs/src/src/opcodes/ia64-opc-b.c,v
retrieving revision 1.1
diff -d -c -p -b -w -r1.1 ia64-opc-b.c
*** ia64-opc-b.c	2000/04/21 20:22:23	1.1
--- ia64-opc-b.c	2000/04/23 02:38:28
*************** struct ia64_opcode ia64_opcodes_b[] =
*** 237,290 ****
      {"br.many.clr",	BR (1, 1)},
  #undef BR
  
!     {"br.cond.sptk.few",	B0, OpBtypePaWhaD (4, 0, 0, 0, 0), {TGT25c}},
!     {"br.cond.sptk",		B0, OpBtypePaWhaD (4, 0, 0, 0, 0), {TGT25c}, PSEUDO},
!     {"br.cond.sptk.few.clr",	B0, OpBtypePaWhaD (4, 0, 0, 0, 1), {TGT25c}},
!     {"br.cond.sptk.clr",	B0, OpBtypePaWhaD (4, 0, 0, 0, 1), {TGT25c}, PSEUDO},
!     {"br.cond.spnt.few",	B0, OpBtypePaWhaD (4, 0, 0, 1, 0), {TGT25c}},
!     {"br.cond.spnt",		B0, OpBtypePaWhaD (4, 0, 0, 1, 0), {TGT25c}, PSEUDO},
!     {"br.cond.spnt.few.clr",	B0, OpBtypePaWhaD (4, 0, 0, 1, 1), {TGT25c}},
!     {"br.cond.spnt.clr",	B0, OpBtypePaWhaD (4, 0, 0, 1, 1), {TGT25c}, PSEUDO},
!     {"br.cond.dptk.few",	B0, OpBtypePaWhaD (4, 0, 0, 2, 0), {TGT25c}},
!     {"br.cond.dptk",		B0, OpBtypePaWhaD (4, 0, 0, 2, 0), {TGT25c}, PSEUDO},
!     {"br.cond.dptk.few.clr",	B0, OpBtypePaWhaD (4, 0, 0, 2, 1), {TGT25c}},
!     {"br.cond.dptk.clr",	B0, OpBtypePaWhaD (4, 0, 0, 2, 1), {TGT25c}, PSEUDO},
!     {"br.cond.dpnt.few",	B0, OpBtypePaWhaD (4, 0, 0, 3, 0), {TGT25c}},
!     {"br.cond.dpnt",		B0, OpBtypePaWhaD (4, 0, 0, 3, 0), {TGT25c}, PSEUDO},
!     {"br.cond.dpnt.few.clr",	B0, OpBtypePaWhaD (4, 0, 0, 3, 1), {TGT25c}},
!     {"br.cond.dpnt.clr",	B0, OpBtypePaWhaD (4, 0, 0, 3, 1), {TGT25c}, PSEUDO},
!     {"br.cond.sptk.many",	B0, OpBtypePaWhaD (4, 0, 1, 0, 0), {TGT25c}},
!     {"br.cond.sptk.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 0, 1), {TGT25c}},
!     {"br.cond.spnt.many",	B0, OpBtypePaWhaD (4, 0, 1, 1, 0), {TGT25c}},
!     {"br.cond.spnt.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 1, 1), {TGT25c}},
!     {"br.cond.dptk.many",	B0, OpBtypePaWhaD (4, 0, 1, 2, 0), {TGT25c}},
!     {"br.cond.dptk.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 2, 1), {TGT25c}},
!     {"br.cond.dpnt.many",	B0, OpBtypePaWhaD (4, 0, 1, 3, 0), {TGT25c}},
!     {"br.cond.dpnt.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 3, 1), {TGT25c}},
!     {"br.sptk.few",		B0, OpBtypePaWhaD (4, 0, 0, 0, 0), {TGT25c}},
!     {"br.sptk",			B0, OpBtypePaWhaD (4, 0, 0, 0, 0), {TGT25c}, PSEUDO},
!     {"br.sptk.few.clr",		B0, OpBtypePaWhaD (4, 0, 0, 0, 1), {TGT25c}},
!     {"br.sptk.clr",		B0, OpBtypePaWhaD (4, 0, 0, 0, 1), {TGT25c}, PSEUDO},
!     {"br.spnt.few",		B0, OpBtypePaWhaD (4, 0, 0, 1, 0), {TGT25c}},
!     {"br.spnt",			B0, OpBtypePaWhaD (4, 0, 0, 1, 0), {TGT25c}, PSEUDO},
!     {"br.spnt.few.clr",		B0, OpBtypePaWhaD (4, 0, 0, 1, 1), {TGT25c}},
!     {"br.spnt.clr",		B0, OpBtypePaWhaD (4, 0, 0, 1, 1), {TGT25c}, PSEUDO},
!     {"br.dptk.few",		B0, OpBtypePaWhaD (4, 0, 0, 2, 0), {TGT25c}},
!     {"br.dptk",			B0, OpBtypePaWhaD (4, 0, 0, 2, 0), {TGT25c}, PSEUDO},
!     {"br.dptk.few.clr",		B0, OpBtypePaWhaD (4, 0, 0, 2, 1), {TGT25c}},
!     {"br.dptk.clr",		B0, OpBtypePaWhaD (4, 0, 0, 2, 1), {TGT25c}, PSEUDO},
!     {"br.dpnt.few",		B0, OpBtypePaWhaD (4, 0, 0, 3, 0), {TGT25c}},
!     {"br.dpnt",			B0, OpBtypePaWhaD (4, 0, 0, 3, 0), {TGT25c}, PSEUDO},
!     {"br.dpnt.few.clr",		B0, OpBtypePaWhaD (4, 0, 0, 3, 1), {TGT25c}},
!     {"br.dpnt.clr",		B0, OpBtypePaWhaD (4, 0, 0, 3, 1), {TGT25c}, PSEUDO},
!     {"br.sptk.many",		B0, OpBtypePaWhaD (4, 0, 1, 0, 0), {TGT25c}},
!     {"br.sptk.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 0, 1), {TGT25c}},
!     {"br.spnt.many",		B0, OpBtypePaWhaD (4, 0, 1, 1, 0), {TGT25c}},
!     {"br.spnt.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 1, 1), {TGT25c}},
!     {"br.dptk.many",		B0, OpBtypePaWhaD (4, 0, 1, 2, 0), {TGT25c}},
!     {"br.dptk.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 2, 1), {TGT25c}},
!     {"br.dpnt.many",		B0, OpBtypePaWhaD (4, 0, 1, 3, 0), {TGT25c}},
!     {"br.dpnt.many.clr",	B0, OpBtypePaWhaD (4, 0, 1, 3, 1), {TGT25c}},
  
  #define BR(a,b,c,d) \
  	B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2
--- 237,293 ----
      {"br.many.clr",	BR (1, 1)},
  #undef BR
  
! #define BR(a,b,c) \
!       B0, OpBtypePaWhaD (4, 0, a, b, c), {TGT25c}
!     {"br.cond.sptk.few",	BR (0, 0, 0)},
!     {"br.cond.sptk",		BR (0, 0, 0), PSEUDO},
!     {"br.cond.sptk.few.clr",	BR (0, 0, 1)},
!     {"br.cond.sptk.clr",	BR (0, 0, 1), PSEUDO},
!     {"br.cond.spnt.few",	BR (0, 1, 0)},
!     {"br.cond.spnt",		BR (0, 1, 0), PSEUDO},
!     {"br.cond.spnt.few.clr",	BR (0, 1, 1)},
!     {"br.cond.spnt.clr",	BR (0, 1, 1), PSEUDO},
!     {"br.cond.dptk.few",	BR (0, 2, 0)},
!     {"br.cond.dptk",		BR (0, 2, 0), PSEUDO},
!     {"br.cond.dptk.few.clr",	BR (0, 2, 1)},
!     {"br.cond.dptk.clr",	BR (0, 2, 1), PSEUDO},
!     {"br.cond.dpnt.few",	BR (0, 3, 0)},
!     {"br.cond.dpnt",		BR (0, 3, 0), PSEUDO},
!     {"br.cond.dpnt.few.clr",	BR (0, 3, 1)},
!     {"br.cond.dpnt.clr",	BR (0, 3, 1), PSEUDO},
!     {"br.cond.sptk.many",	BR (1, 0, 0)},
!     {"br.cond.sptk.many.clr",	BR (1, 0, 1)},
!     {"br.cond.spnt.many",	BR (1, 1, 0)},
!     {"br.cond.spnt.many.clr",	BR (1, 1, 1)},
!     {"br.cond.dptk.many",	BR (1, 2, 0)},
!     {"br.cond.dptk.many.clr",	BR (1, 2, 1)},
!     {"br.cond.dpnt.many",	BR (1, 3, 0)},
!     {"br.cond.dpnt.many.clr",	BR (1, 3, 1)},
!     {"br.sptk.few",		BR (0, 0, 0)},
!     {"br.sptk",			BR (0, 0, 0), PSEUDO},
!     {"br.sptk.few.clr",		BR (0, 0, 1)},
!     {"br.sptk.clr",		BR (0, 0, 1), PSEUDO},
!     {"br.spnt.few",		BR (0, 1, 0)},
!     {"br.spnt",			BR (0, 1, 0), PSEUDO},
!     {"br.spnt.few.clr",		BR (0, 1, 1)},
!     {"br.spnt.clr",		BR (0, 1, 1), PSEUDO},
!     {"br.dptk.few",		BR (0, 2, 0)},
!     {"br.dptk",			BR (0, 2, 0), PSEUDO},
!     {"br.dptk.few.clr",		BR (0, 2, 1)},
!     {"br.dptk.clr",		BR (0, 2, 1), PSEUDO},
!     {"br.dpnt.few",		BR (0, 3, 0)},
!     {"br.dpnt",			BR (0, 3, 0), PSEUDO},
!     {"br.dpnt.few.clr",		BR (0, 3, 1)},
!     {"br.dpnt.clr",		BR (0, 3, 1), PSEUDO},
!     {"br.sptk.many",		BR (1, 0, 0)},
!     {"br.sptk.many.clr",	BR (1, 0, 1)},
!     {"br.spnt.many",		BR (1, 1, 0)},
!     {"br.spnt.many.clr",	BR (1, 1, 1)},
!     {"br.dptk.many",		BR (1, 2, 0)},
!     {"br.dptk.many.clr",	BR (1, 2, 1)},
!     {"br.dpnt.many",		BR (1, 3, 0)},
!     {"br.dpnt.many.clr",	BR (1, 3, 1)},
! #undef BR
  
  #define BR(a,b,c,d) \
  	B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2
Index: ia64-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/ia64-opc.c,v
retrieving revision 1.1
diff -d -c -p -b -w -r1.1 ia64-opc.c
*** ia64-opc.c	2000/04/21 20:22:24	1.1
--- ia64-opc.c	2000/04/23 02:38:29
*************** opcode_verify (opcode, place, type)
*** 346,352 ****
  /* Find an instruction entry in the ia64_dis_names array that matches
     opcode OPCODE and is of type TYPE.  Returns either a positive index
     into the array, or a negative value if an entry for OPCODE could
!    not be found.  */
  
  static int
  locate_opcode_ent (opcode, type)
--- 346,353 ----
  /* Find an instruction entry in the ia64_dis_names array that matches
     opcode OPCODE and is of type TYPE.  Returns either a positive index
     into the array, or a negative value if an entry for OPCODE could
!    not be found.  Checks all matches and returns the one with the highest
!    priority. */
  
  static int
  locate_opcode_ent (opcode, type)
*************** locate_opcode_ent (opcode, type)
*** 357,362 ****
--- 358,365 ----
    int bitpos[41];
    int op_ptr[41];
    int currstatenum = 0;
+   short found_disent = -1;
+   short found_priority = -1;
  
    currtest[currstatenum] = 0;
    op_ptr[currstatenum] = 0;
*************** locate_opcode_ent (opcode, type)
*** 463,468 ****
--- 466,472 ----
        if ((next_op >= 0) && (next_op & 32768))
  	{
  	  short disent = next_op & 32767;
+           short priority = -1;
  
  	  if (next_op > 65535)
  	    {
*************** locate_opcode_ent (opcode, type)
*** 475,481 ****
  	    {
  	      int place = ia64_dis_names[disent].insn_index;
  
! 	      if (opcode_verify (opcode, place, type))
  		{
  		  break;
  		}
--- 479,488 ----
  	    {
  	      int place = ia64_dis_names[disent].insn_index;
  
!               priority = ia64_dis_names[disent].priority;
! 
! 	      if (opcode_verify (opcode, place, type) 
!                   && priority > found_priority)
  		{
  		  break;
  		}
*************** locate_opcode_ent (opcode, type)
*** 491,504 ****
  
  	  if (disent >= 0)
  	    {
! 	      return disent;
  	    }
! 	  else
! 	    {
! 	      /* Failed to match; try the next test in this state. */
  	      next_op = -2;
  	    }
- 	}
  
        /* next_op == -1 is "back up to the previous state".
  	 next_op == -2 is "stay in this state and try the next test".
--- 498,510 ----
  
  	  if (disent >= 0)
  	    {
!               found_disent = disent;
!               found_priority = priority;
  	    }
!           /* Try the next test in this state, regardless of whether a match
!              was found. */
            next_op = -2;
  	}
  
        /* next_op == -1 is "back up to the previous state".
  	 next_op == -2 is "stay in this state and try the next test".
*************** locate_opcode_ent (opcode, type)
*** 509,515 ****
  	  currstatenum--;
  	  if (currstatenum < 0)
  	    {
! 	      return -1;
  	    }
  	}
        else if (next_op >= 0)
--- 515,521 ----
  	  currstatenum--;
  	  if (currstatenum < 0)
  	    {
!               return found_disent;
  	    }
  	}
        else if (next_op >= 0)

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