1
0
Fork 0
forked from len0rd/rockbox

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

@ -155,17 +155,17 @@ int LCDFN(getstringsize)(const unsigned char *str, int *w, int *h)
static void setpixel(int x, int y)
{
LCDFN(framebuffer)[y>>3][x] |= 1 << (y & 7);
LCDFN(framebuffer)[y>>3][x] |= BIT_N(y & 7);
}
static void clearpixel(int x, int y)
{
LCDFN(framebuffer)[y>>3][x] &= ~(1 << (y & 7));
LCDFN(framebuffer)[y>>3][x] &= ~BIT_N(y & 7);
}
static void flippixel(int x, int y)
{
LCDFN(framebuffer)[y>>3][x] ^= 1 << (y & 7);
LCDFN(framebuffer)[y>>3][x] ^= BIT_N(y & 7);
}
static void nopixel(int x, int y)
@ -401,7 +401,7 @@ void LCDFN(hline)(int x1, int x2, int y)
bfunc = LCDFN(blockfuncs)[current_vp->drawmode];
dst = &LCDFN(framebuffer)[y>>3][x1];
mask = 1 << (y & 7);
mask = BIT_N(y & 7);
dst_end = dst + width;
do