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
This commit is contained in:
Jens Arnold 2009-06-07 21:27:05 +00:00
parent c3182ec333
commit 1d6df54df2
24 changed files with 88 additions and 70 deletions

View file

@ -22,6 +22,20 @@
#include "plugin.h"
#include "helper.h"
#ifdef CPU_SH
/* Lookup table for using the BIT_N() macro in plugins */
const unsigned bit_n_table[32] = {
1LU<< 0, 1LU<< 1, 1LU<< 2, 1LU<< 3,
1LU<< 4, 1LU<< 5, 1LU<< 6, 1LU<< 7,
1LU<< 8, 1LU<< 9, 1LU<<10, 1LU<<11,
1LU<<12, 1LU<<13, 1LU<<14, 1LU<<15,
1LU<<16, 1LU<<17, 1LU<<18, 1LU<<19,
1LU<<20, 1LU<<21, 1LU<<22, 1LU<<23,
1LU<<24, 1LU<<25, 1LU<<26, 1LU<<27,
1LU<<28, 1LU<<29, 1LU<<30, 1LU<<31
};
#endif
/* Force the backlight on */
void backlight_force_on(void)
{