OSDN Git Service

* pa.md (output_bb patterns): Shorten long branch alternatives by 4.
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Apr 2006 15:53:33 +0000 (15:53 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Apr 2006 15:53:33 +0000 (15:53 +0000)
(output_bvb patterns): Likewise.
* pa.c (output_bb): Use 'bb' insn for long branch case.
(output_bvb): Likewise use '{bvb|bb}' for long branch case.
(output_dbra): Use '{comb|cmpb}' for long branch case for alternative
1.  Correct length operand for alternatives 1 and 2.
(output_movb): Use '{comb|cmpb}' for long branch case for alternatives
1, 2 and 3.  Correct length operand for alternatives 1, 2 and 3.

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

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.md

index 0cb7d56..5702d7b 100644 (file)
@@ -1,3 +1,14 @@
+2006-04-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * pa.md (output_bb patterns): Shorten long branch alternatives by 4.
+       (output_bvb patterns): Likewise.
+       * pa.c (output_bb): Use 'bb' insn for long branch case.
+       (output_bvb): Likewise use '{bvb|bb}' for long branch case.
+       (output_dbra): Use '{comb|cmpb}' for long branch case for alternative
+       1.  Correct length operand for alternatives 1 and 2.
+       (output_movb): Use '{comb|cmpb}' for long branch case for alternatives
+       1, 2 and 3.  Correct length operand for alternatives 1, 2 and 3.
+
 2006-04-14  Roger Sayle  <roger@eyesopen.com>
 
        * tree-cfg.c (make_edges, make_omp_sections_edges, move_stmt_r,
index 509e016..48b8ca4 100644 (file)
@@ -1,6 +1,6 @@
 /* Subroutines for insn-output.c for HPPA.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    Contributed by Tim Moore (moore@cs.utah.edu), based on sparc.c
 
 This file is part of GCC.
@@ -6436,27 +6436,27 @@ output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
          {
            nullify = 1;
            xdelay = 0;
-           operands[4] = GEN_INT (length - 8);
+           operands[4] = GEN_INT (length);
          }
        else
          {
            xdelay = 1;
-           operands[4] = GEN_INT (length - 4);
+           operands[4] = GEN_INT (length + 4);
          }
 
        if (GET_MODE (operands[0]) == DImode)
-         strcpy (buf, "extrd,s,*");
+         strcpy (buf, "bb,*");
        else
-         strcpy (buf, "{extrs,|extrw,s,}");
+         strcpy (buf, "bb,");
        if ((which == 0 && negated)
            || (which == 1 && !negated))
-         strcat (buf, ">= %0,%1,1,%%r0\n\t");
+         strcat (buf, "<");
        else
-         strcat (buf, "< %0,%1,1,%%r0\n\t");
+         strcat (buf, ">=");
        if (nullify)
-         strcat (buf, "b,n .+%4");
+         strcat (buf, ",n %0,%1,.+%4");
        else
-         strcat (buf, ".+%4");
+         strcat (buf, " %0,%1,.+%4");
        output_asm_insn (buf, operands);
        return output_lbranch (negated ? operands[3] : operands[2],
                               insn, xdelay);
@@ -6616,27 +6616,27 @@ output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
          {
            nullify = 1;
            xdelay = 0;
-           operands[4] = GEN_INT (length - 8);
+           operands[4] = GEN_INT (length);
          }
        else
          {
            xdelay = 1;
-           operands[4] = GEN_INT (length - 4);
+           operands[4] = GEN_INT (length + 4);
          }
 
        if (GET_MODE (operands[0]) == DImode)
-         strcpy (buf, "extrd,s,*");
+         strcpy (buf, "bb,*");
        else
-         strcpy (buf, "{extrs,|extrw,s,}");
+         strcpy (buf, "{bvb,|bb,}");
        if ((which == 0 && negated)
            || (which == 1 && !negated))
-         strcat (buf, ">= {%0,%1,1,%%r0|%0,%%sar,1,%%r0}\n\t");
+         strcat (buf, "<");
        else
-         strcat (buf, "< {%0,%1,1,%%r0|%0,%%sar,1,%%r0}\n\t");
+         strcat (buf, ">=");
        if (nullify)
-         strcat (buf, "b,n .+%4");
+         strcat (buf, ",n {%0,.+%4|%0,%%sar,.+%4}");
        else
-         strcat (buf, "b .+%4");
+         strcat (buf, " {%0,.+%4|%0,%%sar,.+%4}");
        output_asm_insn (buf, operands);
        return output_lbranch (negated ? operands[3] : operands[2],
                               insn, xdelay);
@@ -6763,8 +6763,8 @@ output_dbra (rtx *operands, rtx insn, int which_alternative)
        return "{comclr|cmpclr},%B2 %%r0,%4,%%r0\n\tb %3\n\t{fldws|fldw} -16(%%r30),%0";
       else
        {
-         operands[4] = GEN_INT (length - 24);
-         output_asm_insn ("addib,%N2 %1,%0,.+%4", operands);
+         operands[5] = GEN_INT (length - 16);
+         output_asm_insn ("{comb|cmpb},%B2 %%r0,%4,.+%5", operands);
          output_asm_insn ("{fldws|fldw} -16(%%r30),%0", operands);
          return output_lbranch (operands[3], insn, 0);
        }
@@ -6781,8 +6781,8 @@ output_dbra (rtx *operands, rtx insn, int which_alternative)
        return "addi,%N2 %1,%4,%4\n\tb %3\n\tstw %4,%0";
       else
        {
-         operands[5] = GEN_INT (length - 12);
-         output_asm_insn ("addib,%N2 %1,%0,.+%5\n\tstw %4,%0", operands);
+         operands[5] = GEN_INT (length - 4);
+         output_asm_insn ("addib,%N2 %1,%4,.+%5\n\tstw %4,%0", operands);
          return output_lbranch (operands[3], insn, 0);
        }
     }
@@ -6906,8 +6906,8 @@ output_movb (rtx *operands, rtx insn, int which_alternative,
        return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\t{fldws|fldw} -16(%%r30),%0";
       else
        {
-         operands[4] = GEN_INT (length - 12);
-         output_asm_insn ("movb,%N2 %1,%0,.+%4", operands);
+         operands[4] = GEN_INT (length - 4);
+         output_asm_insn ("{comb|cmpb},%B2 %%r0,%1,.+%4", operands);
          output_asm_insn ("{fldws|fldw} -16(%%r30),%0", operands);
          return output_lbranch (operands[3], insn, 0);
        }
@@ -6923,8 +6923,9 @@ output_movb (rtx *operands, rtx insn, int which_alternative,
        return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\tstw %1,%0";
       else
        {
-         operands[4] = GEN_INT (length - 8);
-         output_asm_insn ("movb,%N2 %1,%0,.+%4\n\tstw %1,%0", operands);
+         operands[4] = GEN_INT (length);
+         output_asm_insn ("{comb|cmpb},%B2 %%r0,%1,.+%4\n\tstw %1,%0",
+                          operands);
          return output_lbranch (operands[3], insn, 0);
        }
     }
@@ -6937,8 +6938,9 @@ output_movb (rtx *operands, rtx insn, int which_alternative,
        return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\tmtsar %r1";
       else
        {
-         operands[4] = GEN_INT (length - 8);
-         output_asm_insn ("movb,%N2 %1,%0,.+%4\n\tmtsar %r1", operands);
+         operands[4] = GEN_INT (length);
+         output_asm_insn ("{comb|cmpb},%B2 %%r0,%1,.+%4\n\tmtsar %r1",
+                          operands);
          return output_lbranch (operands[3], insn, 0);
        }
     }
index 0853bb8..ada3368 100644 (file)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 ;; Branch on Variable Bit patterns.
 (define_insn ""
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 (define_insn ""
   [(set (pc)
               (const_int MAX_17BIT_OFFSET))
           (const_int 8)
           (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
-          (const_int 28)
+          (const_int 24)
           (eq (symbol_ref "flag_pic") (const_int 0))
-          (const_int 24)]
-         (const_int 32)))])
+          (const_int 20)]
+         (const_int 28)))])
 
 ;; Floating point branches