[PATCH 14/18] xfixes: switch to byte counting functions

Julien Cristau jcristau at debian.org
Fri Jul 10 03:45:11 PDT 2009


On Fri, Jul 10, 2009 at 11:33:59 +0100, Bill Crawford wrote:

> Peter Hutterer wrote:
> 
> > -    nbytesRound = (nbytes + 3) & ~3;
> > +    nbytesRound = pad_to_dwords(nbytes);
> 
> You're replacing two arithmetic operations with a function call here, 
> and then ...
> 
> > -    rep->length = npixels + (nbytesRound >> 2);
> > +    rep->length = npixels + num_dwords_for_bytes(nbytesRound);
> 
> Is it really worth replacing a two-bit shift with a function call?
> 
They're static inlines, so this shouldn't change anything.  Did you
check the generated code?

Cheers,
Julien


More information about the xorg-devel mailing list