summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2006-02-19 18:57:46 +0000
committerThom Johansen <thomj@rockbox.org>2006-02-19 18:57:46 +0000
commit6e3ad7eead0ed91e83aebb474ed4463d79583fd5 (patch)
treeb2bc8768efbfe4914c917b814de1add336e629ff /apps/plugins
parentf285f60936797a5ad7b63ae37a8f0a7dd3a453f0 (diff)
downloadrockbox-6e3ad7eead0ed91e83aebb474ed4463d79583fd5.tar.gz
rockbox-6e3ad7eead0ed91e83aebb474ed4463d79583fd5.zip
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
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/jpeg.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 4a20da1a55..d574bdada8 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -172,6 +172,16 @@ INLINE unsigned range_limit(int value)
172 [v]"+r"(value) 172 [v]"+r"(value)
173 ); 173 );
174 return value; 174 return value;
175#elif defined(CPU_ARM)
176 asm (
177 "adds %[v], %[v], #128\n" /* value += 128 */
178 "movmi %[v], #0 \n" /* clip to 0 if negative result */
179 "cmp %[v], #255 \n" /* did we exceed 255? */
180 "movgt %[v], #255 \n" /* yes, clip to limit */
181 :
182 [v]"+r"(value)
183 );
184 return value;
175#else 185#else
176 value += 128; 186 value += 128;
177 187
@@ -2062,8 +2072,8 @@ int scroll_bmp(struct t_disp* pdisp)
2062 switch(button) 2072 switch(button)
2063 { 2073 {
2064 case JPEG_LEFT: 2074 case JPEG_LEFT:
2065 if (!(ds < ds_max) && entries > 0 && jpg.x_size <= MAX_X_SIZE) 2075 if (!(ds < ds_max) && entries > 0 && jpg.x_size <= MAX_X_SIZE)
2066 return change_filename(DIR_PREV); 2076 return change_filename(DIR_PREV);
2067 case JPEG_LEFT | BUTTON_REPEAT: 2077 case JPEG_LEFT | BUTTON_REPEAT:
2068 move = MIN(HSCROLL, pdisp->x); 2078 move = MIN(HSCROLL, pdisp->x);
2069 if (move > 0) 2079 if (move > 0)