Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2003 05:04:07 -0000
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        des@des.no (Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?=)
Cc:        cvs-src@freebsd.org
Subject:   Re: cvs commit: src/sys/i386/i386 pmap.c
Message-ID:  <20031111040735.26872.qmail@exxodus.fedaykin.here>
In-Reply-To: <xzp3cdgb6am.fsf@dwp.des.no>
References:  <20031026064145.18F0E2A8D5@canning.wemm.org> <xzp3cdgb6am.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 26 Oct 2003 12:13:37 +0100
des@des.no (Dag-Erling Sm=F8rgrav) 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.

--=20
               I believe the technical term is "Oops!"

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint =3D C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031111040735.26872.qmail>