[MPlayer-cvslog] CVS: main configure,1.1048,1.1049
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Sep 3 11:14:14 CEST 2005
Hi,
On Sat, Sep 03, 2005 at 10:56:30AM +0200, Guillaume POIRIER wrote:
> On 9/3/05, Reimar Döffinger CVS <syncmail at mplayerhq.hu> wrote:
> > Log Message:
> > likely() and unlikely() macros to help (newer) compilers optimize correctly
>
> do they optimize the code according to the likelihood to take a jump
> or not? ... or am I completely off track here?
Yes, it tells the compiler (via __builtin_expect) what result to expect
and optimize for that one. This usually means moving the code for the
other case away (e.g. out of the loop). Usually this means much better
speed, not only because the loop is smaller, giving better instruction
cache usage, but also because the storing and reloading of registers
from and to memory (gcc normally creates unbelievably crappy code here)
will be done on the unlikely path if possible.
It should be supported from gcc3 on.
Greetings,
Reimar Döffinger
More information about the MPlayer-cvslog
mailing list