]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib: vsprintf: optimize put_dec_trunc8()
authorGeorge Spelvin <linux@horizon.com>
Thu, 13 Sep 2012 01:01:06 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 17 Sep 2012 10:46:06 +0000 (20:46 +1000)
commitbbf738de405827bc21fab108cab21d2671659ecc
tree0860b4cec023cc78a2f25505d6b92d0d67a98f64
parent16f31216f9e03a3cf400e4735bf5e1845b813153
lib: vsprintf: optimize put_dec_trunc8()

If you're going to have a conditional branch after each 32x32->64-bit
multiply, might as well shrink the code and make it a loop.

This also avoids using the long multiply for small integers.

(This leaves the comments in a confusing state, but that's a separate
patch to make review easier.)

Signed-off-by: George Spelvin <linux@horizon.com>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/vsprintf.c