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


> Umm, well I do not understand the SH code well enough to explain what 
> might be going wrong then.  But I do know that with the example source 
> file I provided and the command line specified (with -dp added) the 
> compiler produces jump_compact insns like this:
> 
> 	mov.l	r1,@-r15;
>          mova	.L2895,r0;
>          mov.l	@r0,r1;
>          add	r1,r0;
>          mov.l	@r15+,r1;
>          jmp	@r0	! 21398	jump_compact	[length = 10]

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))


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