diff options
Diffstat (limited to 'apps/codecs/libtremor')
-rw-r--r-- | apps/codecs/libtremor/mapping0.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/apps/codecs/libtremor/mapping0.c b/apps/codecs/libtremor/mapping0.c index 3f082c5d58..9284775718 100644 --- a/apps/codecs/libtremor/mapping0.c +++ b/apps/codecs/libtremor/mapping0.c | |||
@@ -228,23 +228,25 @@ static inline void channel_couple(ogg_int32_t *pcmM, ogg_int32_t *pcmA, int n) | |||
228 | 228 | ||
229 | #elif defined CPU_COLDFIRE | 229 | #elif defined CPU_COLDFIRE |
230 | 230 | ||
231 | #define MAGANG( _mag, _ang, _pcmA, _pcmM, _off )\ | 231 | #define MAGANG( _mag, _ang, _off )\ |
232 | {\ | 232 | {\ |
233 | int temp;\ | 233 | asm volatile( "tst.l %[mag]\n\t"\ |
234 | asm volatile( "move.l %[ang], %[temp]\n\t"\ | ||
235 | "tst.l %[mag]\n\t"\ | ||
236 | "bgt.s 1f\n\t"\ | 234 | "bgt.s 1f\n\t"\ |
237 | "neg.l %[temp]\n\t"\ | 235 | "neg.l %[ang]\n\t" /* neg sets cc so we might as well jump */ \ |
236 | "ble.s 2f\n\t"\ | ||
237 | ".word 0x51fb\n\t" /* trapf.l, shadow next 2 insns */ \ | ||
238 | /* if we didn't jump, the next test will */ \ | ||
239 | /* false anyway */ \ | ||
238 | "1:\n\t"\ | 240 | "1:\n\t"\ |
239 | "tst.l %[ang]\n\t"\ | 241 | "tst.l %[ang]\n\t"\ |
240 | "bgt.s 2f\n\t"\ | 242 | "bgt.s 2f\n\t"\ |
241 | "add.l %[mag], %[temp]\n\t"\ | 243 | "add.l %[mag], %[ang]\n\t"\ |
242 | "move.l %[temp], (" #_off ", %[pcmM])\n\t"\ | 244 | "move.l %[ang], (" #_off ", %[pcmM])\n\t"\ |
243 | ".word 0x51fa\n\t" /* trapf.w, shadow next insn */ \ | 245 | ".word 0x51fa\n\t" /* trapf.w, shadow next insn */ \ |
244 | "2:\n\t"\ | 246 | "2:\n\t"\ |
245 | "sub.l %[temp], %[mag]\n\t"\ | 247 | "sub.l %[ang], %[mag]\n\t"\ |
246 | "move.l %[mag], (%[pcmA])+\n\t"\ | 248 | "move.l %[mag], (%[pcmA])+\n\t"\ |
247 | : [mag] "+r" ( ( _mag ) ), [ang] "+d" ( ( _ang ) ), [temp] "=&d" (temp),\ | 249 | : [mag] "+r" ( ( _mag ) ), [ang] "+d" ( ( _ang ) ),\ |
248 | [pcmA] "+a" (pcmA)\ | 250 | [pcmA] "+a" (pcmA)\ |
249 | : [pcmM] "a" (pcmM)\ | 251 | : [pcmM] "a" (pcmM)\ |
250 | : "cc", "memory" );\ | 252 | : "cc", "memory" );\ |
@@ -262,10 +264,11 @@ static inline void channel_couple(ogg_int32_t *pcmM, ogg_int32_t *pcmA, unsigned | |||
262 | [A0] "=r" (A0), [A1] "=r" (A1), [A2] "=r" (A2), [A3] "=r" (A3) | 264 | [A0] "=r" (A0), [A1] "=r" (A1), [A2] "=r" (A2), [A3] "=r" (A3) |
263 | : [pcmM] "a" (pcmM), [pcmA] "a" (pcmA) ); | 265 | : [pcmM] "a" (pcmM), [pcmA] "a" (pcmA) ); |
264 | 266 | ||
265 | MAGANG( M0, A0, pcmA, pcmM, 0 ); | 267 | /* use offsets instead of autoinc since the store to pcmM is conditional */ |
266 | MAGANG( M1, A1, pcmA, pcmM, 4 ); | 268 | MAGANG( M0, A0, 0 ); |
267 | MAGANG( M2, A2, pcmA, pcmM, 8 ); | 269 | MAGANG( M1, A1, 4 ); |
268 | MAGANG( M3, A3, pcmA, pcmM, 12 ); | 270 | MAGANG( M2, A2, 8 ); |
271 | MAGANG( M3, A3, 12 ); | ||
269 | 272 | ||
270 | asm volatile( "lea.l (4*4, %[pcmM]), %[pcmM]\n\t" | 273 | asm volatile( "lea.l (4*4, %[pcmM]), %[pcmM]\n\t" |
271 | : [pcmM] "+a" (pcmM)); | 274 | : [pcmM] "+a" (pcmM)); |