1
0
Fork 0
forked from len0rd/rockbox

libtremor: small tweak to coldfire inline asm function MULT31_SHIFT15, saving one instruction, *tiny* speedup, output unchanged

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28666 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2010-11-26 10:45:33 +00:00
parent c7e5122483
commit b397fe5ae3

View file

@ -56,11 +56,10 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */ asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */
"mulu.l %[y], %[x];" /* get lower half, avoid emac stall */ "mulu.l %[y], %[x];" /* get lower half, avoid emac stall */
"movclr.l %%acc0, %[r];" /* get higher half */ "movclr.l %%acc0, %[r];" /* get higher half */
"asl.l #8, %[r];" /* hi<<16, plus one free */ "swap %[r];" /* hi<<16, plus one free */
"asl.l #8, %[r];"
"lsr.l #8, %[x];" /* (unsigned)lo >> 15 */ "lsr.l #8, %[x];" /* (unsigned)lo >> 15 */
"lsr.l #7, %[x];" "lsr.l #7, %[x];"
"or.l %[x], %[r];" /* logical-or results */ "move.w %[x], %[r];" /* logical-or results */
: [r] "=&d" (r), [x] "+d" (x) : [r] "=&d" (r), [x] "+d" (x)
: [y] "d" (y) : [y] "d" (y)
: "cc"); : "cc");