1
0
Fork 0
forked from len0rd/rockbox

H1x0: Slight optimisation of the grayscale library.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7646 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-10-20 19:56:32 +00:00
parent 4b2aa9830e
commit ddad7197ed
2 changed files with 10 additions and 8 deletions

View file

@ -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"