diff options
author | Jens Arnold <amiconn@rockbox.org> | 2009-06-07 21:27:05 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2009-06-07 21:27:05 +0000 |
commit | 1d6df54df27cb41c02226678a2c8f9feddd1a1e0 (patch) | |
tree | 5fdc6dd98ac0208f5c3351b062063af6914cbefb /apps/plugins/lib/helper.c | |
parent | c3182ec333982e961d3babfbdb1125fd5bac7fb8 (diff) | |
download | rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.tar.gz rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.zip |
Convert a number of places in core and plugins to use the BIT_N() macro instead of 1<<n. Speeds up things on SH1, and also reduces core binsize. Most notable speedups: 1 bit lcd driver: drawpixel +20%, drawline + 27%, hline +5%; jpeg viewer: +8% for 1/8 scaling. Other targets are unaffected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21205 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/helper.c')
-rw-r--r-- | apps/plugins/lib/helper.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c index e35e43a40a..b95ee7ab35 100644 --- a/apps/plugins/lib/helper.c +++ b/apps/plugins/lib/helper.c | |||
@@ -22,6 +22,20 @@ | |||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "helper.h" | 23 | #include "helper.h" |
24 | 24 | ||
25 | #ifdef CPU_SH | ||
26 | /* Lookup table for using the BIT_N() macro in plugins */ | ||
27 | const unsigned bit_n_table[32] = { | ||
28 | 1LU<< 0, 1LU<< 1, 1LU<< 2, 1LU<< 3, | ||
29 | 1LU<< 4, 1LU<< 5, 1LU<< 6, 1LU<< 7, | ||
30 | 1LU<< 8, 1LU<< 9, 1LU<<10, 1LU<<11, | ||
31 | 1LU<<12, 1LU<<13, 1LU<<14, 1LU<<15, | ||
32 | 1LU<<16, 1LU<<17, 1LU<<18, 1LU<<19, | ||
33 | 1LU<<20, 1LU<<21, 1LU<<22, 1LU<<23, | ||
34 | 1LU<<24, 1LU<<25, 1LU<<26, 1LU<<27, | ||
35 | 1LU<<28, 1LU<<29, 1LU<<30, 1LU<<31 | ||
36 | }; | ||
37 | #endif | ||
38 | |||
25 | /* Force the backlight on */ | 39 | /* Force the backlight on */ |
26 | void backlight_force_on(void) | 40 | void backlight_force_on(void) |
27 | { | 41 | { |