[PATCH v2] Try and get overlapping cases fixed.
Keith Packard
keithp at keithp.com
Mon Aug 15 15:41:17 PDT 2011
On Mon, 16 May 2011 13:01:44 -0400, Adam Jackson <ajax at redhat.com> wrote:
> On 5/16/11 12:26 PM, Jeremy Huddleston wrote:
> > Is the one div needed for:
> >
> > bpp / 8
> > bpp % 8
> >
> > really universally faster than the two bitwise ops needed for
> >
> > bpp >> 3
> > bpp & 0x7
> >
> > ? I'm sure most modern compilers will know how to optimize that
> > based on the target CPU, but I've always tried to avoid doing mults
> > and divs in fast paths where possible.
>
> Even if it's ten cycles slower, I'm going to wager it pales next to the
> hundreds-to-millions of cycles of memcpy.
I'm assuming this patch is still useful? Bug 36165 is on the 1.11
tracker.
If it's useful, I'll merge it in (with the divide operations replaced
with bit operations; yes, I looked at the assembly output; bpp is
signed, making the operations longer).
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110815/10deb93e/attachment.pgp>
More information about the xorg-devel
mailing list