cvs commit: src/sys/i386/i386 pmap.c
Alexander Leidinger
Alexander at Leidinger.net
Mon Nov 10 21:04:07 PST 2003
On Sun, 26 Oct 2003 12:13:37 +0100
des at des.no (Dag-Erling Smørgrav) wrote:
> Is there any way to teach (or trick) gcc to generate a branch which
> the p4 will predict correctly?
First of all:
---snip---
`-fno-guess-branch-probability'
Do not guess branch probabilities using a randomized model.
Sometimes gcc will opt to use a randomized model to guess branch
probabilities, when none are available from either profiling
feedback (`-fprofile-arcs') or `__builtin_expect'. This means that
different runs of the compiler on the same program may produce
different object code.
In a hard real-time system, people don't want different runs of the
compiler to produce code that has different behavior; minimizing
non-determinism is of paramount import. This switch allows users
to reduce non-determinism, possibly at the expense of inferior
optimization.
The default is `-fguess-branch-probability' at levels `-O', `-O2',
`-O3', `-Os'.
---snip---
Except instrumenting the code with "expect" or using "-fprofile-arcs"
there's only the possibility to modify the code of gcc to match our
existing model...
Bye,
Alexander.
--
I believe the technical term is "Oops!"
http://www.Leidinger.net Alexander @ Leidinger.net
GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7
More information about the cvs-src
mailing list