]> gcc.gnu.org Git - gcc.git/commitdiff
ia64-protos.h (ia64_expand_prediction): Remove.
authorRichard Henderson <rth@cygnus.com>
Thu, 1 Jun 2000 00:10:35 +0000 (17:10 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 1 Jun 2000 00:10:35 +0000 (17:10 -0700)
        * config/ia64/ia64-protos.h (ia64_expand_prediction): Remove.
        * config/ia64/ia64.c (ia64_expand_prediction): Move code ...
        (ia64_print_operand) [+]: ... here.  Use current_output_insn.
        * config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): New.
        * config/ia64/ia64.md (all branch/call patterns): Use %+.

From-SVN: r34318

gcc/ChangeLog
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h
gcc/config/ia64/ia64.md

index 52f19389d2a9ee6c658842e4f054d1cba9a1792b..53ba7fc3799161c9cc06ecf3c2d8c7e84622c313 100644 (file)
@@ -1,3 +1,11 @@
+2000-05-31  Richard Henderson  <rth@cygnus.com>
+
+       * config/ia64/ia64-protos.h (ia64_expand_prediction): Remove.
+       * config/ia64/ia64.c (ia64_expand_prediction): Move code ...
+       (ia64_print_operand) [+]: ... here.  Use current_output_insn.
+       * config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): New.
+       * config/ia64/ia64.md (all branch/call patterns): Use %+.
+
 2000-05-31  Richard Henderson  <rth@cygnus.com>
 
        * ifcvt.c (cond_exec_process_insns): Don't ever ignore clobbers.
index d8f75e0cd0deda044d2a5f9ff198804922bdd25c..ec820b1aaa62da13888b6ca3b8c1a839f1c592f7 100644 (file)
@@ -61,7 +61,6 @@ extern enum reg_class ia64_secondary_reload_class PARAMS((enum reg_class,
                                                          enum machine_mode,
                                                          rtx));
 extern void ia64_reorg PARAMS((rtx));
-extern const char *ia64_expand_prediction PARAMS((rtx, const char *));
 #endif /* RTX_CODE */
 
 #ifdef TREE_CODE
index 34c6b2bf5fd5ed3c711d3550892691097bfb9e0a..3e170f85833fd870b43b1ff48aae8f003b901033 100644 (file)
@@ -1714,8 +1714,6 @@ ia64_print_operand (file, x, code)
 {
   switch (code)
     {
-      /* XXX Add other codes here.  */
-
     case 0:
       /* Handled below.  */
       break;
@@ -1840,6 +1838,36 @@ ia64_print_operand (file, x, code)
        output_operand_lossage ("invalid %%r value");
       return;
 
+    case '+':
+      {
+       const char *which;
+       
+       /* For conditional branches, returns or calls, substitute
+          sptk, dptk, dpnt, or spnt for %s.  */
+       x = find_reg_note (current_output_insn, REG_BR_PROB, 0);
+       if (x)
+         {
+           int pred_val = INTVAL (XEXP (x, 0));
+
+           /* Guess top and bottom 10% statically predicted.  */
+           if (pred_val < REG_BR_PROB_BASE / 10)
+             which = ".spnt";
+           else if (pred_val < REG_BR_PROB_BASE / 2)
+             which = ".dpnt";
+           else if (pred_val < REG_BR_PROB_BASE * 9 / 10)
+             which = ".dptk";
+           else
+             which = ".sptk";
+         }
+       else if (GET_CODE (current_output_insn) == CALL_INSN)
+         which = ".sptk";
+       else
+         which = ".dptk";
+
+       fputs (which, file);
+       return;
+      }
+
     default:
       output_operand_lossage ("ia64_print_operand: unknown code");
       return;
@@ -1872,48 +1900,6 @@ ia64_print_operand (file, x, code)
 
   return;
 }
-
-/* For conditional branches, returns or calls, substitute
-   sptk, dptk, dpnt, or spnt for %s.  */
-
-const char *
-ia64_expand_prediction (insn, template)
-     rtx insn;
-     const char *template;
-{
-  static char const pred_name[4][5] = {
-       "spnt", "dpnt", "dptk", "sptk"
-  };
-  static char new_template[64];
-
-  int pred_val, pred_which;
-  rtx note;
-
-  note = find_reg_note (insn, REG_BR_PROB, 0);
-  if (note)
-    {
-      pred_val = INTVAL (XEXP (note, 0));
-
-      /* Guess top and bottom 10% statically predicted.  */
-      if (pred_val < REG_BR_PROB_BASE / 10)
-       pred_which = 0;
-      else if (pred_val < REG_BR_PROB_BASE / 2)
-       pred_which = 1;
-      else if (pred_val < REG_BR_PROB_BASE * 9 / 10)
-       pred_which = 2;
-      else
-       pred_which = 3;
-    }
-  else
-    pred_which = 2;
-
-  if (strlen (template) >= sizeof (new_template) - 3)
-    abort ();
-
-  sprintf (new_template, template, pred_name[pred_which]);
-
-  return new_template;
-}
 \f
 
 /* This function returns the register class required for a secondary
index cf8b6ead0dcae30518143891c133b62d13c86d49..6ea12dcc9ee957df73372d2cf9dfc1484e53ecfd 100644 (file)
@@ -2469,7 +2469,7 @@ do {                                                                      \
 
 /* ??? Keep this around for now, as we might need it later.  */
 
-/* #define PRINT_OPERAND_PUNCT_VALID_P(CODE) */
+#define PRINT_OPERAND_PUNCT_VALID_P(CODE)   ((CODE) == '+')
 
 /* A C compound statement to output to stdio stream STREAM the assembler syntax
    for an instruction operand that is a memory reference whose address is X.  X
index c7453c7ebd24bd6b7ed07d72786fdd80d1f6817c..d46563e1ef826e1dcd932bcbdc9112ae6ee5246d 100644 (file)
                      (label_ref (match_operand 2 "" ""))
                      (pc)))]
   ""
-  "* return ia64_expand_prediction (insn, \"(%%J0) br.cond.%s %%l2\");"
+  "(%J0) br.cond%+ %l2"
   [(set_attr "type" "B")
    (set_attr "predicable" "no")])
 
                      (pc)
                      (label_ref (match_operand 2 "" ""))))]
   ""
-  "* return ia64_expand_prediction (insn, \"(%%j0) br.cond.%s %%l2\");"
+  "(%j0) br.cond%+ %l2"
   [(set_attr "type" "B")
    (set_attr "predicable" "no")])
 \f
         (match_operand 1 "" ""))
    (clobber (match_operand:DI 2 "register_operand" "=b"))]
   ""
-  "*
-{
-  operands[3] = current_insn_predicate;
-  if (operands[3] != NULL_RTX)
-    return ia64_expand_prediction (insn, \"(%%J3) br.call.%s.many %2 = %0\");
-  else
-    return \"br.call.sptk.many %2 = %0\";
-}"
+  "br.call%+.many %2 = %0"
   [(set_attr "type" "B")])
 
 (define_insn "*call_internal1"
    (use (reg:DI 1))
    (clobber (match_operand:DI 2 "register_operand" "=b"))]
   ""
-  "*
-{
-  operands[3] = current_insn_predicate;
-  if (operands[3] != NULL_RTX)
-    return ia64_expand_prediction (insn, \"(%%J3) br.call.%s.many %2 = %0\");
-  else
-    return \"br.call.sptk.many %2 = %0\";
-}"
+  "br.call%+.many %2 = %0"
   [(set_attr "type" "B")])
 
 ;; Subroutine call instruction returning a value.  Operand 0 is the hard
              (match_operand 2 "" "")))
    (clobber (match_operand:DI 3 "register_operand" "=b"))]
   ""
-  "*
-{
-  operands[4] = current_insn_predicate;
-  if (operands[4] != NULL_RTX)
-    return ia64_expand_prediction (insn, \"(%%J4) br.call.%s.many %3 = %1\");
-  else
-    return \"br.call.sptk.many %3 = %1\";
-}"
+  "br.call%+.many %3 = %1"
   [(set_attr "type" "B")])
 
 (define_insn "*call_value_internal1"
    (use (reg:DI 1))
    (clobber (match_operand:DI 3 "register_operand" "=b"))]
   ""
-  "*
-{
-  operands[4] = current_insn_predicate;
-  if (operands[4] != NULL_RTX)
-    return ia64_expand_prediction (insn, \"(%%J4) br.call.%s.many %3 = %1\");
-  else
-    return \"br.call.sptk.many %3 = %1\";
-}"
+  "br.call%+.many %3 = %1"
   [(set_attr "type" "B")])
 
 (define_insn "*call_multiple_values_internal1"
                    (use (reg:DI 1))
                    (clobber (match_operand:DI 4 "register_operand" "=b"))])]
   ""
-  "*
-{
-  operands[5] = current_insn_predicate;
-  if (operands[5] != NULL_RTX)
-    return ia64_expand_prediction (insn, \"(%%J5) br.call.%s.many %4 = %2\");
-  else
-    return \"br.call.sptk.many %4 = %2\";
-}"
+  "br.call%+.many %4 = %2"
   [(set_attr "type" "B")])
 
 ;; Call subroutine returning any type.
                      (return)
                      (pc)))]
   "ia64_direct_return ()"
-  "* return ia64_expand_prediction (insn, \"(%%J0) br.ret.%s.many rp\");"
+  "(%%J0) br.ret%+.many rp"
   [(set_attr "type" "B")
    (set_attr "predicable" "no")])
 
                      (pc)
                      (return)))]
   "ia64_direct_return ()"
-  "* return ia64_expand_prediction (insn, \"(%%j0) br.ret.%s.many rp\");"
+  "(%%j0) br.ret%+.many rp"
   [(set_attr "type" "B")
    (set_attr "predicable" "no")])
 
This page took 0.090997 seconds and 5 git commands to generate.