Re: [PATCH] arch: ia64: kernel: palinfo.c: Optimization of the Code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Thought I would be able to do that. But after testing, I could not
measure any difference.

Thought it would make a noticeable difference, but guess gcc resolve
this in the best way.


Best regards
Rickard Strandqvist


2014-06-02 9:24 GMT+02:00 Clemens Ladisch <clemens@xxxxxxxxxx>:
> Rickard Strandqvist wrote:
>> From what I know, AND is faster then modulo.
>
> Which is why the compiler does this optimization automatically,
> if it can prove that it is correct.
>
>> -             if (i != 0 && (i%64) == 0)
>> +             if (i != 0 && (i&63) == 0)
>
> Did you prove that i cannot be negative?
>
>
> Regards,
> Clemens
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux