This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] SH wasn't able to handle far cond branches
- To: "Igor Shevlyakov" <igor at windriver dot com>
- Subject: Re: [Patch] SH wasn't able to handle far cond branches
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 03 Jun 2001 19:16:04 -0300
- Cc: <gcc-patches at gcc dot gnu dot org>, <amylaar at redhat dot com>
- Organization: GCC Team, Red Hat
- References: <NDBBKCENGMEOBDEHNNEJGEHCCLAA.igor@windriver.com>
On May 3, 2001, "Igor Shevlyakov" <igor@windriver.com> wrote:
> It happend that SH didn't have support for far cond branches. Our customer
> reproduced that on function 7000 lines long.
Thanks. Since I had to make small changes in your patch so that it
would follow the formatting guidelines in our coding standards (such
as having blanks around `=', having a blank line between the
declarations and the statements in a block, and having the braces in
separate lines), I went ahead and made a few other formatting changes
too. This is what I'm checking in mainline and 3.0 branch.
Index: gcc/ChangeLog
from Igor Shevlyakov <igor@windriver.com>
* config/sh/sh.c (output_branch): Support for insn with lenght
attr 12 & 16 which represents cond branches outside +-4096 range.
Index: gcc/config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.c,v
retrieving revision 1.94
diff -u -p -r1.94 sh.c
--- gcc/config/sh/sh.c 2001/05/04 15:06:36 1.94
+++ gcc/config/sh/sh.c 2001/06/03 22:14:03
@@ -799,8 +799,12 @@ output_branch (logic, insn, operands)
rtx insn;
rtx *operands;
{
- switch (get_attr_length (insn))
+ int len = get_attr_length (insn);
+
+ switch (len)
{
+ case 16:
+ case 12:
case 6:
/* This can happen if filling the delay slot has caused a forward
branch to exceed its range (we could reverse it, but only
@@ -823,16 +827,24 @@ output_branch (logic, insn, operands)
if (final_sequence
&& ! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
{
- asm_fprintf (asm_out_file, "\tb%s%ss\t%LLF%d\n", logic ? "f" : "t",
+ asm_fprintf (asm_out_file, "\tb%s%ss\t%LLF%d\n",
+ logic ? "f" : "t",
ASSEMBLER_DIALECT ? "/" : ".", label);
print_slot (final_sequence);
}
else
- asm_fprintf (asm_out_file, "\tb%s\t%LLF%d\n", logic ? "f" : "t", label);
+ asm_fprintf (asm_out_file, "\tb%s\t%LLF%d\n", logic ? "f" : "t",
+ label);
- output_asm_insn ("bra\t%l0", &op0);
- fprintf (asm_out_file, "\tnop\n");
- ASM_OUTPUT_INTERNAL_LABEL(asm_out_file, "LF", label);
+ if (len == 6)
+ {
+ output_asm_insn ("bra\t%l0", &op0);
+ fprintf (asm_out_file, "\tnop\n");
+ }
+ else
+ output_far_jump (insn, op0);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LF", label);
return "";
}
--
Alexandre Oliva, GCC Team +55 19 9714-3658