1
0
Fork 0
forked from len0rd/rockbox

Optimizations for doom: coldfire asm drawspan routine = not much, fixed point multiply changes = not much, H300 asm lcd update = some, IRAM sound updates and simplifications = more

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9747 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2006-04-20 19:39:56 +00:00
parent 9e9921b087
commit 29ab31e8f1
4 changed files with 106 additions and 49 deletions

View file

@ -47,15 +47,15 @@ inline static int FixedMul( int a, int b )
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
// Code contributed by Thom Johansen
register int result;
asm volatile (
asm (
"mac.l %[x],%[y],%%acc0 \n" /* multiply */
"move.l %[y],%%d2 \n"
"mulu.l %[x],%%d2 \n" /* get lower half, avoid emac stall */
"movclr.l %%acc0,%[result] \n" /* get higher half */
"moveq.l #15,%%d1 \n"
"asl.l %%d1,%[result] \n" /* hi <<= 15, plus one free */
"moveq.l #16,%%d1 \n"
"lsr.l %%d1,%%d2 \n" /* (unsigned)lo >>= 16 */
"asl.l #8,%[result] \n" /* hi <<= 15, plus one free */
"asl.l #7,%[result] \n" /* hi <<= 15, plus one free */
"lsr.l #8,%%d2 \n" /* (unsigned)lo >>= 16 */
"lsr.l #8,%%d2 \n" /* (unsigned)lo >>= 16 */
"or.l %%d2 ,%[result] \n" /* combine result */
: /* outputs */
[result]"=&d"(result)
@ -63,7 +63,7 @@ inline static int FixedMul( int a, int b )
[x] "d" (a),
[y] "d" (b)
: /* clobbers */
"d1", "d2"
"d2"
);
return result;
#else