Re: [PATCH] ifplugd: using the __builtin_expect?

Maksym Kryzhanovskyy xmaks at email.cz
Wed Jul 7 15:18:31 UTC 2010


On 07.7.2010 13:22:39, Marek Polacek wrote:
>   On 07/07/2010 12:58 PM, Maksym Kryzhanovskyy wrote:
> > Hi Denis,
> >
> > can we use the __builtin_expect function in busybox?
> > In the previous patch for ifplugd it might be usefull
> > (see attachment).
> >
> >
> > Regards.
> >
> > Max.
> >
> >
> This is optimalization for speed and BB is optimized for size, so we 
> would not gain too much. In Linux kernel is it quite common though -- 
> along with __builtin_prefetch etc.
> 
> BTW: this macro in plain form looks ugly, it is common to define it as
> 
> #define unlikely(x) __builtin_expect(!!(x), 0)
> #define unlikely(x) __builtin_expect(!!(x), 0)
> 
> -- 
> MP
> 
>
>
On 07.7.2010 13:34:29, Bernhard Reutner-Fischer wrote:
> please use likely() / unlikely() instead.
> 
> 

Hi,

thanks for yours reply. I tried to use the 'macrorized' unlikley() only 
for a case when those few extra instruction will be really useful.


BTW: #define _must_ die :-), it's a horror :-( -- sublanguage for each project .. (of course it's a joke)


Regards.

Max.


More information about the busybox mailing list