summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-10-20 19:56:32 +0000
committerJens Arnold <amiconn@rockbox.org>2005-10-20 19:56:32 +0000
commitddad7197ed4d3c9db25bcbbcafd40ff82ad4b717 (patch)
tree105c19a3347a5684d1bde1d9615f38e77557fa3b /apps
parent4b2aa9830ef0bb79d1089f35a974cd7cfb592422 (diff)
downloadrockbox-ddad7197ed4d3c9db25bcbbcafd40ff82ad4b717.tar.gz
rockbox-ddad7197ed4d3c9db25bcbbcafd40ff82ad4b717.tar.bz2
rockbox-ddad7197ed4d3c9db25bcbbcafd40ff82ad4b717.zip
H1x0: Slight optimisation of the grayscale library.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7646 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/lib/gray_core.c9
-rw-r--r--apps/plugins/lib/gray_draw.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/apps/plugins/lib/gray_core.c b/apps/plugins/lib/gray_core.c
index ed37f6164d..f132d00495 100644
--- a/apps/plugins/lib/gray_core.c
+++ b/apps/plugins/lib/gray_core.c
@@ -562,7 +562,7 @@ void gray_update_rect(int x, int y, int width, int height)
/* pop all 8 patterns */
"not.l %[mask] \n" /* set mask -> keep mask */
"and.l #0xFF,%[mask] \n"
- "beq.b .ur_sloop \n" /* yes: jump to short loop */
+ "beq.b .ur_sstart \n" /* yes: jump to short loop */
".ur_floop: \n" /** full loop (there are bits to keep)**/
"clr.l %%d0 \n"
@@ -599,6 +599,9 @@ void gray_update_rect(int x, int y, int width, int height)
"bhi.b .ur_floop \n" /* no: loop */
"bra.b .ur_end \n"
+
+ ".ur_sstart: \n"
+ "move.l %%a0,%[mask]\n" /* mask isn't needed here, reuse reg */
".ur_sloop: \n" /** short loop (nothing to keep) **/
"clr.l %%d0 \n"
@@ -612,10 +615,8 @@ void gray_update_rect(int x, int y, int width, int height)
"addx.l %%d0,%%d0 \n"
"lsr.l #1,%%d6 \n"
"addx.l %%d0,%%d0 \n"
- "move.l %%a0,%%d1 \n"
- "lsr.l #1,%%d1 \n"
+ "lsr.l #1,%[mask] \n"
"addx.l %%d0,%%d0 \n"
- "move.l %%d1,%%a0 \n"
"move.l %%a1,%%d1 \n"
"lsr.l #1,%%d1 \n"
"addx.l %%d0,%%d0 \n"
diff --git a/apps/plugins/lib/gray_draw.c b/apps/plugins/lib/gray_draw.c
index 9ece730f43..c9f9d5d513 100644
--- a/apps/plugins/lib/gray_draw.c
+++ b/apps/plugins/lib/gray_draw.c
@@ -823,7 +823,7 @@ static void _writearray(unsigned char *address, const unsigned char *src,
/* pop all 8 patterns */
"not.l %[mask] \n" /* "set" mask -> "keep" mask */
"and.l #0xFF,%[mask] \n"
- "beq.b .wa_sloop \n" /* yes: jump to short loop */
+ "beq.b .wa_sstart \n" /* yes: jump to short loop */
".wa_floop: \n" /** full loop (there are bits to keep)**/
"clr.l %%d0 \n"
@@ -860,6 +860,9 @@ static void _writearray(unsigned char *address, const unsigned char *src,
"bhi.b .wa_floop \n" /* no: loop */
"bra.b .wa_end \n"
+
+ ".wa_sstart: \n"
+ "move.l %%a0,%[mask]\n" /* mask isn't needed here, reuse reg */
".wa_sloop: \n" /** short loop (nothing to keep) **/
"clr.l %%d0 \n"
@@ -873,10 +876,8 @@ static void _writearray(unsigned char *address, const unsigned char *src,
"addx.l %%d0,%%d0 \n"
"lsr.l #1,%%d6 \n"
"addx.l %%d0,%%d0 \n"
- "move.l %%a0,%%d1 \n"
- "lsr.l #1,%%d1 \n"
+ "lsr.l #1,%[mask] \n"
"addx.l %%d0,%%d0 \n"
- "move.l %%d1,%%a0 \n"
"move.l %%a1,%%d1 \n"
"lsr.l #1,%%d1 \n"
"addx.l %%d0,%%d0 \n"