lkml.org 
[lkml]   [2005]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: .../asm-i386/bitops.h performance improvements
On Wed, 15 Jun 2005 cutaway@bellsouth.net wrote:

> In find_first_bit() there exists this the sequence:
>
> shll $3,%%edi
> addl %%edi,%%eax
>
> LEA knows how to multiply by small powers of 2 and add all in one shot very
> efficiently:
>
> leal (%%eax,%%edi,8),%%eax

Be careful about model-specific penalties from using certain address
modes and AGIs when using "lea" for such calculations.

Maciej
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-15 17:39    [W:1.144 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site