div64.h: optimize do_div() for power-of-two constant divisors
authorNicolas Pitre <nicolas.pitre@linaro.org>
Mon, 2 Nov 2015 19:55:05 +0000 (14:55 -0500)
committerNicolas Pitre <nicolas.pitre@linaro.org>
Mon, 16 Nov 2015 19:14:03 +0000 (14:14 -0500)
commit911918aa7ef6f868c135505b0015e42072c54682
treeb12a768b34d0461978276533b73436c4494fe71f
parent1c07db46511f0d2335d3b32008f644164071d13e
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: Nicolas Pitre <nico@linaro.org>
include/asm-generic/div64.h
This page took 0.02432 seconds and 5 git commands to generate.