Re: Re: help : likely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Thomas...

>  //             Test the value
>  80483ca:       83 f8 02                cmp    $0x2,%eax
>  //            
> -------------------------------------------------------- //          
>   If 'a' equal to 2 (which is unlikely), then jump, //            
> otherwise continue directly, without jump, so that it //            
> doesn't flush the pipeline.
>  //            
> -------------------------------------------------------- 80483cd:    
>   74 12                   je     80483e1 <main+0x31> 80483cf:      
> 48                      dec    %eax

Pardon me, just trying to clear my own confusion. So, the key here, the 
code path, which is taken when the "likely()" test return TRUE, is 
placed right below the "jump" test so the CPU doesn't get punished by 
wrong branch prediction and therefore save a couple of CPU cycle eaten 
by code prefetch...CMIIW

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux