]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib: vsprintf: optimize put_dec_trunc8()
authorGeorge Spelvin <linux@horizon.com>
Fri, 28 Sep 2012 00:20:13 +0000 (10:20 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:01:19 +0000 (14:01 +1000)
commitf94ef8d524c8d721b5a54be664d047b6bc22a36a
treec7b5b0f36d73d5d9dccdf0d142c3db39ec67832e
parent9dcf1c4f1ab974871dfc0dc87e97fccf29656d7b
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