This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Increase length of non-braf branches


Hi Joern,

Oh right, that's the SH1 PIC stuff.

2001-02-02 Alexandre Oliva <aoliva@redhat.com>

        * config/sh/sh.c (output_far_jump): Don't use braf on SH1.  Emit
        label before alignment to be used as the braf base address.
        * config/sh/sh.md (length): Use longer lengths for SH1 PIC far
        branches.
        (casesi_jump_2): Require at least TARGET_SH2.


The correct length for this is 18. 12 bytes for instructions, 4 bytes for the constant, and 2 bytes for the case we need padding to make the constant aligned. As stated before, unfilled delay slots are accounted for in ADJUST_INSN_LENGTH.

So this should be something like:

                (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn (insn))")
                         (symbol_ref "INSN"))
                     (eq (symbol_ref "INSN_CODE (prev_nonnote_insn (insn))")
                         (symbol_ref "code_for_indirect_jump_scratch")))
                (cond [(eq_attr "braf_branch_p" "yes")
                       (const_int 6)
                       (eq (symbol_ref "flag_pic") (const_int 0))
                       (const_int 10)
                       (ne (symbol_ref "TARGET_SH2") (const_int 0))
                       (const_int 10)] (const_int 18))

Works very well for me. May I check this version in, or will you do it ?


Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]