Mail Archives: djgpp/1998/07/13/20:46:57
Andrew Crabtree wrote:
>
> >on long integers. In the source code I used x /= 2; y /=2; for clarity,
> >on the assumption that the compiler would replace these operations with
> >shifts.However, it seems this isn't a valid assumption. Replacing the code
> with
> >x >>= 1; y >>= 1; made a large speed up.
>
> Just a guess, but maybe GCC only does that optimization on unisignd
> integers, not signed integers.
it's true, I checked this. I put "unsigned" in front of the variables
and the 2 loops performed the same (2.74 seconds)
- Raw text -