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: PowerPC PIC code addressibility tweak


David Edelsohn wrote:
> 
> >>>>> Segher Boessenkool writes:
> 
> Segher> Another idea: why not generate something like
> 
> Segher> bl $+4 ; blr
> 
>         Think about the instruction to which the blr instruction
> branches.  Exercise for the reader.

David,

Oops.  I feel so ashamed now :)

	bl $+8 ; b $+8 ; blr

and

	bl $+12 ; b $+12 ; .long XXXX ; blr

should work.  I didn't do any timings though; as it's highly likely
that actual processors just look at the "31" in bcl 20,31,$+4 and not
at the "$+4" for the link-stack-or-not decision, my bets are your code
is better.


Segher



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