re PR target/20632 (GCC should avoid generating F- and B-unit NOPs)
authorVladimir Makarov <vmakarov@redhat.com>
Thu, 31 Mar 2005 23:26:33 +0000 (23:26 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Thu, 31 Mar 2005 23:26:33 +0000 (23:26 +0000)
2005-03-31  Vladimir Makarov  <vmakarov@redhat.com>

PR target/20632
* genautomata.c (first_cycle_unit_presence): Check all alternative
states for unit presence.

* doc/md.texi: Remove remark about impossibility to query unit
presence in non nondeterministic automaton state.

* config/ia64/ia64.c (get_template): Change order of unit querying.

From-SVN: r97351

gcc/ChangeLog
gcc/config/ia64/ia64.c
gcc/doc/md.texi
gcc/genautomata.c

index 8d53eb8d64f08816f15aa1c29adaab1a29976729..9b9ff0d25ce306e9540a7a271974bcf027c54644 100644 (file)
@@ -1,3 +1,14 @@
+2005-03-31  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR target/20632
+       * genautomata.c (first_cycle_unit_presence): Check all alternative
+       states for unit presence.
+
+       * doc/md.texi: Remove remark about impossibility to query unit
+       presence in non nondeterministic automaton state.
+       
+       * config/ia64/ia64.c (get_template): Change order of unit querying.
+
 2005-03-31  Kazu Hirata  <kazu@cs.umass.edu>
 
        * tree-ssa-dom.c (cprop_into_successor_phis): Remove an
index 3d15f4036327801472ad3d50a5f57cbc15e7d0a8..fef372983646f426570c99301f3130a7077c7b69 100644 (file)
@@ -6481,7 +6481,13 @@ get_max_pos (state_t state)
 
 /* The function returns code of a possible template for given position
    and state.  The function should be called only with 2 values of
-   position equal to 3 or 6.  */
+   position equal to 3 or 6.  We avoid generating F NOPs by putting
+   templates containing F insns at the end of the template search
+   because undocumented anomaly in McKinley derived cores which can
+   cause stalls if an F-unit insn (including a NOP) is issued within a
+   six-cycle window after reading certain application registers (such
+   as ar.bsp).  Furthermore, power-considerations also argue against
+   the use of F-unit instructions unless they're really needed.  */
 
 static int
 get_template (state_t state, int pos)
@@ -6489,22 +6495,22 @@ get_template (state_t state, int pos)
   switch (pos)
     {
     case 3:
-      if (cpu_unit_reservation_p (state, _0mii_))
-       return 0;
-      else if (cpu_unit_reservation_p (state, _0mmi_))
+      if (cpu_unit_reservation_p (state, _0mmi_))
        return 1;
-      else if (cpu_unit_reservation_p (state, _0mfi_))
-       return 2;
-      else if (cpu_unit_reservation_p (state, _0mmf_))
-       return 3;
-      else if (cpu_unit_reservation_p (state, _0bbb_))
-       return 4;
-      else if (cpu_unit_reservation_p (state, _0mbb_))
-       return 5;
-      else if (cpu_unit_reservation_p (state, _0mib_))
-       return 6;
+      else if (cpu_unit_reservation_p (state, _0mii_))
+       return 0;
       else if (cpu_unit_reservation_p (state, _0mmb_))
        return 7;
+      else if (cpu_unit_reservation_p (state, _0mib_))
+       return 6;
+      else if (cpu_unit_reservation_p (state, _0mbb_))
+       return 5;
+      else if (cpu_unit_reservation_p (state, _0bbb_))
+       return 4;
+      else if (cpu_unit_reservation_p (state, _0mmf_))
+       return 3;
+      else if (cpu_unit_reservation_p (state, _0mfi_))
+       return 2;
       else if (cpu_unit_reservation_p (state, _0mfb_))
        return 8;
       else if (cpu_unit_reservation_p (state, _0mlx_))
@@ -6512,22 +6518,22 @@ get_template (state_t state, int pos)
       else
        abort ();
     case 6:
-      if (cpu_unit_reservation_p (state, _1mii_))
-       return 0;
-      else if (cpu_unit_reservation_p (state, _1mmi_))
+      if (cpu_unit_reservation_p (state, _1mmi_))
        return 1;
-      else if (cpu_unit_reservation_p (state, _1mfi_))
-       return 2;
-      else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_))
-       return 3;
-      else if (cpu_unit_reservation_p (state, _1bbb_))
-       return 4;
-      else if (cpu_unit_reservation_p (state, _1mbb_))
-       return 5;
-      else if (cpu_unit_reservation_p (state, _1mib_))
-       return 6;
+      else if (cpu_unit_reservation_p (state, _1mii_))
+       return 0;
       else if (cpu_unit_reservation_p (state, _1mmb_))
        return 7;
+      else if (cpu_unit_reservation_p (state, _1mib_))
+       return 6;
+      else if (cpu_unit_reservation_p (state, _1mbb_))
+       return 5;
+      else if (cpu_unit_reservation_p (state, _1bbb_))
+       return 4;
+      else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_))
+       return 3;
+      else if (cpu_unit_reservation_p (state, _1mfi_))
+       return 2;
       else if (cpu_unit_reservation_p (state, _1mfb_))
        return 8;
       else if (cpu_unit_reservation_p (state, _1mlx_))
index d3312f75bc50901c7310105bbe105a8fae9984d0..608b0a8f0a679f16baff363b039f74ae7992ad19 100644 (file)
@@ -6232,9 +6232,7 @@ the treatment of operator @samp{|} in the regular expressions.  The
 usual treatment of the operator is to try the first alternative and,
 if the reservation is not possible, the second alternative.  The
 nondeterministic treatment means trying all alternatives, some of them
-may be rejected by reservations in the subsequent insns.  You can not
-query functional unit reservations in nondeterministic automaton
-states.
+may be rejected by reservations in the subsequent insns.
 
 @item
 @dfn{progress} means output of a progress bar showing how many states
index e54cbbdaecedbf0b9f520d476c27a7254e91f79d..ac1f69cb285a729a8cfbe9d9c7cbf291d17703af 100644 (file)
@@ -6120,15 +6120,19 @@ copy_equiv_class (vla_ptr_t *to, const vla_ptr_t *from)
 static int
 first_cycle_unit_presence (state_t state, int unit_num)
 {
-  int presence_p;
+  alt_state_t alt_state;
 
   if (state->component_states == NULL)
-    presence_p = test_unit_reserv (state->reservs, 0, unit_num);
+    return test_unit_reserv (state->reservs, 0, unit_num);
   else
-    presence_p
-      = test_unit_reserv (state->component_states->state->reservs,
-                         0, unit_num);
-  return presence_p;
+    {
+      for (alt_state = state->component_states;
+          alt_state != NULL;
+          alt_state = alt_state->next_sorted_alt_state)
+       if (test_unit_reserv (alt_state->state->reservs, 0, unit_num))
+         return true;
+    }
+  return false;
 }
 
 /* The function returns nonzero value if STATE is not equivalent to