forked from len0rd/rockbox
Add ASM optimised range_limit() for ARM, which gives a tiny performance
gain. Removed a couple of tabs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8740 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f285f60936
commit
6e3ad7eead
1 changed files with 12 additions and 2 deletions
|
@ -172,6 +172,16 @@ INLINE unsigned range_limit(int value)
|
||||||
[v]"+r"(value)
|
[v]"+r"(value)
|
||||||
);
|
);
|
||||||
return value;
|
return value;
|
||||||
|
#elif defined(CPU_ARM)
|
||||||
|
asm (
|
||||||
|
"adds %[v], %[v], #128\n" /* value += 128 */
|
||||||
|
"movmi %[v], #0 \n" /* clip to 0 if negative result */
|
||||||
|
"cmp %[v], #255 \n" /* did we exceed 255? */
|
||||||
|
"movgt %[v], #255 \n" /* yes, clip to limit */
|
||||||
|
:
|
||||||
|
[v]"+r"(value)
|
||||||
|
);
|
||||||
|
return value;
|
||||||
#else
|
#else
|
||||||
value += 128;
|
value += 128;
|
||||||
|
|
||||||
|
@ -2062,8 +2072,8 @@ int scroll_bmp(struct t_disp* pdisp)
|
||||||
switch(button)
|
switch(button)
|
||||||
{
|
{
|
||||||
case JPEG_LEFT:
|
case JPEG_LEFT:
|
||||||
if (!(ds < ds_max) && entries > 0 && jpg.x_size <= MAX_X_SIZE)
|
if (!(ds < ds_max) && entries > 0 && jpg.x_size <= MAX_X_SIZE)
|
||||||
return change_filename(DIR_PREV);
|
return change_filename(DIR_PREV);
|
||||||
case JPEG_LEFT | BUTTON_REPEAT:
|
case JPEG_LEFT | BUTTON_REPEAT:
|
||||||
move = MIN(HSCROLL, pdisp->x);
|
move = MIN(HSCROLL, pdisp->x);
|
||||||
if (move > 0)
|
if (move > 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue