Re: FarSync T-Series tweak and question

François romieu (romieu@zoreil.com)
Fri, 27 Jul 2001 18:11:27 +0200


The Thu, Jul 26, 2001 at 03:51:23PM +0100, Robert J.Dunlop wrote :
[...]
> > > + if ( ++port->txpos >= NUM_TX_BUFFER )
> > > + port->txpos = 0;
[...]
> > I think mine is clearer but then I've always bumped and wrapped pointers and
> > indexs that way. Another alternative would be:
> > port->txpos = ( port->txpos + 1 ) % NUM_TX_BUFFER;
>
> Having taken the time that the % operation wouldn't be detrimental on other
> processor architectures and having checked with a small test that the
> alternate form produced tighter code on Intel I applied the change to my
> driver. The code that had shrunk in a small test got bigger (and slower?)
> in the driver :-(

Have you the .o at hand ? I'd be curious to objdump them.
Btw, I don't believe either expression impacts the perfs. During init,
it's not time critical and while processing data, it looks like the driver
does himself the dma with the adapter.

--
Ueimor
-
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/