diff options
author | Wolfgang Denk <wd@denx.de> | 2009-04-05 00:27:57 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-04-05 00:27:57 +0200 |
commit | c0a14aedc3440d6591b8c86d45861a0a8b46e11d (patch) | |
tree | f451e0641b2c9558ee2dbe0087ea340676f1ea2f /lib_generic | |
parent | f63728c804ab7413a67d70f6774cd30c3f7b40fb (diff) | |
download | u-boot-imx-c0a14aedc3440d6591b8c86d45861a0a8b46e11d.zip u-boot-imx-c0a14aedc3440d6591b8c86d45861a0a8b46e11d.tar.gz u-boot-imx-c0a14aedc3440d6591b8c86d45861a0a8b46e11d.tar.bz2 |
Update CHANGELOG, coding style cleanup.
Diffstat (limited to 'lib_generic')
-rw-r--r-- | lib_generic/vsprintf.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib_generic/vsprintf.c b/lib_generic/vsprintf.c index 3ab1f5c..7f534c7 100644 --- a/lib_generic/vsprintf.c +++ b/lib_generic/vsprintf.c @@ -200,13 +200,15 @@ static char* put_dec_full(char *buf, unsigned q) d2 = (q>>8) & 0xf; d3 = (q>>12); - /* Possible ways to approx. divide by 10 */ - /* gcc -O2 replaces multiply with shifts and adds */ - // (x * 0xcd) >> 11: 11001101 - shorter code than * 0x67 (on i386) - // (x * 0x67) >> 10: 1100111 - // (x * 0x34) >> 9: 110100 - same - // (x * 0x1a) >> 8: 11010 - same - // (x * 0x0d) >> 7: 1101 - same, shortest code (on i386) + /* + * Possible ways to approx. divide by 10 + * gcc -O2 replaces multiply with shifts and adds + * (x * 0xcd) >> 11: 11001101 - shorter code than * 0x67 (on i386) + * (x * 0x67) >> 10: 1100111 + * (x * 0x34) >> 9: 110100 - same + * (x * 0x1a) >> 8: 11010 - same + * (x * 0x0d) >> 7: 1101 - same, shortest code (on i386) + */ d0 = 6*(d3 + d2 + d1) + (q & 0xf); q = (d0 * 0xcd) >> 11; |