2004-11-12 Bob Wilson <bob.wilson@acm.org>
authorBob Wilson <bob.wilson@acm.org>
Fri, 12 Nov 2004 21:59:13 +0000 (21:59 +0000)
committerBob Wilson <bob.wilson@acm.org>
Fri, 12 Nov 2004 21:59:13 +0000 (21:59 +0000)
include/ChangeLog
* xtensa-isa-internal.h (xtensa_interface_internal): Add class_id.
* xtensa-isa.h (xtensa_interface_class_id): New prototype.

bfd/ChangeLog
* xtensa-isa.c (xtensa_interface_class_id): New.

gas/ChangeLog
* config/tc-xtensa.c (finish_vinsn): Clear pending instruction if
there is a conflict.
(check_t1_t2_reads_and_writes): Check for both reads and writes to
interfaces that are related as determined by xtensa_interface_class_id.

bfd/ChangeLog
bfd/xtensa-isa.c
gas/ChangeLog
gas/config/tc-xtensa.c
include/ChangeLog
include/xtensa-isa-internal.h
include/xtensa-isa.h

index ed41ba20194e2097c6019e34a06515c89c2006d9..eb1b7186f584dc2843a91d7dbe18a670983b06f0 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-12  Bob Wilson  <bob.wilson@acm.org>
+
+       * xtensa-isa.c (xtensa_interface_class_id): New.
+
 2004-11-11  Bob Wilson  <bob.wilson@acm.org>
 
        * elf32-xtensa.c (property_table_compare): Remove assertion about
index 30ad80cfd6b6dfaec779c82f4f221de67a0cf3f6..f5fa3c2111cbd59dca3d10100242b196a0d8a285 100644 (file)
@@ -1677,6 +1677,15 @@ xtensa_interface_has_side_effect (xtensa_isa isa, xtensa_interface intf)
   return 0;
 }
 
+
+int
+xtensa_interface_class_id (xtensa_isa isa, xtensa_interface intf)
+{
+  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
+  CHECK_INTERFACE (intisa, intf, XTENSA_UNDEFINED);
+  return intisa->interfaces[intf].class_id;
+}
+
 \f
 /* Functional Units.  */
 
index bda1a36c2302a0f7d429abafeb5309044c0aefce..2eaae59326cfe2d736e31a7bd211e86fb243a914 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-12  Bob Wilson  <bob.wilson@acm.org>
+
+       * config/tc-xtensa.c (finish_vinsn): Clear pending instruction if
+       there is a conflict.
+       (check_t1_t2_reads_and_writes): Check for both reads and writes to
+       interfaces that are related as determined by xtensa_interface_class_id.
+
 2004-11-12  Nick Clifton  <nickc@redhat.com>
 
        * config/tc-mn10300.c (md_relax_table): Fix off by one negative
index 8f362302a2ad1ad8b7ef7c6efd6435e83639175e..88ddf171c9853409b5ebcc12625d71f3eddda75e 100644 (file)
@@ -6013,7 +6013,7 @@ opcode_funcUnit_use_stage (void *data, xtensa_opcode opcode, int idx)
    solely whether the hardware is available to execute the given
    instructions together.  It also doesn't check if the tinsns 
    write the same state, or access the same tieports.  That is
-   checked by check_t1_t2_read_write.  */
+   checked by check_t1_t2_reads_and_writes.  */
 
 static bfd_boolean
 resources_conflict (vliw_insn *vinsn)
@@ -6069,7 +6069,10 @@ finish_vinsn (vliw_insn *vinsn)
   int line;
 
   if (find_vinsn_conflicts (vinsn))
-    return;
+    {
+      xg_clear_vinsn (vinsn);
+      return;
+    }
 
   /* First, find a format that works.  */
   if (vinsn->format == XTENSA_UNDEFINED)
@@ -6326,7 +6329,7 @@ find_vinsn_conflicts (vliw_insn *vinsn)
 }
 
 
-/* Check how the result registers of t1 and t2 relate.
+/* Check how the state used by t1 and t2 relate.
    Cases found are:
 
    case A: t1 reads a register t2 writes (an antidependency within a bundle)
@@ -6336,7 +6339,7 @@ find_vinsn_conflicts (vliw_insn *vinsn)
            bundle)
    case D: t1 writes a state that t2 also writes
    case E: t1 writes a tie queue that t2 also writes
-   case F: two volatile queue writes
+   case F: two volatile queue accesses
 */
 
 static char
@@ -6459,18 +6462,24 @@ check_t1_t2_reads_and_writes (TInsn *t1, TInsn *t2)
     {
       xtensa_interface t2_int
        = xtensa_interfaceOperand_interface (isa, t2->opcode, j);
+      int t2_class = xtensa_interface_class_id (isa, t2_int);
+
       t2_inout = xtensa_interface_inout (isa, j);
-      if (xtensa_interface_has_side_effect (isa, t2_int) == 1 
-         && t2_inout != 'i')
+      if (xtensa_interface_has_side_effect (isa, t2_int) == 1)
        t2_volatile = TRUE;
+
       for (i = 0; i < t1_interfaces; i++)
        {
          xtensa_interface t1_int
            = xtensa_interfaceOperand_interface (isa, t1->opcode, j);
+         int t1_class = xtensa_interface_class_id (isa, t2_int);
+
          t1_inout = xtensa_interface_inout (isa, i);
-         if (xtensa_interface_has_side_effect (isa, t1_int) == 1 
-             && t1_inout != 'i')
+         if (xtensa_interface_has_side_effect (isa, t1_int) == 1)
            t1_volatile = TRUE;
+
+         if (t1_volatile && t2_volatile && (t1_class == t2_class))
+           return 'f';
          
          if (t1_int != t2_int)
            continue;
@@ -6491,9 +6500,6 @@ check_t1_t2_reads_and_writes (TInsn *t1, TInsn *t2)
            return 'e';
        }
     }
-
-  if (t1_volatile && t2_volatile)
-    return 'f';
   
   return conflict;
 }
index 7ee396b1916bdf34838a161a0b0695041d0340f9..de51a8fbb2de212e93d4ace099c4cdaa2a261405 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-12  Bob Wilson  <bob.wilson@acm.org>
+
+       * xtensa-isa-internal.h (xtensa_interface_internal): Add class_id.
+       * xtensa-isa.h (xtensa_interface_class_id): New prototype.
+
 2004-11-08  Inderpreet Singh   <inderpreetb@nioda.hcltech.com>
            Vineet Sharma      <vineets@noida.hcltech.com>
 
index 50ac4781c3708003d2078b2ad0bcd773b8fc2122..44e53f95b30f8f3362d5619275732066cd953367 100644 (file)
@@ -131,6 +131,7 @@ typedef struct xtensa_interface_internal_struct
   const char *name;                    /* Interface name.  */
   int num_bits;                                /* Width of the interface.  */
   uint32 flags;                                /* See XTENSA_INTERFACE_* flags.  */
+  int class_id;                                /* Class of related interfaces.  */
   char inout;                          /* "i" or "o".  */
 } xtensa_interface_internal;
 
index 2dc11b924c03adb7accaf2545bb93d6309e97148..025e31750758689e71ebe0d80d4fa9b8c5aa36f5 100644 (file)
@@ -755,6 +755,19 @@ xtensa_interface_inout (xtensa_isa isa, xtensa_interface intf);
 extern int
 xtensa_interface_has_side_effect (xtensa_isa isa, xtensa_interface intf);
 
+
+/* Some interfaces may be related such that accessing one interface
+   has side effects on a set of related interfaces.  The interfaces
+   are partitioned into equivalence classes of related interfaces, and
+   each class is assigned a unique identifier number.  This function
+   returns the class identifier for an interface, or XTENSA_UNDEFINED
+   on error.  These identifiers can be compared to determine if two
+   interfaces are related; the specific values of the identifiers have
+   no particular meaning otherwise.  */
+
+extern int
+xtensa_interface_class_id (xtensa_isa isa, xtensa_interface intf);
+
 \f
 /* Functional Units.  */
 
This page took 0.048362 seconds and 4 git commands to generate.