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 patch 4 of 9


Alan Modra <amodra@bigpond.net.au> writes:

> It's best not to hint on PowerPC64 unless we're really sure;  Static
> branch hints disable clever hardware branch history.  Note that this
> changes PowerPC32 hint behaviour slightly for probabilies in the
> range 0.45 to 0.55.  Previously we put out a "-" hint, now we give
> no hint.  I don't think it matters either way..

If the branch is truly nearly 50/50, '-' will be faster then '+'; a
mispredicted-taken is more expensive then a mispredicted-not-taken,
because the first involves two extra icache fetches.

Note that there is no such thing on ppc as a branch with no hint.
There is only the default prediction (taken for backwards branches,
not-taken for forwards ones) and the other one; the idea is that
backwards branches are usually loops.  GCC rearanges code enough that
the default is often wrong.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


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