]> 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>
Wed, 3 Oct 2012 06:50:40 +0000 (16:50 +1000)
commitcb8ab9f6266e398dcbb83fe0ed5a235d7e1e5b84
tree5cd069d4ed2faf6b57038c5401cd82373b8b5b31
parent6dcbeef233a32825be8fee355ad03df68a7dfd9a
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