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:
parent
c3182ec333
commit
1d6df54df2
24 changed files with 88 additions and 70 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright (C) 1996-1998 Szeredi Miklos
|
||||
* Email: mszeredi@inf.bme.hu
|
||||
*
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "spperif.h"
|
||||
|
||||
#define MARK_SCR(addr) SPNM(scr_mark)[(addr) >> 5] |= 1 << ((addr) & 0x1F)
|
||||
#define MARK_SCR(addr) SPNM(scr_mark)[(addr) >> 5] |= BIT_N((addr) & 0x1F)
|
||||
|
||||
#define PUTMEM(addr, ptr, val) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ int spkb_state_changed;
|
|||
|
||||
#define SKE {0, 0, 0, 0, 0, 0, 0, 0}
|
||||
|
||||
#define SKP(x) (1 << x)
|
||||
#define SKP(x) BIT_N(x)
|
||||
|
||||
#define SKN0(x) {SKP(x), 0, 0, 0, 0, 0, 0, 0}
|
||||
#define SKN1(x) {0, SKP(x), 0, 0, 0, 0, 0, 0}
|
||||
|
|
@ -617,7 +617,7 @@ static void copy_basekeys(struct spbasekey *addk)
|
|||
static unsigned transform_shift(int modif)
|
||||
{
|
||||
if(!modif) return 0;
|
||||
else return (1 << (modif - 1));
|
||||
else return BIT_N(modif - 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright (C) 1996-1998 Szeredi Miklos
|
||||
* Email: mszeredi@inf.bme.hu
|
||||
*
|
||||
|
|
@ -82,7 +82,7 @@ byte *update_screen_line(byte *scrp, int coli, int scri, int border,
|
|||
SPNM(imag_mark)[coli] |= mark;
|
||||
SPNM(imag_horiz) |= mark;
|
||||
coli >>= 3;
|
||||
SPNM(imag_vert) |= (1 << coli);
|
||||
SPNM(imag_vert) |= BIT_N(coli);
|
||||
|
||||
spmp = PRNM(proc).mem + (scri << 5);
|
||||
spcp = PRNM(proc).mem + 0x5800 + (coli << 5);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue