OSDN Git Service

* i960.c (i960_br_predict_opcode): Remove.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jun 2000 16:29:09 +0000 (16:29 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jun 2000 16:29:09 +0000 (16:29 +0000)
        (i960_print_operand) [+]: Emit branch prediction hints.
        (i960_function_arg): Return early for VOIDmode.
        (i960_round_align): Return early for incomplete types.
        * i960.h (PRINT_OPERAND_PUNCT_VALID_P): New.
        * i960.md (all conditional branches): Add "%+".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34342 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i960/i960.c
gcc/config/i960/i960.h
gcc/config/i960/i960.md

index 3959db2..098343e 100644 (file)
@@ -1,3 +1,12 @@
+2000-06-01  Richard Henderson  <rth@cygnus.com>
+
+       * i960.c (i960_br_predict_opcode): Remove.
+       (i960_print_operand) [+]: Emit branch prediction hints.
+       (i960_function_arg): Return early for VOIDmode.
+       (i960_round_align): Return early for incomplete types.
+       * i960.h (PRINT_OPERAND_PUNCT_VALID_P): New.
+       * i960.md (all conditional branches): Add "%+".
+
 Thu Jun  1 12:24:21 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * alias.c (get_alias_set): Don't call language-specific routine more
@@ -22,7 +31,7 @@ Thu Jun  1 09:37:35 2000  Clinton Popetz  <cpopetz@cygnus.com>
 
        * Makefile.in (c-decl.o): Depend on $(EXPR_H), not expr.h.
 
-        * c-decl.c (init_decl_processing): Set lang_get_alias_set first thing.
+       * c-decl.c (init_decl_processing): Set lang_get_alias_set first thing.
 
 2000-05-31  Richard Henderson  <rth@cygnus.com>
 
index 2cde31a..e8e046d 100644 (file)
@@ -1755,40 +1755,6 @@ i960_output_ret_insn (insn)
   return "ret";
 }
 \f
-#if 0
-/* Return a character string representing the branch prediction
-   opcode to be tacked on an instruction.  This must at least
-   return a null string.  */
-
-const char *
-i960_br_predict_opcode (lab_ref, insn)
-     rtx lab_ref, insn;
-{
-  if (TARGET_BRANCH_PREDICT)
-    {
-      unsigned long label_uid;
-      
-      if (GET_CODE (lab_ref) == CODE_LABEL)
-       label_uid = INSN_UID (lab_ref);
-      else if (GET_CODE (lab_ref) == LABEL_REF)
-       label_uid = INSN_UID (XEXP (lab_ref, 0));
-      else
-       return ".f";
-
-      /* If not optimizing, then the insn_addresses array will not be
-        valid.  In this case, always return ".t" since most branches
-        are taken.  If optimizing, return .t for backward branches
-        and .f for forward branches.  */
-      if (! optimize
-         || insn_addresses[label_uid] < insn_addresses[INSN_UID (insn)])
-       return ".t";
-      return ".f";
-    }
-    
-  return "";
-}
-#endif
-
 /* Print the operand represented by rtx X formatted by code CODE.  */
 
 void
@@ -1797,7 +1763,7 @@ i960_print_operand (file, x, code)
      rtx x;
      int code;
 {
-  enum rtx_code rtxcode = GET_CODE (x);
+  enum rtx_code rtxcode = x ? GET_CODE (x) : NIL;
 
   if (rtxcode == REG)
     {
@@ -1918,6 +1884,19 @@ i960_print_operand (file, x, code)
       else abort ();
       break;
 
+    case '+':
+      /* For conditional branches, substitute ".t" or ".f".  */
+      if (TARGET_BRANCH_PREDICT)
+       {
+         x = find_reg_note (current_output_insn, REG_BR_PROB, 0);
+         if (x)
+           {
+             int pred_val = INTVAL (XEXP (x, 0));
+             fputs ((pred_val < REG_BR_PROB_BASE / 2 ? ".f" : ".t"), file);
+           }
+       }
+      break;
+
     case 0:
       output_addr_const (file, x);
       break;
@@ -2509,6 +2488,9 @@ i960_function_arg (cum, mode, type, named)
   rtx ret;
   int size, align;
 
+  if (mode == VOIDmode)
+    return 0;
+
   i960_arg_size_and_align (mode, type, &size, &align);
 
   if (size > 4 || cum->ca_nstackparms != 0
@@ -2601,7 +2583,7 @@ i960_round_align (align, tsize)
 {
   int new_align;
 
-  if (TREE_CODE (tsize) != INTEGER_CST)
+  if (! tsize || TREE_CODE (tsize) != INTEGER_CST)
     return align;
 
   new_align = i960_object_bytes_bitalign (TREE_INT_CST_LOW (tsize)
index 10cc665..cc12d45 100644 (file)
@@ -1564,6 +1564,13 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
 
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR)      \
   i960_print_operand_addr (FILE, ADDR)
+
+/* Determine which codes are valid without a following integer.  These must
+   not be alphabetic (the characters are chosen so that
+   PRINT_OPERAND_PUNCT_VALID_P translates into a simple range change when
+   using ASCII).  */
+
+#define PRINT_OPERAND_PUNCT_VALID_P(CODE)   ((CODE) == '+')
 \f
 /* Output assembler code for a block containing the constant parts
    of a trampoline, leaving space for the variable parts.  */
index 38c14ba..e42a894 100644 (file)
         (label_ref (match_operand 3 "" ""))
         (pc)))]
   ""
-  "bbs %2,%1,%l3"
+  "bbs%+       %2,%1,%l3"
   [(set_attr "type" "branch")])
 
 (define_insn ""
         (label_ref (match_operand 3 "" ""))
         (pc)))]
   ""
-  "bbc %2,%1,%l3"
+  "bbc%+       %2,%1,%l3"
   [(set_attr "type" "branch")])
 
 (define_insn ""
         (label_ref (match_operand 3 "" ""))
         (pc)))]
   ""
-  "bbs %2,%1,%l3"
+  "bbs%+       %2,%1,%l3"
   [(set_attr "type" "branch")])
 
 (define_insn ""
         (label_ref (match_operand 3 "" ""))
         (pc)))]
   ""
-  "bbc %2,%1,%l3"
+  "bbc%+       %2,%1,%l3"
   [(set_attr "type" "branch")])
 
 ;; ??? These will never match.  The LOG_LINKs necessary to make these match
                      (label_ref (match_operand 1 "" ""))
                      (pc)))]
   ""
-  "b%C0 %l1"
+  "b%C0%+ %l1"
   [(set_attr "type" "branch")])
 
 (define_insn ""
                      (pc)
                      (label_ref (match_operand 1 "" ""))))]
   ""
-  "b%I0 %l1"
+  "b%I0%+ %l1"
   [(set_attr "type" "branch")])
 
 (define_insn ""
                      (label_ref (match_operand 1 "" ""))
                      (pc)))]
   ""
-  "b%C0 %l1"
+  "b%C0%+ %l1"
   [(set_attr "type" "branch")])
 
 (define_insn ""
                      (pc)
                      (label_ref (match_operand 1 "" ""))))]
   ""
-  "b%I0 %l1"
+  "b%I0%+ %l1"
   [(set_attr "type" "branch")])
 
 (define_insn ""
         (label_ref (match_operand 3 "" ""))
         (pc)))]
   ""
-  "cmp%S0%B0%R0        %2,%1,%l3"
+  "cmp%S0%B0%R0%+      %2,%1,%l3"
   [(set_attr "type" "branch")])
 
 (define_insn ""
         (pc)
         (label_ref (match_operand 3 "" ""))))]
   ""
-  "cmp%S0%B0%X0        %2,%1,%l3"
+  "cmp%S0%B0%X0%+      %2,%1,%l3"
   [(set_attr "type" "branch")])
 \f
 ;; Now the trap instructions.  The i960 appears to only have conditional