This is the mail archive of the gcc@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]

Re: Handling of -fpic in ASM_OUTPUT_MI_THUNK in sparc


On Thu, Nov 20, 1997 at 07:55:29PM -0500, John Carr wrote:
> On SPARC processors other than UltraSPARC call is at least as fast as
> jmpl.

True, but the issue in the case of the thunk is not jmpl vs call
per se, but eliminating the two runtime relocations needed when
the sethi+jmpl references a symbol in a shared library.

> On UltraSPARC using a call without a matching return confuses
> the return prediction stack.  It takes an extra 2-4 cycles to fetch
> the correct set of instructions.  (For this reason, I think the recent
> change to use call instead of rd %pc for V9 PIC was wrong even though
> rd takes longer to execute.)

But rd %pc not only has 5 ticks latency, it inserts 4 bubbles as
well, so nothing else gets done.  I'll leave it to the experts,
but trading off 2-4 cycles of branch mispredict is a close thing.


r~


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