SH1: Better placement of the C library routine references (gcc 3.4.x -Os and -O2 proof).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9748 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-04-20 19:48:02 +00:00
parent 29ab31e8f1
commit d43e719d59
2 changed files with 18 additions and 26 deletions

View file

@ -509,6 +509,14 @@ void gray_update_rect(int x, int y, int width, int height)
"bra .ur_end \n" "bra .ur_end \n"
"nop \n" "nop \n"
/* References to C library routines used in the precalc block */
".align 2 \n"
".ashlsi3: \n" /* C library routine: */
".long ___ashlsi3 \n" /* shift r4 left by r5, res. in r0 */
".lshrsi3: \n" /* C library routine: */
".long ___lshrsi3 \n" /* shift r4 right by r5, res. in r0 */
/* both routines preserve r4, destroy r5 and take ~16 cycles */
".ur_sloop: \n" /** short loop (nothing to keep) **/ ".ur_sloop: \n" /** short loop (nothing to keep) **/
"shlr r1 \n" /* rotate lsb of pattern 1 to t bit */ "shlr r1 \n" /* rotate lsb of pattern 1 to t bit */
"rotcl r0 \n" /* rotate t bit into r0 */ "rotcl r0 \n" /* rotate t bit into r0 */
@ -740,18 +748,6 @@ void gray_update_rect(int x, int y, int width, int height)
dst += _gray_info.width; dst += _gray_info.width;
} }
} }
#if CONFIG_CPU == SH7034
/* References to C library routines used in gray_update_rect() */
asm (
".align 2 \n"
".ashlsi3: \n" /* C library routine: */
".long ___ashlsi3 \n" /* shift r4 left by r5, return in r0 */
".lshrsi3: \n" /* C library routine: */
".long ___lshrsi3 \n" /* shift r4 right by r5, return in r0 */
/* both routines preserve r4, destroy r5 and take ~16 cycles */
);
#endif /* CONFIG_CPU == SH7034 */
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
/* Update the whole greyscale overlay */ /* Update the whole greyscale overlay */

View file

@ -747,6 +747,14 @@ static void _writearray(unsigned char *address, const unsigned char *src,
"bra .wa_end \n" "bra .wa_end \n"
"nop \n" "nop \n"
/* References to C library routines used in the precalc block */
".align 2 \n"
".ashlsi3: \n" /* C library routine: */
".long ___ashlsi3 \n" /* shift r4 left by r5, result in r0 */
".lshrsi3: \n" /* C library routine: */
".long ___lshrsi3 \n" /* shift r4 right by r5, result in r0 */
/* both routines preserve r4, destroy r5 and take ~16 cycles */
".wa_sloop: \n" /** short loop (nothing to keep) **/ ".wa_sloop: \n" /** short loop (nothing to keep) **/
"shlr r1 \n" /* rotate lsb of pattern 1 to t bit */ "shlr r1 \n" /* rotate lsb of pattern 1 to t bit */
"rotcl r0 \n" /* rotate t bit into r0 */ "rotcl r0 \n" /* rotate t bit into r0 */
@ -898,7 +906,7 @@ static void _writearray(unsigned char *address, const unsigned char *src,
"bhi.b .wa_floop \n" /* no: loop */ "bhi.b .wa_floop \n" /* no: loop */
"bra.b .wa_end \n" "bra.b .wa_end \n"
".wa_sstart: \n" ".wa_sstart: \n"
"move.l %%a0,%[mask]\n" /* mask isn't needed here, reuse reg */ "move.l %%a0,%[mask]\n" /* mask isn't needed here, reuse reg */
@ -951,18 +959,6 @@ static void _writearray(unsigned char *address, const unsigned char *src,
#endif #endif
} }
#if CONFIG_CPU == SH7034
/* References to C library routines used in _writearray() */
asm (
".align 2 \n"
".ashlsi3: \n" /* C library routine: */
".long ___ashlsi3 \n" /* shift r4 left by r5, return in r0 */
".lshrsi3: \n" /* C library routine: */
".long ___lshrsi3 \n" /* shift r4 right by r5, return in r0 */
/* both routines preserve r4, destroy r5 and take ~16 cycles */
);
#endif
/* Draw a partial greyscale bitmap, canonical format */ /* Draw a partial greyscale bitmap, canonical format */
void gray_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, void gray_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height) int stride, int x, int y, int width, int height)
@ -975,7 +971,7 @@ void gray_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
if ((width <= 0) || (height <= 0) || (x >= _gray_info.width) if ((width <= 0) || (height <= 0) || (x >= _gray_info.width)
|| (y >= _gray_info.height) || (x + width <= 0) || (y + height <= 0)) || (y >= _gray_info.height) || (x + width <= 0) || (y + height <= 0))
return; return;
/* clipping */ /* clipping */
if (x < 0) if (x < 0)
{ {