This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ARM THUMB: fundamental bug in handling of far jumps?
Excerpt of message (sent 30 January 2002) by Richard Henderson:
> On Wed, Jan 30, 2002 at 11:30:51AM +0000, Richard Earnshaw wrote:
> > The static prediction rules are trivial:
> >
> > - unconditional branches are predicted taken, as are unconditional
> > calls to subroutines
> > - conditional calls to subroutines are predicted not-taken
> > - conditional branches are predicted taken if they are backwards and
> > not taken if they are forwards.
> [...]
> > So it would make sense if GCC's block re-ordering code could be made to
> > take rules such as these into account.
>
> Generally it does, since these are approximately the same rules
> that other target's static predictors use. And the rules used
> to initialize the state of a dynamic predictor given a branch
> tag cache miss.
Yes... alpha for one, and perhaps vax as well? But as I mentioned,
there are weird cases. The 68040 rule (conditional branches predicted
taken no matter which direction they go) came as a surprise, but the
manual is quite explicit about it... So, ideally, the static rules
used for reordering should be under control of target-specific tests
(at compiler runtime since -m68040 may want it different from
-m68xxx).
paul