Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 911918aa authored by Nicolas Pitre's avatar Nicolas Pitre
Browse files

div64.h: optimize do_div() for power-of-two constant divisors



Let's perform the obvious mask and shift operation in this case.

On 32-bit targets, gcc is able to do the same thing with a constant
divisor that happens to be a power of two i.e. it turns the division
into an inline shift, but it doesn't hurt to be explicit.

Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
parent 1c07db46
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment