On Sat, Jan 09, 2010 at 06:35:45PM -0500, Ted Unangst wrote:
> On Sat, Jan 9, 2010 at 6:22 PM, Joerg Sonnenberger
> <jo...@britannica.bec.de> wrote:
> > You have analysed the situation correctly. The problem is that the
> > compiler does not know that the signed numvnodes is never negative, so
> > it creates different code. E.g. on AMD64 it is 6 instructions for the
> > signed division by 2 compared to one instruction for the explicit shift
> > or the unsigned division.
> 
> That's a good argument for making numvnodes unsigned, but not for
> obfuscating the code.

With respect to 'obfuscating', I would agree with you, except
using shift to divide (or multiply) by two, or multiples of two,
is very common.

--patrick

Reply via email to