From d9e3874e107358c43c4957d1e0730928a736b1e9 Mon Sep 17 00:00:00 2001 From: danglin Date: Sat, 15 Apr 2006 15:53:33 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112970 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 11 ++++++ gcc/config/pa/pa.c | 56 ++++++++++++++++--------------- gcc/config/pa/pa.md | 96 ++++++++++++++++++++++++++--------------------------- 3 files changed, 88 insertions(+), 75 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0cb7d56..5702d7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2006-04-15 John David Anglin + + * 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 * tree-cfg.c (make_edges, make_omp_sections_edges, move_stmt_r, diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 509e016..48b8ca4 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -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, "b .+%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); } } diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 0853bb8..ada3368 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -1898,10 +1898,10 @@ (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) @@ -1926,10 +1926,10 @@ (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) @@ -1954,10 +1954,10 @@ (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) @@ -1982,10 +1982,10 @@ (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) @@ -2010,10 +2010,10 @@ (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) @@ -2038,10 +2038,10 @@ (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) @@ -2066,10 +2066,10 @@ (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) @@ -2094,10 +2094,10 @@ (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 "" @@ -2123,10 +2123,10 @@ (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) @@ -2151,10 +2151,10 @@ (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) @@ -2179,10 +2179,10 @@ (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) @@ -2207,10 +2207,10 @@ (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) @@ -2235,10 +2235,10 @@ (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) @@ -2263,10 +2263,10 @@ (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) @@ -2291,10 +2291,10 @@ (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) @@ -2319,10 +2319,10 @@ (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 -- 2.7.4