On Sat, Jan 9, 2010 at 3:22 PM, Joerg Sonnenberger
<jo...@britannica.bec.de> wrote:
> On Sat, Jan 09, 2010 at 02:41:02PM -0800, Philip Guenther wrote:
...
>> > I find your lack of type checking before trolling disturbing.
...
>> AFAICT, the only difference between the two variants that I can see is
>> that the shift version might behave differently if numvnodes is
>> negative, which can't happen.  Can you be less funny and more clear
>> about what type checking issue you see?
>
> 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.

Oh, so this had nothing to do with correctness and everything to do
with code bumming?  I'm wasn't familiar with that use of the phrase
"type checking".  'scuse me while I go back to sleep.


Philip Guenther

Reply via email to