News for hackers. Stuff that matters.
Re:Efficient C Tip – use the modulus (%) operator with caution by tspiteri on Tuesday February 08, 2011 @07:02PM (#2195512)
... if the expression can't be reduced to multiplications/shifts/addition due to division by a constant.

Ah, I missed that. Even on normal processors, for the following:

    int div60(int i) { return i / 60; }
    int mod60(int i) { return i % 60; }
gcc uses one multiplication and some shifts/additions for div60() and two multiplications and some shifts/additions for mod60().

There are no comments on this comment yet.